@dudousxd/nestjs-agent 1.1.2 → 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 +220 -135
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +149 -64
- 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 +2 -2
package/dist/durable/index.cjs
CHANGED
|
@@ -788,8 +788,8 @@ AgentDurableModule = _ts_decorate4([
|
|
|
788
788
|
], AgentDurableModule);
|
|
789
789
|
|
|
790
790
|
// src/agent.module.ts
|
|
791
|
-
var
|
|
792
|
-
var
|
|
791
|
+
var import_nestjs_agent_core24 = require("@dudousxd/nestjs-agent-core");
|
|
792
|
+
var import_common21 = require("@nestjs/common");
|
|
793
793
|
var import_core4 = require("@nestjs/core");
|
|
794
794
|
|
|
795
795
|
// src/agent-deps.factory.ts
|
|
@@ -2639,9 +2639,90 @@ ToolCallController = _ts_decorate15([
|
|
|
2639
2639
|
])
|
|
2640
2640
|
], ToolCallController);
|
|
2641
2641
|
|
|
2642
|
-
// src/
|
|
2642
|
+
// src/controller/tools.controller.ts
|
|
2643
2643
|
var import_nestjs_agent_core17 = require("@dudousxd/nestjs-agent-core");
|
|
2644
2644
|
var import_common16 = require("@nestjs/common");
|
|
2645
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
2646
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2647
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2648
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2649
|
+
} else {
|
|
2650
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2651
|
+
if (d = decorators[i]) {
|
|
2652
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2657
|
+
}
|
|
2658
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
2659
|
+
function _ts_metadata15(metadataKey, metadataValue) {
|
|
2660
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2661
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
2665
|
+
function _ts_param14(paramIndex, decorator) {
|
|
2666
|
+
return function(target, key) {
|
|
2667
|
+
decorator(target, key, paramIndex);
|
|
2668
|
+
};
|
|
2669
|
+
}
|
|
2670
|
+
__name(_ts_param14, "_ts_param");
|
|
2671
|
+
var ToolsController = class {
|
|
2672
|
+
static {
|
|
2673
|
+
__name(this, "ToolsController");
|
|
2674
|
+
}
|
|
2675
|
+
actorResolver;
|
|
2676
|
+
depsFactory;
|
|
2677
|
+
agents;
|
|
2678
|
+
constructor(actorResolver, depsFactory, agents) {
|
|
2679
|
+
this.actorResolver = actorResolver;
|
|
2680
|
+
this.depsFactory = depsFactory;
|
|
2681
|
+
this.agents = agents;
|
|
2682
|
+
}
|
|
2683
|
+
async list(req, agent) {
|
|
2684
|
+
if (agent !== void 0 && this.agents.get(agent) === void 0) {
|
|
2685
|
+
throw new import_common16.NotFoundException(`No agent named "${agent}"`);
|
|
2686
|
+
}
|
|
2687
|
+
const actor = await this.actorResolver.resolve(req);
|
|
2688
|
+
const deps = this.depsFactory.forAgent(agent);
|
|
2689
|
+
const specs = await deps.registry.visibleSpecs(actor, deps.rolesPolicy, deps.toolAllowList);
|
|
2690
|
+
return specs.map((spec) => ({
|
|
2691
|
+
name: spec.name,
|
|
2692
|
+
kind: spec.kind,
|
|
2693
|
+
...spec.presentation !== void 0 ? {
|
|
2694
|
+
presentation: spec.presentation
|
|
2695
|
+
} : {}
|
|
2696
|
+
}));
|
|
2697
|
+
}
|
|
2698
|
+
};
|
|
2699
|
+
_ts_decorate16([
|
|
2700
|
+
(0, import_common16.Get)(),
|
|
2701
|
+
_ts_param14(0, (0, import_common16.Req)()),
|
|
2702
|
+
_ts_param14(1, (0, import_common16.Query)("agent")),
|
|
2703
|
+
_ts_metadata15("design:type", Function),
|
|
2704
|
+
_ts_metadata15("design:paramtypes", [
|
|
2705
|
+
typeof Request === "undefined" ? Object : Request,
|
|
2706
|
+
String
|
|
2707
|
+
]),
|
|
2708
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2709
|
+
], ToolsController.prototype, "list", null);
|
|
2710
|
+
ToolsController = _ts_decorate16([
|
|
2711
|
+
(0, import_common16.Controller)("tools"),
|
|
2712
|
+
_ts_param14(0, (0, import_common16.Inject)(import_nestjs_agent_core17.AGENT_ACTOR_RESOLVER)),
|
|
2713
|
+
_ts_param14(1, (0, import_common16.Inject)(import_nestjs_agent_core17.AGENT_DEPS_FACTORY)),
|
|
2714
|
+
_ts_param14(2, (0, import_common16.Inject)(import_nestjs_agent_core17.AGENT_REGISTRY)),
|
|
2715
|
+
_ts_metadata15("design:type", Function),
|
|
2716
|
+
_ts_metadata15("design:paramtypes", [
|
|
2717
|
+
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2718
|
+
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
2719
|
+
typeof import_nestjs_agent_core17.AgentRegistry === "undefined" ? Object : import_nestjs_agent_core17.AgentRegistry
|
|
2720
|
+
])
|
|
2721
|
+
], ToolsController);
|
|
2722
|
+
|
|
2723
|
+
// src/discovery/agent-discovery.service.ts
|
|
2724
|
+
var import_nestjs_agent_core18 = require("@dudousxd/nestjs-agent-core");
|
|
2725
|
+
var import_common17 = require("@nestjs/common");
|
|
2645
2726
|
var import_core = require("@nestjs/core");
|
|
2646
2727
|
|
|
2647
2728
|
// src/decorator/agent.decorator.ts
|
|
@@ -2658,7 +2739,7 @@ var SYSTEM_PROMPT_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:
|
|
|
2658
2739
|
var SYSTEM_PROMPT_CONTRIBUTOR_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:system-prompt-contributor");
|
|
2659
2740
|
|
|
2660
2741
|
// src/discovery/agent-discovery.service.ts
|
|
2661
|
-
function
|
|
2742
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
2662
2743
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2663
2744
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2664
2745
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2671,19 +2752,19 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
2671
2752
|
}
|
|
2672
2753
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2673
2754
|
}
|
|
2674
|
-
__name(
|
|
2675
|
-
function
|
|
2755
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
2756
|
+
function _ts_metadata16(metadataKey, metadataValue) {
|
|
2676
2757
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2677
2758
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2678
2759
|
}
|
|
2679
2760
|
}
|
|
2680
|
-
__name(
|
|
2681
|
-
function
|
|
2761
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
2762
|
+
function _ts_param15(paramIndex, decorator) {
|
|
2682
2763
|
return function(target, key) {
|
|
2683
2764
|
decorator(target, key, paramIndex);
|
|
2684
2765
|
};
|
|
2685
2766
|
}
|
|
2686
|
-
__name(
|
|
2767
|
+
__name(_ts_param15, "_ts_param");
|
|
2687
2768
|
var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
2688
2769
|
static {
|
|
2689
2770
|
__name(this, "AgentDiscoveryService");
|
|
@@ -2692,7 +2773,7 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
2692
2773
|
scanner;
|
|
2693
2774
|
registry;
|
|
2694
2775
|
contributors;
|
|
2695
|
-
logger = new
|
|
2776
|
+
logger = new import_common17.Logger(_AgentDiscoveryService.name);
|
|
2696
2777
|
constructor(discovery, scanner, registry, contributors) {
|
|
2697
2778
|
this.discovery = discovery;
|
|
2698
2779
|
this.scanner = scanner;
|
|
@@ -2810,22 +2891,22 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
2810
2891
|
return (ctx) => candidate.call(instance, ctx);
|
|
2811
2892
|
}
|
|
2812
2893
|
};
|
|
2813
|
-
AgentDiscoveryService =
|
|
2814
|
-
(0,
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2894
|
+
AgentDiscoveryService = _ts_decorate17([
|
|
2895
|
+
(0, import_common17.Injectable)(),
|
|
2896
|
+
_ts_param15(2, (0, import_common17.Inject)(import_nestjs_agent_core18.AGENT_REGISTRY)),
|
|
2897
|
+
_ts_param15(3, (0, import_common17.Inject)(import_nestjs_agent_core18.AGENT_PROMPT_CONTRIBUTORS)),
|
|
2898
|
+
_ts_metadata16("design:type", Function),
|
|
2899
|
+
_ts_metadata16("design:paramtypes", [
|
|
2819
2900
|
typeof import_core.DiscoveryService === "undefined" ? Object : import_core.DiscoveryService,
|
|
2820
2901
|
typeof import_core.MetadataScanner === "undefined" ? Object : import_core.MetadataScanner,
|
|
2821
|
-
typeof
|
|
2902
|
+
typeof import_nestjs_agent_core18.AgentRegistry === "undefined" ? Object : import_nestjs_agent_core18.AgentRegistry,
|
|
2822
2903
|
Array
|
|
2823
2904
|
])
|
|
2824
2905
|
], AgentDiscoveryService);
|
|
2825
2906
|
|
|
2826
2907
|
// src/discovery/ai-tool-discovery.service.ts
|
|
2827
|
-
var
|
|
2828
|
-
var
|
|
2908
|
+
var import_nestjs_agent_core19 = require("@dudousxd/nestjs-agent-core");
|
|
2909
|
+
var import_common18 = require("@nestjs/common");
|
|
2829
2910
|
var import_core2 = require("@nestjs/core");
|
|
2830
2911
|
var import_zod = require("zod");
|
|
2831
2912
|
|
|
@@ -2845,7 +2926,7 @@ function isBrandedFunctionalTool(value) {
|
|
|
2845
2926
|
__name(isBrandedFunctionalTool, "isBrandedFunctionalTool");
|
|
2846
2927
|
|
|
2847
2928
|
// src/discovery/ai-tool-discovery.service.ts
|
|
2848
|
-
function
|
|
2929
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2849
2930
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2850
2931
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2851
2932
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2858,19 +2939,19 @@ function _ts_decorate17(decorators, target, key, desc) {
|
|
|
2858
2939
|
}
|
|
2859
2940
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2860
2941
|
}
|
|
2861
|
-
__name(
|
|
2862
|
-
function
|
|
2942
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
2943
|
+
function _ts_metadata17(metadataKey, metadataValue) {
|
|
2863
2944
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2864
2945
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2865
2946
|
}
|
|
2866
2947
|
}
|
|
2867
|
-
__name(
|
|
2868
|
-
function
|
|
2948
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
2949
|
+
function _ts_param16(paramIndex, decorator) {
|
|
2869
2950
|
return function(target, key) {
|
|
2870
2951
|
decorator(target, key, paramIndex);
|
|
2871
2952
|
};
|
|
2872
2953
|
}
|
|
2873
|
-
__name(
|
|
2954
|
+
__name(_ts_param16, "_ts_param");
|
|
2874
2955
|
var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
2875
2956
|
static {
|
|
2876
2957
|
__name(this, "AiToolDiscoveryService");
|
|
@@ -2879,7 +2960,7 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
2879
2960
|
registry;
|
|
2880
2961
|
agents;
|
|
2881
2962
|
options;
|
|
2882
|
-
logger = new
|
|
2963
|
+
logger = new import_common18.Logger(_AiToolDiscoveryService.name);
|
|
2883
2964
|
constructor(discovery, registry, agents, options) {
|
|
2884
2965
|
this.discovery = discovery;
|
|
2885
2966
|
this.registry = registry;
|
|
@@ -2924,6 +3005,9 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
2924
3005
|
} : {},
|
|
2925
3006
|
...meta.enabled !== void 0 ? {
|
|
2926
3007
|
enabled: meta.enabled
|
|
3008
|
+
} : {},
|
|
3009
|
+
...meta.presentation !== void 0 ? {
|
|
3010
|
+
presentation: meta.presentation
|
|
2927
3011
|
} : {}
|
|
2928
3012
|
}, {
|
|
2929
3013
|
execute: /* @__PURE__ */ __name((input, ctx) => instance.execute(input, ctx), "execute"),
|
|
@@ -2947,7 +3031,7 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
2947
3031
|
let delegates = 0;
|
|
2948
3032
|
for (const definition of this.agents.list()) {
|
|
2949
3033
|
for (const edge of definition.delegatesTo ?? []) {
|
|
2950
|
-
const { agent: target, detached } = (0,
|
|
3034
|
+
const { agent: target, detached } = (0, import_nestjs_agent_core19.normalizeDelegation)(edge);
|
|
2951
3035
|
const targetDefinition = this.agents.get(target);
|
|
2952
3036
|
if (targetDefinition === void 0) {
|
|
2953
3037
|
throw new Error(`Agent "${definition.name}" hands off to "${target}", which is not a registered @Agent. Declare it as an @Agent provider or fix the reference.`);
|
|
@@ -2997,13 +3081,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
2997
3081
|
return true;
|
|
2998
3082
|
}
|
|
2999
3083
|
};
|
|
3000
|
-
AiToolDiscoveryService =
|
|
3001
|
-
(0,
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3084
|
+
AiToolDiscoveryService = _ts_decorate18([
|
|
3085
|
+
(0, import_common18.Injectable)(),
|
|
3086
|
+
_ts_param16(1, (0, import_common18.Inject)(import_nestjs_agent_core19.AGENT_TOOL_REGISTRY)),
|
|
3087
|
+
_ts_param16(2, (0, import_common18.Inject)(import_nestjs_agent_core19.AGENT_REGISTRY)),
|
|
3088
|
+
_ts_param16(3, (0, import_common18.Inject)(import_nestjs_agent_core19.AGENT_OPTIONS)),
|
|
3089
|
+
_ts_metadata17("design:type", Function),
|
|
3090
|
+
_ts_metadata17("design:paramtypes", [
|
|
3007
3091
|
typeof import_core2.DiscoveryService === "undefined" ? Object : import_core2.DiscoveryService,
|
|
3008
3092
|
typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
|
|
3009
3093
|
typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
|
|
@@ -3012,25 +3096,25 @@ AiToolDiscoveryService = _ts_decorate17([
|
|
|
3012
3096
|
], AiToolDiscoveryService);
|
|
3013
3097
|
|
|
3014
3098
|
// src/discovery/skill-discovery.service.ts
|
|
3015
|
-
var
|
|
3016
|
-
var
|
|
3099
|
+
var import_nestjs_agent_core21 = require("@dudousxd/nestjs-agent-core");
|
|
3100
|
+
var import_common19 = require("@nestjs/common");
|
|
3017
3101
|
var import_core3 = require("@nestjs/core");
|
|
3018
3102
|
|
|
3019
3103
|
// src/decorator/skill.decorator.ts
|
|
3020
3104
|
var import_reflect_metadata4 = require("reflect-metadata");
|
|
3021
|
-
var
|
|
3105
|
+
var import_nestjs_agent_core20 = require("@dudousxd/nestjs-agent-core");
|
|
3022
3106
|
var SKILL_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:skill-metadata");
|
|
3023
3107
|
function readSkillMetadata(target) {
|
|
3024
3108
|
return Reflect.getMetadata(SKILL_METADATA, target);
|
|
3025
3109
|
}
|
|
3026
3110
|
__name(readSkillMetadata, "readSkillMetadata");
|
|
3027
3111
|
function skillScope(options) {
|
|
3028
|
-
return options.scope ??
|
|
3112
|
+
return options.scope ?? import_nestjs_agent_core20.GLOBAL_SCOPE;
|
|
3029
3113
|
}
|
|
3030
3114
|
__name(skillScope, "skillScope");
|
|
3031
3115
|
|
|
3032
3116
|
// src/discovery/skill-discovery.service.ts
|
|
3033
|
-
function
|
|
3117
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
3034
3118
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3035
3119
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3036
3120
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3043,26 +3127,26 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
3043
3127
|
}
|
|
3044
3128
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3045
3129
|
}
|
|
3046
|
-
__name(
|
|
3047
|
-
function
|
|
3130
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3131
|
+
function _ts_metadata18(metadataKey, metadataValue) {
|
|
3048
3132
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3049
3133
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3050
3134
|
}
|
|
3051
3135
|
}
|
|
3052
|
-
__name(
|
|
3053
|
-
function
|
|
3136
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3137
|
+
function _ts_param17(paramIndex, decorator) {
|
|
3054
3138
|
return function(target, key) {
|
|
3055
3139
|
decorator(target, key, paramIndex);
|
|
3056
3140
|
};
|
|
3057
3141
|
}
|
|
3058
|
-
__name(
|
|
3142
|
+
__name(_ts_param17, "_ts_param");
|
|
3059
3143
|
var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
3060
3144
|
static {
|
|
3061
3145
|
__name(this, "SkillDiscoveryService");
|
|
3062
3146
|
}
|
|
3063
3147
|
discovery;
|
|
3064
3148
|
declared;
|
|
3065
|
-
logger = new
|
|
3149
|
+
logger = new import_common19.Logger(_SkillDiscoveryService.name);
|
|
3066
3150
|
constructor(discovery, declared) {
|
|
3067
3151
|
this.discovery = discovery;
|
|
3068
3152
|
this.declared = declared;
|
|
@@ -3099,11 +3183,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
|
3099
3183
|
return flat === void 0 ? void 0 : () => flat;
|
|
3100
3184
|
}
|
|
3101
3185
|
};
|
|
3102
|
-
SkillDiscoveryService =
|
|
3103
|
-
(0,
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3186
|
+
SkillDiscoveryService = _ts_decorate19([
|
|
3187
|
+
(0, import_common19.Injectable)(),
|
|
3188
|
+
_ts_param17(1, (0, import_common19.Inject)(import_nestjs_agent_core21.AGENT_SKILL_SOURCES)),
|
|
3189
|
+
_ts_metadata18("design:type", Function),
|
|
3190
|
+
_ts_metadata18("design:paramtypes", [
|
|
3107
3191
|
typeof import_core3.DiscoveryService === "undefined" ? Object : import_core3.DiscoveryService,
|
|
3108
3192
|
Array
|
|
3109
3193
|
])
|
|
@@ -3133,9 +3217,9 @@ var LedgerQuotaStore = class {
|
|
|
3133
3217
|
};
|
|
3134
3218
|
|
|
3135
3219
|
// src/runner/inline-agent-runner.ts
|
|
3136
|
-
var
|
|
3137
|
-
var
|
|
3138
|
-
function
|
|
3220
|
+
var import_nestjs_agent_core22 = require("@dudousxd/nestjs-agent-core");
|
|
3221
|
+
var import_common20 = require("@nestjs/common");
|
|
3222
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
3139
3223
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3140
3224
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3141
3225
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3148,26 +3232,26 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
3148
3232
|
}
|
|
3149
3233
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3150
3234
|
}
|
|
3151
|
-
__name(
|
|
3152
|
-
function
|
|
3235
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3236
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
3153
3237
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3154
3238
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3155
3239
|
}
|
|
3156
3240
|
}
|
|
3157
|
-
__name(
|
|
3158
|
-
function
|
|
3241
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
3242
|
+
function _ts_param18(paramIndex, decorator) {
|
|
3159
3243
|
return function(target, key) {
|
|
3160
3244
|
decorator(target, key, paramIndex);
|
|
3161
3245
|
};
|
|
3162
3246
|
}
|
|
3163
|
-
__name(
|
|
3247
|
+
__name(_ts_param18, "_ts_param");
|
|
3164
3248
|
var InlineAgentRunner = class _InlineAgentRunner {
|
|
3165
3249
|
static {
|
|
3166
3250
|
__name(this, "InlineAgentRunner");
|
|
3167
3251
|
}
|
|
3168
3252
|
factory;
|
|
3169
3253
|
store;
|
|
3170
|
-
logger = new
|
|
3254
|
+
logger = new import_common20.Logger(_InlineAgentRunner.name);
|
|
3171
3255
|
pending = /* @__PURE__ */ new Map();
|
|
3172
3256
|
/**
|
|
3173
3257
|
* Runs someone has asked to stop. In-process, like `pending`, and for the same reason: this runner
|
|
@@ -3196,18 +3280,18 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3196
3280
|
] : []
|
|
3197
3281
|
]
|
|
3198
3282
|
});
|
|
3199
|
-
void (0,
|
|
3283
|
+
void (0, import_nestjs_agent_core22.runAgentLoop)({
|
|
3200
3284
|
...deps,
|
|
3201
3285
|
day
|
|
3202
3286
|
}, input, hooks).then(() => this.store.setActiveStream(input.threadId, null)).catch(async (error) => {
|
|
3203
|
-
if (error instanceof
|
|
3287
|
+
if (error instanceof import_nestjs_agent_core22.RunCancelledError) {
|
|
3204
3288
|
await this.settleCancelled(runId, input.threadId, deps);
|
|
3205
3289
|
return;
|
|
3206
3290
|
}
|
|
3207
3291
|
const message = error instanceof Error ? error.message : String(error);
|
|
3208
|
-
const code = (0,
|
|
3292
|
+
const code = (0, import_nestjs_agent_core22.agentFailureCode)(error);
|
|
3209
3293
|
this.logger.error(`agent run ${runId} failed (${code}): ${message}`);
|
|
3210
|
-
(0,
|
|
3294
|
+
(0, import_nestjs_agent_core22.publishAgentRunFailed)({
|
|
3211
3295
|
runId,
|
|
3212
3296
|
code,
|
|
3213
3297
|
message
|
|
@@ -3256,7 +3340,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3256
3340
|
for (const [key, waiter] of this.pending) {
|
|
3257
3341
|
if (key.startsWith(`${runId}:`)) {
|
|
3258
3342
|
this.pending.delete(key);
|
|
3259
|
-
waiter.reject(new
|
|
3343
|
+
waiter.reject(new import_nestjs_agent_core22.RunCancelledError());
|
|
3260
3344
|
}
|
|
3261
3345
|
}
|
|
3262
3346
|
await Promise.resolve();
|
|
@@ -3271,7 +3355,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3271
3355
|
this.logger.log(`agent run ${runId} cancelled`);
|
|
3272
3356
|
await this.store.setActiveStream(threadId, null);
|
|
3273
3357
|
const writer = await deps.sink.open(runId);
|
|
3274
|
-
await writer.write((0,
|
|
3358
|
+
await writer.write((0, import_nestjs_agent_core22.encodeStreamEvent)({
|
|
3275
3359
|
kind: "cancelled"
|
|
3276
3360
|
}));
|
|
3277
3361
|
await writer.end();
|
|
@@ -3302,7 +3386,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3302
3386
|
awaitApproval: /* @__PURE__ */ __name((call) => this.park(runId, call.id), "awaitApproval"),
|
|
3303
3387
|
awaitAnswers: /* @__PURE__ */ __name((request) => this.park(runId, request.id), "awaitAnswers"),
|
|
3304
3388
|
step: /* @__PURE__ */ __name((_name, fn) => fn(), "step"),
|
|
3305
|
-
parallel:
|
|
3389
|
+
parallel: import_nestjs_agent_core22.settleAll,
|
|
3306
3390
|
cancelled: /* @__PURE__ */ __name(async () => this.cancelled.has(runId), "cancelled"),
|
|
3307
3391
|
runAgent: /* @__PURE__ */ __name((agentName, task) => this.runNested({
|
|
3308
3392
|
agentName,
|
|
@@ -3353,7 +3437,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3353
3437
|
awaitApproval: /* @__PURE__ */ __name((call) => this.park(runId, call.id), "awaitApproval"),
|
|
3354
3438
|
awaitAnswers: /* @__PURE__ */ __name((request) => this.park(runId, request.id), "awaitAnswers"),
|
|
3355
3439
|
step: /* @__PURE__ */ __name((_name, fn) => fn(), "step"),
|
|
3356
|
-
parallel:
|
|
3440
|
+
parallel: import_nestjs_agent_core22.settleAll,
|
|
3357
3441
|
cancelled: /* @__PURE__ */ __name(async () => this.cancelled.has(runId), "cancelled"),
|
|
3358
3442
|
runAgent: /* @__PURE__ */ __name((childName, childTask) => this.runNested({
|
|
3359
3443
|
agentName: childName,
|
|
@@ -3386,7 +3470,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3386
3470
|
}
|
|
3387
3471
|
}), "startAgent")
|
|
3388
3472
|
};
|
|
3389
|
-
void (0,
|
|
3473
|
+
void (0, import_nestjs_agent_core22.runAgentLoop)({
|
|
3390
3474
|
...deps,
|
|
3391
3475
|
day
|
|
3392
3476
|
}, {
|
|
@@ -3400,13 +3484,13 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3400
3484
|
parentRunId,
|
|
3401
3485
|
deliverTo
|
|
3402
3486
|
}, hooks).catch(async (error) => {
|
|
3403
|
-
const cancelled = error instanceof
|
|
3487
|
+
const cancelled = error instanceof import_nestjs_agent_core22.RunCancelledError;
|
|
3404
3488
|
const message = error instanceof Error ? error.message : String(error);
|
|
3405
3489
|
if (!cancelled) {
|
|
3406
3490
|
this.logger.error(`detached agent run ${runId} failed: ${message}`);
|
|
3407
|
-
(0,
|
|
3491
|
+
(0, import_nestjs_agent_core22.publishAgentRunFailed)({
|
|
3408
3492
|
runId,
|
|
3409
|
-
code: (0,
|
|
3493
|
+
code: (0, import_nestjs_agent_core22.agentFailureCode)(error),
|
|
3410
3494
|
message
|
|
3411
3495
|
});
|
|
3412
3496
|
}
|
|
@@ -3414,11 +3498,11 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3414
3498
|
runId,
|
|
3415
3499
|
status: cancelled ? "cancelled" : "failed",
|
|
3416
3500
|
...cancelled ? {} : {
|
|
3417
|
-
errorCode: (0,
|
|
3501
|
+
errorCode: (0, import_nestjs_agent_core22.agentFailureCode)(error),
|
|
3418
3502
|
errorMessage: message
|
|
3419
3503
|
}
|
|
3420
3504
|
});
|
|
3421
|
-
await (0,
|
|
3505
|
+
await (0, import_nestjs_agent_core22.settleUnsettledDelegation)({
|
|
3422
3506
|
store: this.store,
|
|
3423
3507
|
delivery: deliverTo,
|
|
3424
3508
|
agent: agentName,
|
|
@@ -3457,7 +3541,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3457
3541
|
awaitApproval: /* @__PURE__ */ __name((call) => this.park(runId, call.id), "awaitApproval"),
|
|
3458
3542
|
awaitAnswers: /* @__PURE__ */ __name((request) => this.park(runId, request.id), "awaitAnswers"),
|
|
3459
3543
|
step: /* @__PURE__ */ __name((_name, fn) => fn(), "step"),
|
|
3460
|
-
parallel:
|
|
3544
|
+
parallel: import_nestjs_agent_core22.settleAll,
|
|
3461
3545
|
// A child stops when it is cancelled OR when the run a human is actually watching is: the
|
|
3462
3546
|
// canceller names the top-level run, which is the only id that ever left the server.
|
|
3463
3547
|
cancelled: /* @__PURE__ */ __name(async () => this.cancelled.has(runId) || this.cancelled.has(sinkRunId), "cancelled"),
|
|
@@ -3492,7 +3576,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3492
3576
|
}), "startAgent")
|
|
3493
3577
|
};
|
|
3494
3578
|
try {
|
|
3495
|
-
return await (0,
|
|
3579
|
+
return await (0, import_nestjs_agent_core22.runAgentLoop)({
|
|
3496
3580
|
...deps,
|
|
3497
3581
|
day
|
|
3498
3582
|
}, {
|
|
@@ -3511,19 +3595,19 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3511
3595
|
}
|
|
3512
3596
|
}
|
|
3513
3597
|
};
|
|
3514
|
-
InlineAgentRunner =
|
|
3515
|
-
(0,
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3598
|
+
InlineAgentRunner = _ts_decorate20([
|
|
3599
|
+
(0, import_common20.Injectable)(),
|
|
3600
|
+
_ts_param18(0, (0, import_common20.Inject)(import_nestjs_agent_core22.AGENT_DEPS_FACTORY)),
|
|
3601
|
+
_ts_param18(1, (0, import_common20.Inject)(import_nestjs_agent_core22.AGENT_STORE)),
|
|
3602
|
+
_ts_metadata19("design:type", Function),
|
|
3603
|
+
_ts_metadata19("design:paramtypes", [
|
|
3520
3604
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
3521
3605
|
typeof AgentStore === "undefined" ? Object : AgentStore
|
|
3522
3606
|
])
|
|
3523
3607
|
], InlineAgentRunner);
|
|
3524
3608
|
|
|
3525
3609
|
// src/skills-config.ts
|
|
3526
|
-
var
|
|
3610
|
+
var import_nestjs_agent_core23 = require("@dudousxd/nestjs-agent-core");
|
|
3527
3611
|
function declaredSkillProvider(declared) {
|
|
3528
3612
|
return {
|
|
3529
3613
|
list: /* @__PURE__ */ __name(({ scopes }) => declared.filter((skill) => scopes.includes(skill.scope)).map(({ name, description, scope }) => ({
|
|
@@ -3549,7 +3633,7 @@ function resolveSkillsConfig(options, declared) {
|
|
|
3549
3633
|
declaredSkillProvider(declared)
|
|
3550
3634
|
];
|
|
3551
3635
|
return {
|
|
3552
|
-
provider: providers.length === 1 ? providers[0] : (0,
|
|
3636
|
+
provider: providers.length === 1 ? providers[0] : (0, import_nestjs_agent_core23.compositeSkillProvider)(providers),
|
|
3553
3637
|
...options.scopes !== void 0 ? {
|
|
3554
3638
|
scopes: options.scopes
|
|
3555
3639
|
} : {},
|
|
@@ -3561,7 +3645,7 @@ function resolveSkillsConfig(options, declared) {
|
|
|
3561
3645
|
__name(resolveSkillsConfig, "resolveSkillsConfig");
|
|
3562
3646
|
|
|
3563
3647
|
// src/agent.module.ts
|
|
3564
|
-
function
|
|
3648
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
3565
3649
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3566
3650
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3567
3651
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3574,92 +3658,92 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
3574
3658
|
}
|
|
3575
3659
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3576
3660
|
}
|
|
3577
|
-
__name(
|
|
3661
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3578
3662
|
var DEFAULT_PATH = "agent";
|
|
3579
3663
|
function sharedProviders(durable, includeStore) {
|
|
3580
3664
|
const providers = [
|
|
3581
3665
|
{
|
|
3582
|
-
provide:
|
|
3583
|
-
useFactory: /* @__PURE__ */ __name(() => new
|
|
3666
|
+
provide: import_nestjs_agent_core24.AGENT_TOOL_REGISTRY,
|
|
3667
|
+
useFactory: /* @__PURE__ */ __name(() => new import_nestjs_agent_core24.ToolRegistry(), "useFactory")
|
|
3584
3668
|
},
|
|
3585
3669
|
// Starts empty; AgentDiscoveryService populates it from `@Agent`-decorated providers at boot.
|
|
3586
3670
|
{
|
|
3587
|
-
provide:
|
|
3588
|
-
useFactory: /* @__PURE__ */ __name(() => new
|
|
3671
|
+
provide: import_nestjs_agent_core24.AGENT_REGISTRY,
|
|
3672
|
+
useFactory: /* @__PURE__ */ __name(() => new import_nestjs_agent_core24.AgentRegistry(), "useFactory")
|
|
3589
3673
|
},
|
|
3590
3674
|
// A shared, mutable list AgentDiscoveryService fills with `@SystemPromptContributor()` methods.
|
|
3591
3675
|
{
|
|
3592
|
-
provide:
|
|
3676
|
+
provide: import_nestjs_agent_core24.AGENT_PROMPT_CONTRIBUTORS,
|
|
3593
3677
|
useFactory: /* @__PURE__ */ __name(() => [], "useFactory")
|
|
3594
3678
|
},
|
|
3595
3679
|
// Likewise for `@Skill`-decorated providers — filled by SkillDiscoveryService at onModuleInit,
|
|
3596
3680
|
// read lazily by the AGENT_SKILLS provider below (which DI builds before discovery has run).
|
|
3597
3681
|
{
|
|
3598
|
-
provide:
|
|
3682
|
+
provide: import_nestjs_agent_core24.AGENT_SKILL_SOURCES,
|
|
3599
3683
|
useFactory: /* @__PURE__ */ __name(() => [], "useFactory")
|
|
3600
3684
|
},
|
|
3601
3685
|
{
|
|
3602
3686
|
// One resolution, shared by the loop's deps and the listing endpoint: a second one would
|
|
3603
3687
|
// drift, and a user would be offered a skill the agent cannot reach. `undefined` when the
|
|
3604
3688
|
// host configured none — which is what keeps the turn's checkpoint sequence unchanged.
|
|
3605
|
-
provide:
|
|
3689
|
+
provide: import_nestjs_agent_core24.AGENT_SKILLS,
|
|
3606
3690
|
useFactory: /* @__PURE__ */ __name((options, declared) => resolveSkillsConfig(options.skills, declared), "useFactory"),
|
|
3607
3691
|
inject: [
|
|
3608
|
-
|
|
3609
|
-
|
|
3692
|
+
import_nestjs_agent_core24.AGENT_OPTIONS,
|
|
3693
|
+
import_nestjs_agent_core24.AGENT_SKILL_SOURCES
|
|
3610
3694
|
]
|
|
3611
3695
|
},
|
|
3612
3696
|
{
|
|
3613
3697
|
// One resolution, shared by the loop's deps and the read-back endpoint: a person has to be
|
|
3614
3698
|
// shown what the model was shown, and two resolutions would eventually disagree about that.
|
|
3615
|
-
provide:
|
|
3699
|
+
provide: import_nestjs_agent_core24.AGENT_MEMORY,
|
|
3616
3700
|
useFactory: /* @__PURE__ */ __name((options) => options.memory, "useFactory"),
|
|
3617
3701
|
inject: [
|
|
3618
|
-
|
|
3702
|
+
import_nestjs_agent_core24.AGENT_OPTIONS
|
|
3619
3703
|
]
|
|
3620
3704
|
},
|
|
3621
3705
|
{
|
|
3622
|
-
provide:
|
|
3706
|
+
provide: import_nestjs_agent_core24.AGENT_SINK,
|
|
3623
3707
|
useFactory: /* @__PURE__ */ __name((options) => options.sink ?? new InProcessTokenStreamSink(), "useFactory"),
|
|
3624
3708
|
inject: [
|
|
3625
|
-
|
|
3709
|
+
import_nestjs_agent_core24.AGENT_OPTIONS
|
|
3626
3710
|
]
|
|
3627
3711
|
},
|
|
3628
3712
|
{
|
|
3629
|
-
provide:
|
|
3630
|
-
useFactory: /* @__PURE__ */ __name((options) => options.rolesPolicy ?? new
|
|
3713
|
+
provide: import_nestjs_agent_core24.AGENT_ROLES_POLICY,
|
|
3714
|
+
useFactory: /* @__PURE__ */ __name((options) => options.rolesPolicy ?? new import_nestjs_agent_core24.DefaultRolesPolicy(options.defaultRoles), "useFactory"),
|
|
3631
3715
|
inject: [
|
|
3632
|
-
|
|
3716
|
+
import_nestjs_agent_core24.AGENT_OPTIONS
|
|
3633
3717
|
]
|
|
3634
3718
|
},
|
|
3635
3719
|
{
|
|
3636
|
-
provide:
|
|
3720
|
+
provide: import_nestjs_agent_core24.AGENT_ACTOR_RESOLVER,
|
|
3637
3721
|
useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
|
|
3638
3722
|
inject: [
|
|
3639
|
-
|
|
3723
|
+
import_nestjs_agent_core24.AGENT_OPTIONS
|
|
3640
3724
|
]
|
|
3641
3725
|
},
|
|
3642
3726
|
{
|
|
3643
|
-
provide:
|
|
3727
|
+
provide: import_nestjs_agent_core24.AGENT_MODEL,
|
|
3644
3728
|
useFactory: /* @__PURE__ */ __name((o) => o.model, "useFactory"),
|
|
3645
3729
|
inject: [
|
|
3646
|
-
|
|
3730
|
+
import_nestjs_agent_core24.AGENT_OPTIONS
|
|
3647
3731
|
]
|
|
3648
3732
|
},
|
|
3649
3733
|
{
|
|
3650
3734
|
// An explicit `quota` wins; otherwise `quotaLimitTokens` binds the built-in ledger-backed
|
|
3651
3735
|
// store; otherwise quotas are off (undefined). The ledger store reads the same usage rows
|
|
3652
3736
|
// the loop already writes, so enforcement needs no extra shared state across replicas.
|
|
3653
|
-
provide:
|
|
3737
|
+
provide: import_nestjs_agent_core24.AGENT_QUOTA_STORE,
|
|
3654
3738
|
useFactory: /* @__PURE__ */ __name((o, store) => o.quota ?? (o.quotaLimitTokens !== void 0 ? new LedgerQuotaStore(store, o.quotaLimitTokens) : void 0), "useFactory"),
|
|
3655
3739
|
inject: [
|
|
3656
|
-
|
|
3657
|
-
|
|
3740
|
+
import_nestjs_agent_core24.AGENT_OPTIONS,
|
|
3741
|
+
import_nestjs_agent_core24.AGENT_STORE
|
|
3658
3742
|
]
|
|
3659
3743
|
},
|
|
3660
3744
|
AgentDepsFactory2,
|
|
3661
3745
|
{
|
|
3662
|
-
provide:
|
|
3746
|
+
provide: import_nestjs_agent_core24.AGENT_DEPS_FACTORY,
|
|
3663
3747
|
useExisting: AgentDepsFactory2
|
|
3664
3748
|
},
|
|
3665
3749
|
// Populates the registry + contributors (onModuleInit) BEFORE AiToolDiscoveryService synthesizes
|
|
@@ -3673,22 +3757,22 @@ function sharedProviders(durable, includeStore) {
|
|
|
3673
3757
|
// through AgentService.signalToolCall, which reaches whichever AGENT_RUNNER is bound above.
|
|
3674
3758
|
AgentApprovalPortAdapter,
|
|
3675
3759
|
{
|
|
3676
|
-
provide:
|
|
3760
|
+
provide: import_nestjs_agent_core24.AGENT_APPROVAL_PORT,
|
|
3677
3761
|
useExisting: AgentApprovalPortAdapter
|
|
3678
3762
|
}
|
|
3679
3763
|
];
|
|
3680
3764
|
if (includeStore) {
|
|
3681
3765
|
providers.push({
|
|
3682
|
-
provide:
|
|
3766
|
+
provide: import_nestjs_agent_core24.AGENT_STORE,
|
|
3683
3767
|
useFactory: /* @__PURE__ */ __name((o) => o.store, "useFactory"),
|
|
3684
3768
|
inject: [
|
|
3685
|
-
|
|
3769
|
+
import_nestjs_agent_core24.AGENT_OPTIONS
|
|
3686
3770
|
]
|
|
3687
3771
|
});
|
|
3688
3772
|
}
|
|
3689
3773
|
if (durable) {
|
|
3690
3774
|
providers.push({
|
|
3691
|
-
provide:
|
|
3775
|
+
provide: import_nestjs_agent_core24.AGENT_RUNNER,
|
|
3692
3776
|
useFactory: /* @__PURE__ */ __name((durableRunner) => {
|
|
3693
3777
|
if (durableRunner === void 0) {
|
|
3694
3778
|
throw new Error("AgentModule.forRoot({ durable: true }) requires importing AgentDurableModule from '@dudousxd/nestjs-agent/durable' (alongside a configured DurableModule). It was not found.");
|
|
@@ -3697,14 +3781,14 @@ function sharedProviders(durable, includeStore) {
|
|
|
3697
3781
|
}, "useFactory"),
|
|
3698
3782
|
inject: [
|
|
3699
3783
|
{
|
|
3700
|
-
token:
|
|
3784
|
+
token: import_nestjs_agent_core24.AGENT_DURABLE_RUNNER,
|
|
3701
3785
|
optional: true
|
|
3702
3786
|
}
|
|
3703
3787
|
]
|
|
3704
3788
|
});
|
|
3705
3789
|
} else {
|
|
3706
3790
|
providers.push({
|
|
3707
|
-
provide:
|
|
3791
|
+
provide: import_nestjs_agent_core24.AGENT_RUNNER,
|
|
3708
3792
|
useExisting: InlineAgentRunner
|
|
3709
3793
|
});
|
|
3710
3794
|
}
|
|
@@ -3713,25 +3797,25 @@ function sharedProviders(durable, includeStore) {
|
|
|
3713
3797
|
__name(sharedProviders, "sharedProviders");
|
|
3714
3798
|
function exportsFor(includeStore) {
|
|
3715
3799
|
return [
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3800
|
+
import_nestjs_agent_core24.AGENT_OPTIONS,
|
|
3801
|
+
import_nestjs_agent_core24.AGENT_TOOL_REGISTRY,
|
|
3802
|
+
import_nestjs_agent_core24.AGENT_REGISTRY,
|
|
3803
|
+
import_nestjs_agent_core24.AGENT_SINK,
|
|
3804
|
+
import_nestjs_agent_core24.AGENT_ROLES_POLICY,
|
|
3805
|
+
import_nestjs_agent_core24.AGENT_ACTOR_RESOLVER,
|
|
3806
|
+
import_nestjs_agent_core24.AGENT_MODEL,
|
|
3723
3807
|
...includeStore ? [
|
|
3724
|
-
|
|
3808
|
+
import_nestjs_agent_core24.AGENT_STORE
|
|
3725
3809
|
] : [],
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3810
|
+
import_nestjs_agent_core24.AGENT_QUOTA_STORE,
|
|
3811
|
+
import_nestjs_agent_core24.AGENT_PROMPT_CONTRIBUTORS,
|
|
3812
|
+
import_nestjs_agent_core24.AGENT_SKILLS,
|
|
3813
|
+
import_nestjs_agent_core24.AGENT_MEMORY,
|
|
3814
|
+
import_nestjs_agent_core24.AGENT_DEPS_FACTORY,
|
|
3731
3815
|
AgentDepsFactory2,
|
|
3732
3816
|
AgentService,
|
|
3733
3817
|
InlineAgentRunner,
|
|
3734
|
-
|
|
3818
|
+
import_nestjs_agent_core24.AGENT_APPROVAL_PORT
|
|
3735
3819
|
];
|
|
3736
3820
|
}
|
|
3737
3821
|
__name(exportsFor, "exportsFor");
|
|
@@ -3742,7 +3826,8 @@ var BASE_CONTROLLERS = [
|
|
|
3742
3826
|
QuotaController,
|
|
3743
3827
|
AgentsController,
|
|
3744
3828
|
SkillsController,
|
|
3745
|
-
MemoriesController
|
|
3829
|
+
MemoriesController,
|
|
3830
|
+
ToolsController
|
|
3746
3831
|
];
|
|
3747
3832
|
var GUARDABLE_CONTROLLERS = [
|
|
3748
3833
|
...BASE_CONTROLLERS,
|
|
@@ -3800,7 +3885,7 @@ var AgentModule = class _AgentModule {
|
|
|
3800
3885
|
controllers: controllersForSurface(options.surface, options.attachments?.upload === true),
|
|
3801
3886
|
providers: [
|
|
3802
3887
|
{
|
|
3803
|
-
provide:
|
|
3888
|
+
provide: import_nestjs_agent_core24.AGENT_OPTIONS,
|
|
3804
3889
|
useValue: options
|
|
3805
3890
|
},
|
|
3806
3891
|
...sharedProviders(options.durable ?? false, includeStore),
|
|
@@ -3824,7 +3909,7 @@ var AgentModule = class _AgentModule {
|
|
|
3824
3909
|
controllers: controllersForSurface(options.surface, options.attachmentsUpload === true),
|
|
3825
3910
|
providers: [
|
|
3826
3911
|
{
|
|
3827
|
-
provide:
|
|
3912
|
+
provide: import_nestjs_agent_core24.AGENT_OPTIONS,
|
|
3828
3913
|
// Stamp the STATIC wiring flags onto the factory result: `durable`/`surface` are
|
|
3829
3914
|
// authoritative on the async config object (they decided the actual wiring above), and
|
|
3830
3915
|
// the durable module reads `durable` back off AGENT_OPTIONS. `surface` isn't read back by
|
|
@@ -3845,9 +3930,9 @@ var AgentModule = class _AgentModule {
|
|
|
3845
3930
|
};
|
|
3846
3931
|
}
|
|
3847
3932
|
};
|
|
3848
|
-
AgentModule =
|
|
3849
|
-
(0,
|
|
3850
|
-
(0,
|
|
3933
|
+
AgentModule = _ts_decorate21([
|
|
3934
|
+
(0, import_common21.Global)(),
|
|
3935
|
+
(0, import_common21.Module)({})
|
|
3851
3936
|
], AgentModule);
|
|
3852
3937
|
|
|
3853
3938
|
// src/durable/agent-durable.ts
|