@dudousxd/nestjs-agent 1.1.1 → 1.2.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/README.md +29 -0
- package/dist/durable/index.cjs +224 -138
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +154 -68
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +226 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -2
- package/dist/index.d.ts +42 -2
- package/dist/index.js +150 -64
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/durable/index.js
CHANGED
|
@@ -24,7 +24,7 @@ function childSinkWriter(writer) {
|
|
|
24
24
|
__name(childSinkWriter, "childSinkWriter");
|
|
25
25
|
|
|
26
26
|
// src/durable/agent-run.steps.ts
|
|
27
|
-
import { AGENT_DEPS_FACTORY, createFrameBuffer, invokeWithTransientRetry, publishAgentToolRetry, stampToolKinds, traceLlmTurn, traceToolExecution, withAskTool, withMemoryTool, withSkillTool, withToolTimeout } from "@dudousxd/nestjs-agent-core";
|
|
27
|
+
import { AGENT_DEPS_FACTORY, createFrameBuffer, invokeWithTransientRetry, observeTurnFrames, publishAgentToolRetry, stampToolKinds, traceLlmTurn, traceToolExecution, withAskTool, withMemoryTool, withSkillTool, withToolTimeout, withTurnFrames } from "@dudousxd/nestjs-agent-core";
|
|
28
28
|
import { Step } from "@dudousxd/nestjs-durable";
|
|
29
29
|
import { Inject, Injectable } from "@nestjs/common";
|
|
30
30
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -87,12 +87,13 @@ var AgentRunSteps = class {
|
|
|
87
87
|
const opened = await deps.sink.open(input.sinkRunId);
|
|
88
88
|
writer = input.childSink ? childSinkWriter(opened) : opened;
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const frames = observeTurnFrames(writer);
|
|
91
|
+
const turn = withTurnFrames(await traceLlmTurn(input.runId, input.step, () => deps.model.runTurn({
|
|
91
92
|
system: input.system,
|
|
92
93
|
messages: input.messages,
|
|
93
94
|
tools,
|
|
94
|
-
sink: writer
|
|
95
|
-
}));
|
|
95
|
+
sink: frames.writer
|
|
96
|
+
})), frames.summary());
|
|
96
97
|
const stamped = stampToolKinds(turn, deps);
|
|
97
98
|
return buffer === void 0 ? stamped : {
|
|
98
99
|
...stamped,
|
|
@@ -759,7 +760,7 @@ AgentDurableModule = _ts_decorate4([
|
|
|
759
760
|
], AgentDurableModule);
|
|
760
761
|
|
|
761
762
|
// src/agent.module.ts
|
|
762
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
763
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER9, AGENT_APPROVAL_PORT, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY7, AGENT_DURABLE_RUNNER as AGENT_DURABLE_RUNNER2, 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_SINK3, AGENT_SKILLS as AGENT_SKILLS3, AGENT_SKILL_SOURCES as AGENT_SKILL_SOURCES2, AGENT_STORE as AGENT_STORE6, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry6, DefaultRolesPolicy, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
|
|
763
764
|
import { Global as Global2, Module as Module2 } from "@nestjs/common";
|
|
764
765
|
import { DiscoveryModule, RouterModule } from "@nestjs/core";
|
|
765
766
|
|
|
@@ -2610,9 +2611,90 @@ ToolCallController = _ts_decorate15([
|
|
|
2610
2611
|
])
|
|
2611
2612
|
], ToolCallController);
|
|
2612
2613
|
|
|
2614
|
+
// src/controller/tools.controller.ts
|
|
2615
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER8, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY5, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
|
|
2616
|
+
import { Controller as Controller9, Get as Get8, Inject as Inject14, NotFoundException as NotFoundException3, Query as Query3, Req as Req8 } from "@nestjs/common";
|
|
2617
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
2618
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2619
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2620
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2621
|
+
} else {
|
|
2622
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2623
|
+
if (d = decorators[i]) {
|
|
2624
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2629
|
+
}
|
|
2630
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
2631
|
+
function _ts_metadata15(metadataKey, metadataValue) {
|
|
2632
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2633
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
2637
|
+
function _ts_param14(paramIndex, decorator) {
|
|
2638
|
+
return function(target, key) {
|
|
2639
|
+
decorator(target, key, paramIndex);
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
__name(_ts_param14, "_ts_param");
|
|
2643
|
+
var ToolsController = class {
|
|
2644
|
+
static {
|
|
2645
|
+
__name(this, "ToolsController");
|
|
2646
|
+
}
|
|
2647
|
+
actorResolver;
|
|
2648
|
+
depsFactory;
|
|
2649
|
+
agents;
|
|
2650
|
+
constructor(actorResolver, depsFactory, agents) {
|
|
2651
|
+
this.actorResolver = actorResolver;
|
|
2652
|
+
this.depsFactory = depsFactory;
|
|
2653
|
+
this.agents = agents;
|
|
2654
|
+
}
|
|
2655
|
+
async list(req, agent) {
|
|
2656
|
+
if (agent !== void 0 && this.agents.get(agent) === void 0) {
|
|
2657
|
+
throw new NotFoundException3(`No agent named "${agent}"`);
|
|
2658
|
+
}
|
|
2659
|
+
const actor = await this.actorResolver.resolve(req);
|
|
2660
|
+
const deps = this.depsFactory.forAgent(agent);
|
|
2661
|
+
const specs = await deps.registry.visibleSpecs(actor, deps.rolesPolicy, deps.toolAllowList);
|
|
2662
|
+
return specs.map((spec) => ({
|
|
2663
|
+
name: spec.name,
|
|
2664
|
+
kind: spec.kind,
|
|
2665
|
+
...spec.presentation !== void 0 ? {
|
|
2666
|
+
presentation: spec.presentation
|
|
2667
|
+
} : {}
|
|
2668
|
+
}));
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
_ts_decorate16([
|
|
2672
|
+
Get8(),
|
|
2673
|
+
_ts_param14(0, Req8()),
|
|
2674
|
+
_ts_param14(1, Query3("agent")),
|
|
2675
|
+
_ts_metadata15("design:type", Function),
|
|
2676
|
+
_ts_metadata15("design:paramtypes", [
|
|
2677
|
+
typeof Request === "undefined" ? Object : Request,
|
|
2678
|
+
String
|
|
2679
|
+
]),
|
|
2680
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2681
|
+
], ToolsController.prototype, "list", null);
|
|
2682
|
+
ToolsController = _ts_decorate16([
|
|
2683
|
+
Controller9("tools"),
|
|
2684
|
+
_ts_param14(0, Inject14(AGENT_ACTOR_RESOLVER8)),
|
|
2685
|
+
_ts_param14(1, Inject14(AGENT_DEPS_FACTORY5)),
|
|
2686
|
+
_ts_param14(2, Inject14(AGENT_REGISTRY3)),
|
|
2687
|
+
_ts_metadata15("design:type", Function),
|
|
2688
|
+
_ts_metadata15("design:paramtypes", [
|
|
2689
|
+
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2690
|
+
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
2691
|
+
typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4
|
|
2692
|
+
])
|
|
2693
|
+
], ToolsController);
|
|
2694
|
+
|
|
2613
2695
|
// src/discovery/agent-discovery.service.ts
|
|
2614
|
-
import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as
|
|
2615
|
-
import { Inject as
|
|
2696
|
+
import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as AGENT_REGISTRY4, AgentRegistry as AgentRegistry5 } from "@dudousxd/nestjs-agent-core";
|
|
2697
|
+
import { Inject as Inject15, Injectable as Injectable7, Logger as Logger2 } from "@nestjs/common";
|
|
2616
2698
|
import { DiscoveryService, MetadataScanner } from "@nestjs/core";
|
|
2617
2699
|
|
|
2618
2700
|
// src/decorator/agent.decorator.ts
|
|
@@ -2629,7 +2711,7 @@ var SYSTEM_PROMPT_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:
|
|
|
2629
2711
|
var SYSTEM_PROMPT_CONTRIBUTOR_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:system-prompt-contributor");
|
|
2630
2712
|
|
|
2631
2713
|
// src/discovery/agent-discovery.service.ts
|
|
2632
|
-
function
|
|
2714
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
2633
2715
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2634
2716
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2635
2717
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2642,19 +2724,19 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
2642
2724
|
}
|
|
2643
2725
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2644
2726
|
}
|
|
2645
|
-
__name(
|
|
2646
|
-
function
|
|
2727
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
2728
|
+
function _ts_metadata16(metadataKey, metadataValue) {
|
|
2647
2729
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2648
2730
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2649
2731
|
}
|
|
2650
2732
|
}
|
|
2651
|
-
__name(
|
|
2652
|
-
function
|
|
2733
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
2734
|
+
function _ts_param15(paramIndex, decorator) {
|
|
2653
2735
|
return function(target, key) {
|
|
2654
2736
|
decorator(target, key, paramIndex);
|
|
2655
2737
|
};
|
|
2656
2738
|
}
|
|
2657
|
-
__name(
|
|
2739
|
+
__name(_ts_param15, "_ts_param");
|
|
2658
2740
|
var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
2659
2741
|
static {
|
|
2660
2742
|
__name(this, "AgentDiscoveryService");
|
|
@@ -2781,22 +2863,22 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
2781
2863
|
return (ctx) => candidate.call(instance, ctx);
|
|
2782
2864
|
}
|
|
2783
2865
|
};
|
|
2784
|
-
AgentDiscoveryService =
|
|
2866
|
+
AgentDiscoveryService = _ts_decorate17([
|
|
2785
2867
|
Injectable7(),
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2868
|
+
_ts_param15(2, Inject15(AGENT_REGISTRY4)),
|
|
2869
|
+
_ts_param15(3, Inject15(AGENT_PROMPT_CONTRIBUTORS2)),
|
|
2870
|
+
_ts_metadata16("design:type", Function),
|
|
2871
|
+
_ts_metadata16("design:paramtypes", [
|
|
2790
2872
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
2791
2873
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
2792
|
-
typeof
|
|
2874
|
+
typeof AgentRegistry5 === "undefined" ? Object : AgentRegistry5,
|
|
2793
2875
|
Array
|
|
2794
2876
|
])
|
|
2795
2877
|
], AgentDiscoveryService);
|
|
2796
2878
|
|
|
2797
2879
|
// src/discovery/ai-tool-discovery.service.ts
|
|
2798
|
-
import { AGENT_OPTIONS as AGENT_OPTIONS3, AGENT_REGISTRY as
|
|
2799
|
-
import { Inject as
|
|
2880
|
+
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";
|
|
2881
|
+
import { Inject as Inject16, Injectable as Injectable8, Logger as Logger3 } from "@nestjs/common";
|
|
2800
2882
|
import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
|
|
2801
2883
|
import { z } from "zod";
|
|
2802
2884
|
|
|
@@ -2816,7 +2898,7 @@ function isBrandedFunctionalTool(value) {
|
|
|
2816
2898
|
__name(isBrandedFunctionalTool, "isBrandedFunctionalTool");
|
|
2817
2899
|
|
|
2818
2900
|
// src/discovery/ai-tool-discovery.service.ts
|
|
2819
|
-
function
|
|
2901
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2820
2902
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2821
2903
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2822
2904
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2829,19 +2911,19 @@ function _ts_decorate17(decorators, target, key, desc) {
|
|
|
2829
2911
|
}
|
|
2830
2912
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2831
2913
|
}
|
|
2832
|
-
__name(
|
|
2833
|
-
function
|
|
2914
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
2915
|
+
function _ts_metadata17(metadataKey, metadataValue) {
|
|
2834
2916
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2835
2917
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2836
2918
|
}
|
|
2837
2919
|
}
|
|
2838
|
-
__name(
|
|
2839
|
-
function
|
|
2920
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
2921
|
+
function _ts_param16(paramIndex, decorator) {
|
|
2840
2922
|
return function(target, key) {
|
|
2841
2923
|
decorator(target, key, paramIndex);
|
|
2842
2924
|
};
|
|
2843
2925
|
}
|
|
2844
|
-
__name(
|
|
2926
|
+
__name(_ts_param16, "_ts_param");
|
|
2845
2927
|
var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
2846
2928
|
static {
|
|
2847
2929
|
__name(this, "AiToolDiscoveryService");
|
|
@@ -2895,6 +2977,9 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
2895
2977
|
} : {},
|
|
2896
2978
|
...meta.enabled !== void 0 ? {
|
|
2897
2979
|
enabled: meta.enabled
|
|
2980
|
+
} : {},
|
|
2981
|
+
...meta.presentation !== void 0 ? {
|
|
2982
|
+
presentation: meta.presentation
|
|
2898
2983
|
} : {}
|
|
2899
2984
|
}, {
|
|
2900
2985
|
execute: /* @__PURE__ */ __name((input, ctx) => instance.execute(input, ctx), "execute"),
|
|
@@ -2968,13 +3053,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
2968
3053
|
return true;
|
|
2969
3054
|
}
|
|
2970
3055
|
};
|
|
2971
|
-
AiToolDiscoveryService =
|
|
3056
|
+
AiToolDiscoveryService = _ts_decorate18([
|
|
2972
3057
|
Injectable8(),
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
3058
|
+
_ts_param16(1, Inject16(AGENT_TOOL_REGISTRY2)),
|
|
3059
|
+
_ts_param16(2, Inject16(AGENT_REGISTRY5)),
|
|
3060
|
+
_ts_param16(3, Inject16(AGENT_OPTIONS3)),
|
|
3061
|
+
_ts_metadata17("design:type", Function),
|
|
3062
|
+
_ts_metadata17("design:paramtypes", [
|
|
2978
3063
|
typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
|
|
2979
3064
|
typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
|
|
2980
3065
|
typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
|
|
@@ -2984,7 +3069,7 @@ AiToolDiscoveryService = _ts_decorate17([
|
|
|
2984
3069
|
|
|
2985
3070
|
// src/discovery/skill-discovery.service.ts
|
|
2986
3071
|
import { AGENT_SKILL_SOURCES } from "@dudousxd/nestjs-agent-core";
|
|
2987
|
-
import { Inject as
|
|
3072
|
+
import { Inject as Inject17, Injectable as Injectable9, Logger as Logger4 } from "@nestjs/common";
|
|
2988
3073
|
import { DiscoveryService as DiscoveryService3 } from "@nestjs/core";
|
|
2989
3074
|
|
|
2990
3075
|
// src/decorator/skill.decorator.ts
|
|
@@ -3001,7 +3086,7 @@ function skillScope(options) {
|
|
|
3001
3086
|
__name(skillScope, "skillScope");
|
|
3002
3087
|
|
|
3003
3088
|
// src/discovery/skill-discovery.service.ts
|
|
3004
|
-
function
|
|
3089
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
3005
3090
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3006
3091
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3007
3092
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3014,19 +3099,19 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
3014
3099
|
}
|
|
3015
3100
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3016
3101
|
}
|
|
3017
|
-
__name(
|
|
3018
|
-
function
|
|
3102
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3103
|
+
function _ts_metadata18(metadataKey, metadataValue) {
|
|
3019
3104
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3020
3105
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3021
3106
|
}
|
|
3022
3107
|
}
|
|
3023
|
-
__name(
|
|
3024
|
-
function
|
|
3108
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3109
|
+
function _ts_param17(paramIndex, decorator) {
|
|
3025
3110
|
return function(target, key) {
|
|
3026
3111
|
decorator(target, key, paramIndex);
|
|
3027
3112
|
};
|
|
3028
3113
|
}
|
|
3029
|
-
__name(
|
|
3114
|
+
__name(_ts_param17, "_ts_param");
|
|
3030
3115
|
var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
3031
3116
|
static {
|
|
3032
3117
|
__name(this, "SkillDiscoveryService");
|
|
@@ -3070,11 +3155,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
|
3070
3155
|
return flat === void 0 ? void 0 : () => flat;
|
|
3071
3156
|
}
|
|
3072
3157
|
};
|
|
3073
|
-
SkillDiscoveryService =
|
|
3158
|
+
SkillDiscoveryService = _ts_decorate19([
|
|
3074
3159
|
Injectable9(),
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3160
|
+
_ts_param17(1, Inject17(AGENT_SKILL_SOURCES)),
|
|
3161
|
+
_ts_metadata18("design:type", Function),
|
|
3162
|
+
_ts_metadata18("design:paramtypes", [
|
|
3078
3163
|
typeof DiscoveryService3 === "undefined" ? Object : DiscoveryService3,
|
|
3079
3164
|
Array
|
|
3080
3165
|
])
|
|
@@ -3104,9 +3189,9 @@ var LedgerQuotaStore = class {
|
|
|
3104
3189
|
};
|
|
3105
3190
|
|
|
3106
3191
|
// src/runner/inline-agent-runner.ts
|
|
3107
|
-
import { AGENT_DEPS_FACTORY as
|
|
3108
|
-
import { Inject as
|
|
3109
|
-
function
|
|
3192
|
+
import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY6, AGENT_STORE as AGENT_STORE5, RunCancelledError as RunCancelledError2, agentFailureCode as agentFailureCode2, encodeStreamEvent as encodeStreamEvent2, publishAgentRunFailed as publishAgentRunFailed2, runAgentLoop as runAgentLoop2, settleAll as settleAll2, settleUnsettledDelegation as settleUnsettledDelegation2 } from "@dudousxd/nestjs-agent-core";
|
|
3193
|
+
import { Inject as Inject18, Injectable as Injectable10, Logger as Logger5 } from "@nestjs/common";
|
|
3194
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
3110
3195
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3111
3196
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3112
3197
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3119,19 +3204,19 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
3119
3204
|
}
|
|
3120
3205
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3121
3206
|
}
|
|
3122
|
-
__name(
|
|
3123
|
-
function
|
|
3207
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3208
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
3124
3209
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3125
3210
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3126
3211
|
}
|
|
3127
3212
|
}
|
|
3128
|
-
__name(
|
|
3129
|
-
function
|
|
3213
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
3214
|
+
function _ts_param18(paramIndex, decorator) {
|
|
3130
3215
|
return function(target, key) {
|
|
3131
3216
|
decorator(target, key, paramIndex);
|
|
3132
3217
|
};
|
|
3133
3218
|
}
|
|
3134
|
-
__name(
|
|
3219
|
+
__name(_ts_param18, "_ts_param");
|
|
3135
3220
|
var InlineAgentRunner = class _InlineAgentRunner {
|
|
3136
3221
|
static {
|
|
3137
3222
|
__name(this, "InlineAgentRunner");
|
|
@@ -3482,12 +3567,12 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3482
3567
|
}
|
|
3483
3568
|
}
|
|
3484
3569
|
};
|
|
3485
|
-
InlineAgentRunner =
|
|
3570
|
+
InlineAgentRunner = _ts_decorate20([
|
|
3486
3571
|
Injectable10(),
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3572
|
+
_ts_param18(0, Inject18(AGENT_DEPS_FACTORY6)),
|
|
3573
|
+
_ts_param18(1, Inject18(AGENT_STORE5)),
|
|
3574
|
+
_ts_metadata19("design:type", Function),
|
|
3575
|
+
_ts_metadata19("design:paramtypes", [
|
|
3491
3576
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
3492
3577
|
typeof AgentStore === "undefined" ? Object : AgentStore
|
|
3493
3578
|
])
|
|
@@ -3532,7 +3617,7 @@ function resolveSkillsConfig(options, declared) {
|
|
|
3532
3617
|
__name(resolveSkillsConfig, "resolveSkillsConfig");
|
|
3533
3618
|
|
|
3534
3619
|
// src/agent.module.ts
|
|
3535
|
-
function
|
|
3620
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
3536
3621
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3537
3622
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3538
3623
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3545,7 +3630,7 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
3545
3630
|
}
|
|
3546
3631
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3547
3632
|
}
|
|
3548
|
-
__name(
|
|
3633
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3549
3634
|
var DEFAULT_PATH = "agent";
|
|
3550
3635
|
function sharedProviders(durable, includeStore) {
|
|
3551
3636
|
const providers = [
|
|
@@ -3555,8 +3640,8 @@ function sharedProviders(durable, includeStore) {
|
|
|
3555
3640
|
},
|
|
3556
3641
|
// Starts empty; AgentDiscoveryService populates it from `@Agent`-decorated providers at boot.
|
|
3557
3642
|
{
|
|
3558
|
-
provide:
|
|
3559
|
-
useFactory: /* @__PURE__ */ __name(() => new
|
|
3643
|
+
provide: AGENT_REGISTRY6,
|
|
3644
|
+
useFactory: /* @__PURE__ */ __name(() => new AgentRegistry6(), "useFactory")
|
|
3560
3645
|
},
|
|
3561
3646
|
// A shared, mutable list AgentDiscoveryService fills with `@SystemPromptContributor()` methods.
|
|
3562
3647
|
{
|
|
@@ -3604,7 +3689,7 @@ function sharedProviders(durable, includeStore) {
|
|
|
3604
3689
|
]
|
|
3605
3690
|
},
|
|
3606
3691
|
{
|
|
3607
|
-
provide:
|
|
3692
|
+
provide: AGENT_ACTOR_RESOLVER9,
|
|
3608
3693
|
useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
|
|
3609
3694
|
inject: [
|
|
3610
3695
|
AGENT_OPTIONS4
|
|
@@ -3630,7 +3715,7 @@ function sharedProviders(durable, includeStore) {
|
|
|
3630
3715
|
},
|
|
3631
3716
|
AgentDepsFactory2,
|
|
3632
3717
|
{
|
|
3633
|
-
provide:
|
|
3718
|
+
provide: AGENT_DEPS_FACTORY7,
|
|
3634
3719
|
useExisting: AgentDepsFactory2
|
|
3635
3720
|
},
|
|
3636
3721
|
// Populates the registry + contributors (onModuleInit) BEFORE AiToolDiscoveryService synthesizes
|
|
@@ -3686,10 +3771,10 @@ function exportsFor(includeStore) {
|
|
|
3686
3771
|
return [
|
|
3687
3772
|
AGENT_OPTIONS4,
|
|
3688
3773
|
AGENT_TOOL_REGISTRY3,
|
|
3689
|
-
|
|
3774
|
+
AGENT_REGISTRY6,
|
|
3690
3775
|
AGENT_SINK3,
|
|
3691
3776
|
AGENT_ROLES_POLICY2,
|
|
3692
|
-
|
|
3777
|
+
AGENT_ACTOR_RESOLVER9,
|
|
3693
3778
|
AGENT_MODEL2,
|
|
3694
3779
|
...includeStore ? [
|
|
3695
3780
|
AGENT_STORE6
|
|
@@ -3698,7 +3783,7 @@ function exportsFor(includeStore) {
|
|
|
3698
3783
|
AGENT_PROMPT_CONTRIBUTORS3,
|
|
3699
3784
|
AGENT_SKILLS3,
|
|
3700
3785
|
AGENT_MEMORY3,
|
|
3701
|
-
|
|
3786
|
+
AGENT_DEPS_FACTORY7,
|
|
3702
3787
|
AgentDepsFactory2,
|
|
3703
3788
|
AgentService,
|
|
3704
3789
|
InlineAgentRunner,
|
|
@@ -3713,7 +3798,8 @@ var BASE_CONTROLLERS = [
|
|
|
3713
3798
|
QuotaController,
|
|
3714
3799
|
AgentsController,
|
|
3715
3800
|
SkillsController,
|
|
3716
|
-
MemoriesController
|
|
3801
|
+
MemoriesController,
|
|
3802
|
+
ToolsController
|
|
3717
3803
|
];
|
|
3718
3804
|
var GUARDABLE_CONTROLLERS = [
|
|
3719
3805
|
...BASE_CONTROLLERS,
|
|
@@ -3816,7 +3902,7 @@ var AgentModule = class _AgentModule {
|
|
|
3816
3902
|
};
|
|
3817
3903
|
}
|
|
3818
3904
|
};
|
|
3819
|
-
AgentModule =
|
|
3905
|
+
AgentModule = _ts_decorate21([
|
|
3820
3906
|
Global2(),
|
|
3821
3907
|
Module2({})
|
|
3822
3908
|
], AgentModule);
|