@dudousxd/nestjs-agent 0.3.1 → 0.3.3
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/{agent-deps.factory-DpVkZYCy.d.cts → agent-deps.factory-D4KyREOv.d.cts} +11 -0
- package/dist/{agent-deps.factory-DpVkZYCy.d.ts → agent-deps.factory-D4KyREOv.d.ts} +11 -0
- package/dist/durable/index.cjs +336 -245
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +4 -4
- package/dist/durable/index.d.ts +4 -4
- package/dist/durable/index.js +279 -188
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +325 -243
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +268 -186
- package/dist/index.js.map +1 -1
- package/dist/sink-redis/index.cjs +144 -0
- package/dist/sink-redis/index.cjs.map +1 -0
- package/dist/sink-redis/index.d.cts +39 -0
- package/dist/sink-redis/index.d.ts +39 -0
- package/dist/sink-redis/index.js +119 -0
- package/dist/sink-redis/index.js.map +1 -0
- package/package.json +20 -5
package/dist/durable/index.js
CHANGED
|
@@ -124,7 +124,9 @@ AgentRunWorkflow = _ts_decorate([
|
|
|
124
124
|
], AgentRunWorkflow);
|
|
125
125
|
|
|
126
126
|
// src/durable/durable-agent-runner.ts
|
|
127
|
+
import { randomUUID } from "node:crypto";
|
|
127
128
|
import { WorkflowService } from "@dudousxd/nestjs-durable";
|
|
129
|
+
import { WorkflowSuspended as WorkflowSuspended2 } from "@dudousxd/nestjs-durable-core";
|
|
128
130
|
import { Injectable as Injectable2 } from "@nestjs/common";
|
|
129
131
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
130
132
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -150,9 +152,16 @@ var DurableAgentRunner = class {
|
|
|
150
152
|
...input,
|
|
151
153
|
day: input.day ?? utcDay()
|
|
152
154
|
};
|
|
153
|
-
const
|
|
155
|
+
const runId = randomUUID();
|
|
156
|
+
try {
|
|
157
|
+
await this.workflows.start(AgentRunWorkflow, stamped, runId);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (!(error instanceof WorkflowSuspended2)) {
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
154
163
|
return {
|
|
155
|
-
runId
|
|
164
|
+
runId
|
|
156
165
|
};
|
|
157
166
|
}
|
|
158
167
|
async signal(runId, toolCallId, decision) {
|
|
@@ -215,7 +224,7 @@ AgentDurableModule = _ts_decorate3([
|
|
|
215
224
|
], AgentDurableModule);
|
|
216
225
|
|
|
217
226
|
// src/agent.module.ts
|
|
218
|
-
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5, AGENT_DEPS_FACTORY as
|
|
227
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY5, AGENT_DURABLE_RUNNER as AGENT_DURABLE_RUNNER2, AGENT_MODEL as AGENT_MODEL2, AGENT_OPTIONS as AGENT_OPTIONS3, AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS3, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE3, AGENT_REGISTRY as AGENT_REGISTRY5, AGENT_ROLES_POLICY as AGENT_ROLES_POLICY2, AGENT_RUNNER as AGENT_RUNNER2, AGENT_SINK as AGENT_SINK2, AGENT_STORE as AGENT_STORE5, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry5, DefaultRolesPolicy, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
|
|
219
228
|
import { Global as Global2, Module as Module2 } from "@nestjs/common";
|
|
220
229
|
import { DiscoveryModule, RouterModule } from "@nestjs/core";
|
|
221
230
|
|
|
@@ -427,6 +436,9 @@ var AgentService = class {
|
|
|
427
436
|
...params.regenerate === true ? {
|
|
428
437
|
regenerate: true
|
|
429
438
|
} : {},
|
|
439
|
+
...params.attachments !== void 0 ? {
|
|
440
|
+
attachments: params.attachments
|
|
441
|
+
} : {},
|
|
430
442
|
...params.pageContext !== void 0 ? {
|
|
431
443
|
pageContext: params.pageContext
|
|
432
444
|
} : {}
|
|
@@ -582,9 +594,9 @@ AgentService = _ts_decorate5([
|
|
|
582
594
|
])
|
|
583
595
|
], AgentService);
|
|
584
596
|
|
|
585
|
-
// src/controller/
|
|
586
|
-
import {
|
|
587
|
-
import {
|
|
597
|
+
// src/controller/agents.controller.ts
|
|
598
|
+
import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY3, AGENT_REGISTRY as AGENT_REGISTRY2, AgentRegistry as AgentRegistry3 } from "@dudousxd/nestjs-agent-core";
|
|
599
|
+
import { Controller, Get, Inject as Inject4 } from "@nestjs/common";
|
|
588
600
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
589
601
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
590
602
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -602,6 +614,64 @@ function _ts_param4(paramIndex, decorator) {
|
|
|
602
614
|
};
|
|
603
615
|
}
|
|
604
616
|
__name(_ts_param4, "_ts_param");
|
|
617
|
+
var AgentsController = class {
|
|
618
|
+
static {
|
|
619
|
+
__name(this, "AgentsController");
|
|
620
|
+
}
|
|
621
|
+
agents;
|
|
622
|
+
depsFactory;
|
|
623
|
+
constructor(agents, depsFactory) {
|
|
624
|
+
this.agents = agents;
|
|
625
|
+
this.depsFactory = depsFactory;
|
|
626
|
+
}
|
|
627
|
+
list() {
|
|
628
|
+
const defaultAgentName = this.depsFactory.defaultAgentName();
|
|
629
|
+
return this.agents.list().map((definition) => ({
|
|
630
|
+
name: definition.name,
|
|
631
|
+
description: definition.description ?? "",
|
|
632
|
+
...definition.name === defaultAgentName ? {
|
|
633
|
+
isDefault: true
|
|
634
|
+
} : {}
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
_ts_decorate6([
|
|
639
|
+
Get(),
|
|
640
|
+
_ts_metadata5("design:type", Function),
|
|
641
|
+
_ts_metadata5("design:paramtypes", []),
|
|
642
|
+
_ts_metadata5("design:returntype", Array)
|
|
643
|
+
], AgentsController.prototype, "list", null);
|
|
644
|
+
AgentsController = _ts_decorate6([
|
|
645
|
+
Controller("agents"),
|
|
646
|
+
_ts_param4(0, Inject4(AGENT_REGISTRY2)),
|
|
647
|
+
_ts_param4(1, Inject4(AGENT_DEPS_FACTORY3)),
|
|
648
|
+
_ts_metadata5("design:type", Function),
|
|
649
|
+
_ts_metadata5("design:paramtypes", [
|
|
650
|
+
typeof AgentRegistry3 === "undefined" ? Object : AgentRegistry3,
|
|
651
|
+
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory
|
|
652
|
+
])
|
|
653
|
+
], AgentsController);
|
|
654
|
+
|
|
655
|
+
// src/controller/chat.controller.ts
|
|
656
|
+
import { AGENT_ACTOR_RESOLVER, AgentStreamError } from "@dudousxd/nestjs-agent-core";
|
|
657
|
+
import { Body, Controller as Controller2, Get as Get2, Inject as Inject5, Param, Post, Req, Res } from "@nestjs/common";
|
|
658
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
659
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
660
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
661
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
662
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
663
|
+
}
|
|
664
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
665
|
+
function _ts_metadata6(k, v) {
|
|
666
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
667
|
+
}
|
|
668
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
669
|
+
function _ts_param5(paramIndex, decorator) {
|
|
670
|
+
return function(target, key) {
|
|
671
|
+
decorator(target, key, paramIndex);
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
__name(_ts_param5, "_ts_param");
|
|
605
675
|
var ChatController = class {
|
|
606
676
|
static {
|
|
607
677
|
__name(this, "ChatController");
|
|
@@ -623,6 +693,9 @@ var ChatController = class {
|
|
|
623
693
|
...body.agent !== void 0 ? {
|
|
624
694
|
agentName: body.agent
|
|
625
695
|
} : {},
|
|
696
|
+
...body.attachments !== void 0 ? {
|
|
697
|
+
attachments: body.attachments
|
|
698
|
+
} : {},
|
|
626
699
|
...body.pageContext !== void 0 ? {
|
|
627
700
|
pageContext: body.pageContext
|
|
628
701
|
} : {},
|
|
@@ -661,11 +734,26 @@ data: ${JSON.stringify({
|
|
|
661
734
|
|
|
662
735
|
`);
|
|
663
736
|
const decoder = new TextDecoder();
|
|
737
|
+
let buffer = "";
|
|
664
738
|
try {
|
|
665
739
|
for await (const chunk of this.agent.subscribe(runId)) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
})
|
|
740
|
+
buffer += decoder.decode(chunk, {
|
|
741
|
+
stream: true
|
|
742
|
+
});
|
|
743
|
+
let newline = buffer.indexOf("\n");
|
|
744
|
+
while (newline !== -1) {
|
|
745
|
+
const line = buffer.slice(0, newline);
|
|
746
|
+
buffer = buffer.slice(newline + 1);
|
|
747
|
+
if (line.length > 0) {
|
|
748
|
+
res.write(`data: ${line}
|
|
749
|
+
|
|
750
|
+
`);
|
|
751
|
+
}
|
|
752
|
+
newline = buffer.indexOf("\n");
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
if (buffer.length > 0) {
|
|
756
|
+
res.write(`data: ${buffer}
|
|
669
757
|
|
|
670
758
|
`);
|
|
671
759
|
}
|
|
@@ -686,46 +774,46 @@ data: ${JSON.stringify(payload)}
|
|
|
686
774
|
res.end();
|
|
687
775
|
}
|
|
688
776
|
};
|
|
689
|
-
|
|
777
|
+
_ts_decorate7([
|
|
690
778
|
Post("chat"),
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
779
|
+
_ts_param5(0, Req()),
|
|
780
|
+
_ts_param5(1, Res()),
|
|
781
|
+
_ts_param5(2, Body()),
|
|
782
|
+
_ts_metadata6("design:type", Function),
|
|
783
|
+
_ts_metadata6("design:paramtypes", [
|
|
696
784
|
typeof Request === "undefined" ? Object : Request,
|
|
697
785
|
typeof Response === "undefined" ? Object : Response,
|
|
698
786
|
typeof ChatBody === "undefined" ? Object : ChatBody
|
|
699
787
|
]),
|
|
700
|
-
|
|
788
|
+
_ts_metadata6("design:returntype", Promise)
|
|
701
789
|
], ChatController.prototype, "chat", null);
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
790
|
+
_ts_decorate7([
|
|
791
|
+
Get2("chat/:runId/stream"),
|
|
792
|
+
_ts_param5(0, Param("runId")),
|
|
793
|
+
_ts_param5(1, Res()),
|
|
794
|
+
_ts_metadata6("design:type", Function),
|
|
795
|
+
_ts_metadata6("design:paramtypes", [
|
|
708
796
|
String,
|
|
709
797
|
typeof Response === "undefined" ? Object : Response
|
|
710
798
|
]),
|
|
711
|
-
|
|
799
|
+
_ts_metadata6("design:returntype", Promise)
|
|
712
800
|
], ChatController.prototype, "stream", null);
|
|
713
|
-
|
|
801
|
+
_ts_decorate7([
|
|
714
802
|
Post("chat/:runId/cancel"),
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
803
|
+
_ts_param5(0, Req()),
|
|
804
|
+
_ts_param5(1, Param("runId")),
|
|
805
|
+
_ts_metadata6("design:type", Function),
|
|
806
|
+
_ts_metadata6("design:paramtypes", [
|
|
719
807
|
typeof Request === "undefined" ? Object : Request,
|
|
720
808
|
String
|
|
721
809
|
]),
|
|
722
|
-
|
|
810
|
+
_ts_metadata6("design:returntype", Promise)
|
|
723
811
|
], ChatController.prototype, "cancel", null);
|
|
724
|
-
ChatController =
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
812
|
+
ChatController = _ts_decorate7([
|
|
813
|
+
Controller2(),
|
|
814
|
+
_ts_param5(1, Inject5(AGENT_ACTOR_RESOLVER)),
|
|
815
|
+
_ts_metadata6("design:type", Function),
|
|
816
|
+
_ts_metadata6("design:paramtypes", [
|
|
729
817
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
730
818
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
731
819
|
])
|
|
@@ -733,24 +821,24 @@ ChatController = _ts_decorate6([
|
|
|
733
821
|
|
|
734
822
|
// src/controller/quota.controller.ts
|
|
735
823
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER2 } from "@dudousxd/nestjs-agent-core";
|
|
736
|
-
import { Controller as
|
|
737
|
-
function
|
|
824
|
+
import { Controller as Controller3, Get as Get3, Inject as Inject6, Req as Req2 } from "@nestjs/common";
|
|
825
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
738
826
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
739
827
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
740
828
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
741
829
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
742
830
|
}
|
|
743
|
-
__name(
|
|
744
|
-
function
|
|
831
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
832
|
+
function _ts_metadata7(k, v) {
|
|
745
833
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
746
834
|
}
|
|
747
|
-
__name(
|
|
748
|
-
function
|
|
835
|
+
__name(_ts_metadata7, "_ts_metadata");
|
|
836
|
+
function _ts_param6(paramIndex, decorator) {
|
|
749
837
|
return function(target, key) {
|
|
750
838
|
decorator(target, key, paramIndex);
|
|
751
839
|
};
|
|
752
840
|
}
|
|
753
|
-
__name(
|
|
841
|
+
__name(_ts_param6, "_ts_param");
|
|
754
842
|
var QuotaController = class {
|
|
755
843
|
static {
|
|
756
844
|
__name(this, "QuotaController");
|
|
@@ -766,20 +854,20 @@ var QuotaController = class {
|
|
|
766
854
|
return this.agent.quotaToday(actor.id);
|
|
767
855
|
}
|
|
768
856
|
};
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
857
|
+
_ts_decorate8([
|
|
858
|
+
Get3("today"),
|
|
859
|
+
_ts_param6(0, Req2()),
|
|
860
|
+
_ts_metadata7("design:type", Function),
|
|
861
|
+
_ts_metadata7("design:paramtypes", [
|
|
774
862
|
typeof Request === "undefined" ? Object : Request
|
|
775
863
|
]),
|
|
776
|
-
|
|
864
|
+
_ts_metadata7("design:returntype", Promise)
|
|
777
865
|
], QuotaController.prototype, "today", null);
|
|
778
|
-
QuotaController =
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
866
|
+
QuotaController = _ts_decorate8([
|
|
867
|
+
Controller3("quota"),
|
|
868
|
+
_ts_param6(1, Inject6(AGENT_ACTOR_RESOLVER2)),
|
|
869
|
+
_ts_metadata7("design:type", Function),
|
|
870
|
+
_ts_metadata7("design:paramtypes", [
|
|
783
871
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
784
872
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
785
873
|
])
|
|
@@ -787,24 +875,24 @@ QuotaController = _ts_decorate7([
|
|
|
787
875
|
|
|
788
876
|
// src/controller/threads.controller.ts
|
|
789
877
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER3 } from "@dudousxd/nestjs-agent-core";
|
|
790
|
-
import { Body as Body2, Controller as
|
|
791
|
-
function
|
|
878
|
+
import { Body as Body2, Controller as Controller4, Delete, Get as Get4, Inject as Inject7, Param as Param2, Patch, Post as Post2, Req as Req3 } from "@nestjs/common";
|
|
879
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
792
880
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
793
881
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
794
882
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
795
883
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
796
884
|
}
|
|
797
|
-
__name(
|
|
798
|
-
function
|
|
885
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
886
|
+
function _ts_metadata8(k, v) {
|
|
799
887
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
800
888
|
}
|
|
801
|
-
__name(
|
|
802
|
-
function
|
|
889
|
+
__name(_ts_metadata8, "_ts_metadata");
|
|
890
|
+
function _ts_param7(paramIndex, decorator) {
|
|
803
891
|
return function(target, key) {
|
|
804
892
|
decorator(target, key, paramIndex);
|
|
805
893
|
};
|
|
806
894
|
}
|
|
807
|
-
__name(
|
|
895
|
+
__name(_ts_param7, "_ts_param");
|
|
808
896
|
var ThreadsController = class {
|
|
809
897
|
static {
|
|
810
898
|
__name(this, "ThreadsController");
|
|
@@ -856,92 +944,92 @@ var ThreadsController = class {
|
|
|
856
944
|
};
|
|
857
945
|
}
|
|
858
946
|
};
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
947
|
+
_ts_decorate9([
|
|
948
|
+
Get4(),
|
|
949
|
+
_ts_param7(0, Req3()),
|
|
950
|
+
_ts_metadata8("design:type", Function),
|
|
951
|
+
_ts_metadata8("design:paramtypes", [
|
|
864
952
|
typeof Request === "undefined" ? Object : Request
|
|
865
953
|
]),
|
|
866
|
-
|
|
954
|
+
_ts_metadata8("design:returntype", Promise)
|
|
867
955
|
], ThreadsController.prototype, "list", null);
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
956
|
+
_ts_decorate9([
|
|
957
|
+
Get4(":id"),
|
|
958
|
+
_ts_param7(0, Req3()),
|
|
959
|
+
_ts_param7(1, Param2("id")),
|
|
960
|
+
_ts_metadata8("design:type", Function),
|
|
961
|
+
_ts_metadata8("design:paramtypes", [
|
|
874
962
|
typeof Request === "undefined" ? Object : Request,
|
|
875
963
|
String
|
|
876
964
|
]),
|
|
877
|
-
|
|
965
|
+
_ts_metadata8("design:returntype", Promise)
|
|
878
966
|
], ThreadsController.prototype, "detail", null);
|
|
879
|
-
|
|
967
|
+
_ts_decorate9([
|
|
880
968
|
Delete(":id"),
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
969
|
+
_ts_param7(0, Req3()),
|
|
970
|
+
_ts_param7(1, Param2("id")),
|
|
971
|
+
_ts_metadata8("design:type", Function),
|
|
972
|
+
_ts_metadata8("design:paramtypes", [
|
|
885
973
|
typeof Request === "undefined" ? Object : Request,
|
|
886
974
|
String
|
|
887
975
|
]),
|
|
888
|
-
|
|
976
|
+
_ts_metadata8("design:returntype", Promise)
|
|
889
977
|
], ThreadsController.prototype, "remove", null);
|
|
890
|
-
|
|
978
|
+
_ts_decorate9([
|
|
891
979
|
Post2(":id/fork-from/:messageId"),
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
980
|
+
_ts_param7(0, Req3()),
|
|
981
|
+
_ts_param7(1, Param2("id")),
|
|
982
|
+
_ts_param7(2, Param2("messageId")),
|
|
983
|
+
_ts_metadata8("design:type", Function),
|
|
984
|
+
_ts_metadata8("design:paramtypes", [
|
|
897
985
|
typeof Request === "undefined" ? Object : Request,
|
|
898
986
|
String,
|
|
899
987
|
String
|
|
900
988
|
]),
|
|
901
|
-
|
|
989
|
+
_ts_metadata8("design:returntype", Promise)
|
|
902
990
|
], ThreadsController.prototype, "fork", null);
|
|
903
|
-
|
|
991
|
+
_ts_decorate9([
|
|
904
992
|
Patch(":id"),
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
993
|
+
_ts_param7(0, Req3()),
|
|
994
|
+
_ts_param7(1, Param2("id")),
|
|
995
|
+
_ts_param7(2, Body2()),
|
|
996
|
+
_ts_metadata8("design:type", Function),
|
|
997
|
+
_ts_metadata8("design:paramtypes", [
|
|
910
998
|
typeof Request === "undefined" ? Object : Request,
|
|
911
999
|
String,
|
|
912
1000
|
typeof RenameThreadBody === "undefined" ? Object : RenameThreadBody
|
|
913
1001
|
]),
|
|
914
|
-
|
|
1002
|
+
_ts_metadata8("design:returntype", Promise)
|
|
915
1003
|
], ThreadsController.prototype, "rename", null);
|
|
916
|
-
|
|
1004
|
+
_ts_decorate9([
|
|
917
1005
|
Post2(":id/promote"),
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1006
|
+
_ts_param7(0, Req3()),
|
|
1007
|
+
_ts_param7(1, Param2("id")),
|
|
1008
|
+
_ts_metadata8("design:type", Function),
|
|
1009
|
+
_ts_metadata8("design:paramtypes", [
|
|
922
1010
|
typeof Request === "undefined" ? Object : Request,
|
|
923
1011
|
String
|
|
924
1012
|
]),
|
|
925
|
-
|
|
1013
|
+
_ts_metadata8("design:returntype", Promise)
|
|
926
1014
|
], ThreadsController.prototype, "promote", null);
|
|
927
|
-
|
|
1015
|
+
_ts_decorate9([
|
|
928
1016
|
Delete(":id/from/:messageId"),
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1017
|
+
_ts_param7(0, Req3()),
|
|
1018
|
+
_ts_param7(1, Param2("id")),
|
|
1019
|
+
_ts_param7(2, Param2("messageId")),
|
|
1020
|
+
_ts_metadata8("design:type", Function),
|
|
1021
|
+
_ts_metadata8("design:paramtypes", [
|
|
934
1022
|
typeof Request === "undefined" ? Object : Request,
|
|
935
1023
|
String,
|
|
936
1024
|
String
|
|
937
1025
|
]),
|
|
938
|
-
|
|
1026
|
+
_ts_metadata8("design:returntype", Promise)
|
|
939
1027
|
], ThreadsController.prototype, "truncateFrom", null);
|
|
940
|
-
ThreadsController =
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1028
|
+
ThreadsController = _ts_decorate9([
|
|
1029
|
+
Controller4("threads"),
|
|
1030
|
+
_ts_param7(1, Inject7(AGENT_ACTOR_RESOLVER3)),
|
|
1031
|
+
_ts_metadata8("design:type", Function),
|
|
1032
|
+
_ts_metadata8("design:paramtypes", [
|
|
945
1033
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
946
1034
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
947
1035
|
])
|
|
@@ -949,24 +1037,24 @@ ThreadsController = _ts_decorate8([
|
|
|
949
1037
|
|
|
950
1038
|
// src/controller/tool-call.controller.ts
|
|
951
1039
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER4 } from "@dudousxd/nestjs-agent-core";
|
|
952
|
-
import { Body as Body3, Controller as
|
|
953
|
-
function
|
|
1040
|
+
import { Body as Body3, Controller as Controller5, Inject as Inject8, Post as Post3, Req as Req4 } from "@nestjs/common";
|
|
1041
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
954
1042
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
955
1043
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
956
1044
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
957
1045
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
958
1046
|
}
|
|
959
|
-
__name(
|
|
960
|
-
function
|
|
1047
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
1048
|
+
function _ts_metadata9(k, v) {
|
|
961
1049
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
962
1050
|
}
|
|
963
|
-
__name(
|
|
964
|
-
function
|
|
1051
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
1052
|
+
function _ts_param8(paramIndex, decorator) {
|
|
965
1053
|
return function(target, key) {
|
|
966
1054
|
decorator(target, key, paramIndex);
|
|
967
1055
|
};
|
|
968
1056
|
}
|
|
969
|
-
__name(
|
|
1057
|
+
__name(_ts_param8, "_ts_param");
|
|
970
1058
|
var ToolCallController = class {
|
|
971
1059
|
static {
|
|
972
1060
|
__name(this, "ToolCallController");
|
|
@@ -992,41 +1080,41 @@ var ToolCallController = class {
|
|
|
992
1080
|
};
|
|
993
1081
|
}
|
|
994
1082
|
};
|
|
995
|
-
|
|
1083
|
+
_ts_decorate10([
|
|
996
1084
|
Post3("approve"),
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1085
|
+
_ts_param8(0, Req4()),
|
|
1086
|
+
_ts_param8(1, Body3()),
|
|
1087
|
+
_ts_metadata9("design:type", Function),
|
|
1088
|
+
_ts_metadata9("design:paramtypes", [
|
|
1001
1089
|
typeof Request === "undefined" ? Object : Request,
|
|
1002
1090
|
typeof ApproveBody === "undefined" ? Object : ApproveBody
|
|
1003
1091
|
]),
|
|
1004
|
-
|
|
1092
|
+
_ts_metadata9("design:returntype", Promise)
|
|
1005
1093
|
], ToolCallController.prototype, "approve", null);
|
|
1006
|
-
|
|
1094
|
+
_ts_decorate10([
|
|
1007
1095
|
Post3("reject"),
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1096
|
+
_ts_param8(0, Req4()),
|
|
1097
|
+
_ts_param8(1, Body3()),
|
|
1098
|
+
_ts_metadata9("design:type", Function),
|
|
1099
|
+
_ts_metadata9("design:paramtypes", [
|
|
1012
1100
|
typeof Request === "undefined" ? Object : Request,
|
|
1013
1101
|
typeof RejectBody === "undefined" ? Object : RejectBody
|
|
1014
1102
|
]),
|
|
1015
|
-
|
|
1103
|
+
_ts_metadata9("design:returntype", Promise)
|
|
1016
1104
|
], ToolCallController.prototype, "reject", null);
|
|
1017
|
-
ToolCallController =
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1105
|
+
ToolCallController = _ts_decorate10([
|
|
1106
|
+
Controller5("tool-call"),
|
|
1107
|
+
_ts_param8(1, Inject8(AGENT_ACTOR_RESOLVER4)),
|
|
1108
|
+
_ts_metadata9("design:type", Function),
|
|
1109
|
+
_ts_metadata9("design:paramtypes", [
|
|
1022
1110
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
1023
1111
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
1024
1112
|
])
|
|
1025
1113
|
], ToolCallController);
|
|
1026
1114
|
|
|
1027
1115
|
// src/discovery/agent-discovery.service.ts
|
|
1028
|
-
import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as
|
|
1029
|
-
import { Inject as
|
|
1116
|
+
import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
|
|
1117
|
+
import { Inject as Inject9, Injectable as Injectable5, Logger } from "@nestjs/common";
|
|
1030
1118
|
import { DiscoveryService, MetadataScanner } from "@nestjs/core";
|
|
1031
1119
|
|
|
1032
1120
|
// src/decorator/agent.decorator.ts
|
|
@@ -1043,23 +1131,23 @@ var SYSTEM_PROMPT_METADATA = Symbol.for("@dudousxd/nestjs-agent:system-prompt");
|
|
|
1043
1131
|
var SYSTEM_PROMPT_CONTRIBUTOR_METADATA = Symbol.for("@dudousxd/nestjs-agent:system-prompt-contributor");
|
|
1044
1132
|
|
|
1045
1133
|
// src/discovery/agent-discovery.service.ts
|
|
1046
|
-
function
|
|
1134
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
1047
1135
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1048
1136
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1049
1137
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1050
1138
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1051
1139
|
}
|
|
1052
|
-
__name(
|
|
1053
|
-
function
|
|
1140
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
1141
|
+
function _ts_metadata10(k, v) {
|
|
1054
1142
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1055
1143
|
}
|
|
1056
|
-
__name(
|
|
1057
|
-
function
|
|
1144
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
1145
|
+
function _ts_param9(paramIndex, decorator) {
|
|
1058
1146
|
return function(target, key) {
|
|
1059
1147
|
decorator(target, key, paramIndex);
|
|
1060
1148
|
};
|
|
1061
1149
|
}
|
|
1062
|
-
__name(
|
|
1150
|
+
__name(_ts_param9, "_ts_param");
|
|
1063
1151
|
var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
1064
1152
|
static {
|
|
1065
1153
|
__name(this, "AgentDiscoveryService");
|
|
@@ -1094,6 +1182,9 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
1094
1182
|
const systemPrompt = promptMethod !== void 0 ? (ctx) => promptMethod(ctx) : meta.systemPrompt ?? "You are a helpful assistant.";
|
|
1095
1183
|
return {
|
|
1096
1184
|
name: meta.name,
|
|
1185
|
+
...meta.description !== void 0 ? {
|
|
1186
|
+
description: meta.description
|
|
1187
|
+
} : {},
|
|
1097
1188
|
systemPrompt,
|
|
1098
1189
|
...meta.tools !== void 0 ? {
|
|
1099
1190
|
tools: meta.tools
|
|
@@ -1153,22 +1244,22 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
1153
1244
|
return (ctx) => candidate.call(instance, ctx);
|
|
1154
1245
|
}
|
|
1155
1246
|
};
|
|
1156
|
-
AgentDiscoveryService =
|
|
1247
|
+
AgentDiscoveryService = _ts_decorate11([
|
|
1157
1248
|
Injectable5(),
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1249
|
+
_ts_param9(2, Inject9(AGENT_REGISTRY3)),
|
|
1250
|
+
_ts_param9(3, Inject9(AGENT_PROMPT_CONTRIBUTORS2)),
|
|
1251
|
+
_ts_metadata10("design:type", Function),
|
|
1252
|
+
_ts_metadata10("design:paramtypes", [
|
|
1162
1253
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
1163
1254
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
1164
|
-
typeof
|
|
1255
|
+
typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4,
|
|
1165
1256
|
Array
|
|
1166
1257
|
])
|
|
1167
1258
|
], AgentDiscoveryService);
|
|
1168
1259
|
|
|
1169
1260
|
// src/discovery/ai-tool-discovery.service.ts
|
|
1170
|
-
import { AGENT_OPTIONS as AGENT_OPTIONS2, AGENT_REGISTRY as
|
|
1171
|
-
import { Inject as
|
|
1261
|
+
import { AGENT_OPTIONS as AGENT_OPTIONS2, AGENT_REGISTRY as AGENT_REGISTRY4, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY2 } from "@dudousxd/nestjs-agent-core";
|
|
1262
|
+
import { Inject as Inject10, Injectable as Injectable6, Logger as Logger2 } from "@nestjs/common";
|
|
1172
1263
|
import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
|
|
1173
1264
|
import { z } from "zod";
|
|
1174
1265
|
|
|
@@ -1188,23 +1279,23 @@ function isBrandedFunctionalTool(value) {
|
|
|
1188
1279
|
__name(isBrandedFunctionalTool, "isBrandedFunctionalTool");
|
|
1189
1280
|
|
|
1190
1281
|
// src/discovery/ai-tool-discovery.service.ts
|
|
1191
|
-
function
|
|
1282
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
1192
1283
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1193
1284
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1194
1285
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1195
1286
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1196
1287
|
}
|
|
1197
|
-
__name(
|
|
1198
|
-
function
|
|
1288
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
1289
|
+
function _ts_metadata11(k, v) {
|
|
1199
1290
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1200
1291
|
}
|
|
1201
|
-
__name(
|
|
1202
|
-
function
|
|
1292
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
1293
|
+
function _ts_param10(paramIndex, decorator) {
|
|
1203
1294
|
return function(target, key) {
|
|
1204
1295
|
decorator(target, key, paramIndex);
|
|
1205
1296
|
};
|
|
1206
1297
|
}
|
|
1207
|
-
__name(
|
|
1298
|
+
__name(_ts_param10, "_ts_param");
|
|
1208
1299
|
var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
1209
1300
|
static {
|
|
1210
1301
|
__name(this, "AiToolDiscoveryService");
|
|
@@ -1311,13 +1402,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
1311
1402
|
return true;
|
|
1312
1403
|
}
|
|
1313
1404
|
};
|
|
1314
|
-
AiToolDiscoveryService =
|
|
1405
|
+
AiToolDiscoveryService = _ts_decorate12([
|
|
1315
1406
|
Injectable6(),
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1407
|
+
_ts_param10(1, Inject10(AGENT_TOOL_REGISTRY2)),
|
|
1408
|
+
_ts_param10(2, Inject10(AGENT_REGISTRY4)),
|
|
1409
|
+
_ts_param10(3, Inject10(AGENT_OPTIONS2)),
|
|
1410
|
+
_ts_metadata11("design:type", Function),
|
|
1411
|
+
_ts_metadata11("design:paramtypes", [
|
|
1321
1412
|
typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
|
|
1322
1413
|
typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
|
|
1323
1414
|
typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
|
|
@@ -1417,25 +1508,25 @@ var LedgerQuotaStore = class {
|
|
|
1417
1508
|
};
|
|
1418
1509
|
|
|
1419
1510
|
// src/runner/inline-agent-runner.ts
|
|
1420
|
-
import { AGENT_DEPS_FACTORY as
|
|
1421
|
-
import { Inject as
|
|
1422
|
-
function
|
|
1511
|
+
import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY4, AGENT_STORE as AGENT_STORE4, QuotaExceededError as QuotaExceededError2, publishAgentRunFailed as publishAgentRunFailed2, runAgentLoop as runAgentLoop2 } from "@dudousxd/nestjs-agent-core";
|
|
1512
|
+
import { Inject as Inject11, Injectable as Injectable7, Logger as Logger3 } from "@nestjs/common";
|
|
1513
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
1423
1514
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1424
1515
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1425
1516
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1426
1517
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1427
1518
|
}
|
|
1428
|
-
__name(
|
|
1429
|
-
function
|
|
1519
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
1520
|
+
function _ts_metadata12(k, v) {
|
|
1430
1521
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1431
1522
|
}
|
|
1432
|
-
__name(
|
|
1433
|
-
function
|
|
1523
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
1524
|
+
function _ts_param11(paramIndex, decorator) {
|
|
1434
1525
|
return function(target, key) {
|
|
1435
1526
|
decorator(target, key, paramIndex);
|
|
1436
1527
|
};
|
|
1437
1528
|
}
|
|
1438
|
-
__name(
|
|
1529
|
+
__name(_ts_param11, "_ts_param");
|
|
1439
1530
|
var InlineAgentRunner = class _InlineAgentRunner {
|
|
1440
1531
|
static {
|
|
1441
1532
|
__name(this, "InlineAgentRunner");
|
|
@@ -1536,25 +1627,25 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
1536
1627
|
}, hooks);
|
|
1537
1628
|
}
|
|
1538
1629
|
};
|
|
1539
|
-
InlineAgentRunner =
|
|
1630
|
+
InlineAgentRunner = _ts_decorate13([
|
|
1540
1631
|
Injectable7(),
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1632
|
+
_ts_param11(0, Inject11(AGENT_DEPS_FACTORY4)),
|
|
1633
|
+
_ts_param11(1, Inject11(AGENT_STORE4)),
|
|
1634
|
+
_ts_metadata12("design:type", Function),
|
|
1635
|
+
_ts_metadata12("design:paramtypes", [
|
|
1545
1636
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
1546
1637
|
typeof AgentStore === "undefined" ? Object : AgentStore
|
|
1547
1638
|
])
|
|
1548
1639
|
], InlineAgentRunner);
|
|
1549
1640
|
|
|
1550
1641
|
// src/agent.module.ts
|
|
1551
|
-
function
|
|
1642
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1552
1643
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1553
1644
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1554
1645
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1555
1646
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1556
1647
|
}
|
|
1557
|
-
__name(
|
|
1648
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1558
1649
|
var DEFAULT_PATH = "agent";
|
|
1559
1650
|
function sharedProviders(durable, includeStore) {
|
|
1560
1651
|
const providers = [
|
|
@@ -1564,8 +1655,8 @@ function sharedProviders(durable, includeStore) {
|
|
|
1564
1655
|
},
|
|
1565
1656
|
// Starts empty; AgentDiscoveryService populates it from `@Agent`-decorated providers at boot.
|
|
1566
1657
|
{
|
|
1567
|
-
provide:
|
|
1568
|
-
useFactory: /* @__PURE__ */ __name(() => new
|
|
1658
|
+
provide: AGENT_REGISTRY5,
|
|
1659
|
+
useFactory: /* @__PURE__ */ __name(() => new AgentRegistry5(), "useFactory")
|
|
1569
1660
|
},
|
|
1570
1661
|
// A shared, mutable list AgentDiscoveryService fills with `@SystemPromptContributor()` methods.
|
|
1571
1662
|
{
|
|
@@ -1613,7 +1704,7 @@ function sharedProviders(durable, includeStore) {
|
|
|
1613
1704
|
},
|
|
1614
1705
|
AgentDepsFactory2,
|
|
1615
1706
|
{
|
|
1616
|
-
provide:
|
|
1707
|
+
provide: AGENT_DEPS_FACTORY5,
|
|
1617
1708
|
useExisting: AgentDepsFactory2
|
|
1618
1709
|
},
|
|
1619
1710
|
// Populates the registry + contributors (onModuleInit) BEFORE AiToolDiscoveryService synthesizes
|
|
@@ -1661,7 +1752,7 @@ function exportsFor(includeStore) {
|
|
|
1661
1752
|
return [
|
|
1662
1753
|
AGENT_OPTIONS3,
|
|
1663
1754
|
AGENT_TOOL_REGISTRY3,
|
|
1664
|
-
|
|
1755
|
+
AGENT_REGISTRY5,
|
|
1665
1756
|
AGENT_SINK2,
|
|
1666
1757
|
AGENT_ROLES_POLICY2,
|
|
1667
1758
|
AGENT_ACTOR_RESOLVER5,
|
|
@@ -1671,7 +1762,7 @@ function exportsFor(includeStore) {
|
|
|
1671
1762
|
] : [],
|
|
1672
1763
|
AGENT_QUOTA_STORE3,
|
|
1673
1764
|
AGENT_PROMPT_CONTRIBUTORS3,
|
|
1674
|
-
|
|
1765
|
+
AGENT_DEPS_FACTORY5,
|
|
1675
1766
|
AgentDepsFactory2,
|
|
1676
1767
|
AgentService,
|
|
1677
1768
|
InlineAgentRunner
|
|
@@ -1682,7 +1773,8 @@ var CONTROLLERS = [
|
|
|
1682
1773
|
ChatController,
|
|
1683
1774
|
ThreadsController,
|
|
1684
1775
|
ToolCallController,
|
|
1685
|
-
QuotaController
|
|
1776
|
+
QuotaController,
|
|
1777
|
+
AgentsController
|
|
1686
1778
|
];
|
|
1687
1779
|
function routerFor(path) {
|
|
1688
1780
|
return RouterModule.register([
|
|
@@ -1720,6 +1812,7 @@ var AgentModule = class _AgentModule {
|
|
|
1720
1812
|
}
|
|
1721
1813
|
static forRootAsync(options) {
|
|
1722
1814
|
const path = options.path ?? DEFAULT_PATH;
|
|
1815
|
+
const includeStore = options.externalStore !== true;
|
|
1723
1816
|
return {
|
|
1724
1817
|
module: _AgentModule,
|
|
1725
1818
|
global: true,
|
|
@@ -1735,15 +1828,13 @@ var AgentModule = class _AgentModule {
|
|
|
1735
1828
|
useFactory: options.useFactory,
|
|
1736
1829
|
inject: options.inject ?? []
|
|
1737
1830
|
},
|
|
1738
|
-
|
|
1739
|
-
// (its factory reads the resolved options). Omit-and-import-a-store-module is a `forRoot` path.
|
|
1740
|
-
...sharedProviders(options.durable ?? false, true)
|
|
1831
|
+
...sharedProviders(options.durable ?? false, includeStore)
|
|
1741
1832
|
],
|
|
1742
|
-
exports: exportsFor(
|
|
1833
|
+
exports: exportsFor(includeStore)
|
|
1743
1834
|
};
|
|
1744
1835
|
}
|
|
1745
1836
|
};
|
|
1746
|
-
AgentModule =
|
|
1837
|
+
AgentModule = _ts_decorate14([
|
|
1747
1838
|
Global2(),
|
|
1748
1839
|
Module2({})
|
|
1749
1840
|
], AgentModule);
|