@dudousxd/nestjs-agent 0.13.0 → 1.0.1
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 +34 -0
- package/dist/{agent-deps.factory-y2hvoQ6U.d.cts → agent-deps.factory-OjrLyAZo.d.cts} +12 -31
- package/dist/{agent-deps.factory-y2hvoQ6U.d.ts → agent-deps.factory-OjrLyAZo.d.ts} +12 -31
- package/dist/durable/index.cjs +133 -132
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +42 -34
- package/dist/durable/index.d.ts +42 -34
- package/dist/durable/index.js +161 -159
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +7 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -19
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -3054,18 +3054,11 @@ function routerFor(path) {
|
|
|
3054
3054
|
]);
|
|
3055
3055
|
}
|
|
3056
3056
|
__name(routerFor, "routerFor");
|
|
3057
|
-
function assertDispatchedStepsRequiresDurable(dispatchedSteps, durable) {
|
|
3058
|
-
if (dispatchedSteps && !durable) {
|
|
3059
|
-
throw new Error("AgentModule dispatchedSteps: true requires durable: true \u2014 dispatched steps are routed durable steps (AgentRunSteps.llm/tool) with no in-process equivalent.");
|
|
3060
|
-
}
|
|
3061
|
-
}
|
|
3062
|
-
__name(assertDispatchedStepsRequiresDurable, "assertDispatchedStepsRequiresDurable");
|
|
3063
3057
|
var AgentModule = class _AgentModule {
|
|
3064
3058
|
static {
|
|
3065
3059
|
__name(this, "AgentModule");
|
|
3066
3060
|
}
|
|
3067
3061
|
static forRoot(options) {
|
|
3068
|
-
assertDispatchedStepsRequiresDurable(options.dispatchedSteps ?? false, options.durable ?? false);
|
|
3069
3062
|
const path = options.path ?? DEFAULT_PATH;
|
|
3070
3063
|
const includeStore = options.store !== void 0;
|
|
3071
3064
|
applyGuards(options.guards);
|
|
@@ -3089,7 +3082,6 @@ var AgentModule = class _AgentModule {
|
|
|
3089
3082
|
};
|
|
3090
3083
|
}
|
|
3091
3084
|
static forRootAsync(options) {
|
|
3092
|
-
assertDispatchedStepsRequiresDurable(options.dispatchedSteps ?? false, options.durable ?? false);
|
|
3093
3085
|
const path = options.path ?? DEFAULT_PATH;
|
|
3094
3086
|
const includeStore = options.externalStore !== true;
|
|
3095
3087
|
applyGuards(options.guards);
|
|
@@ -3105,20 +3097,16 @@ var AgentModule = class _AgentModule {
|
|
|
3105
3097
|
providers: [
|
|
3106
3098
|
{
|
|
3107
3099
|
provide: import_nestjs_agent_core19.AGENT_OPTIONS,
|
|
3108
|
-
// Stamp the STATIC wiring flags onto the factory result: `durable`/`
|
|
3109
|
-
//
|
|
3110
|
-
//
|
|
3111
|
-
//
|
|
3112
|
-
//
|
|
3113
|
-
//
|
|
3114
|
-
// EFFECTIVE value is always observable off AGENT_OPTIONS, sync or async alike.
|
|
3100
|
+
// Stamp the STATIC wiring flags onto the factory result: `durable`/`surface` are
|
|
3101
|
+
// authoritative on the async config object (they decided the actual wiring above), and
|
|
3102
|
+
// the durable module reads `durable` back off AGENT_OPTIONS. `surface` isn't read back by
|
|
3103
|
+
// anything today (AgentDurableModule takes its own mirror option — see its doc for why),
|
|
3104
|
+
// but it's stamped here too so the EFFECTIVE value is always observable off
|
|
3105
|
+
// AGENT_OPTIONS, sync or async alike.
|
|
3115
3106
|
useFactory: /* @__PURE__ */ __name(async (...args) => ({
|
|
3116
3107
|
...await options.useFactory(...args),
|
|
3117
3108
|
durable: options.durable ?? false,
|
|
3118
|
-
surface: options.surface ?? "both"
|
|
3119
|
-
...options.dispatchedSteps !== void 0 ? {
|
|
3120
|
-
dispatchedSteps: options.dispatchedSteps
|
|
3121
|
-
} : {}
|
|
3109
|
+
surface: options.surface ?? "both"
|
|
3122
3110
|
}), "useFactory"),
|
|
3123
3111
|
inject: options.inject ?? []
|
|
3124
3112
|
},
|