@dudousxd/nestjs-agent 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-deps.factory-EROMcBNh.d.cts → agent-deps.factory-y2hvoQ6U.d.cts} +18 -11
- package/dist/{agent-deps.factory-EROMcBNh.d.ts → agent-deps.factory-y2hvoQ6U.d.ts} +18 -11
- package/dist/durable/index.cjs +2 -2
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +11 -11
- package/dist/durable/index.d.ts +11 -11
- package/dist/durable/index.js +2 -2
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -223,11 +223,19 @@ interface AgentModuleOptions {
|
|
|
223
223
|
durable?: boolean;
|
|
224
224
|
/**
|
|
225
225
|
* Dispatch the turn's model call and tool executions as routed durable steps
|
|
226
|
-
* (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s.
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
226
|
+
* (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s. OMITTED
|
|
227
|
+
* keeps them in-process; `true` without `durable: true` throws at module build.
|
|
228
|
+
*
|
|
229
|
+
* WHAT IT BUYS: the run is not pinned to one pod for the two long parts of a turn, so a fleet can
|
|
230
|
+
* scale the model call and tool execution separately from the workflow itself.
|
|
231
|
+
*
|
|
232
|
+
* WHY IT IS NOT A DEFAULT. It relocates the HOST's own code. A tool handler no longer runs inside
|
|
233
|
+
* the turn's workflow body but inside whichever worker serves the routed group, and the `llm`
|
|
234
|
+
* step re-runs the host's tool-visibility callbacks there to rebuild its tool list. A handler
|
|
235
|
+
* that resolves anything per invocation from its caller's execution context — a request-scoped
|
|
236
|
+
* ORM EntityManager, an AsyncLocalStorage tenant, a CLS transaction — finds nothing in that
|
|
237
|
+
* worker, and the library has no way to know which handlers do that. Turn this on once the tools
|
|
238
|
+
* this deployment registers establish whatever context they need themselves.
|
|
231
239
|
*
|
|
232
240
|
* The cross-process-sink requirement is a property of `durable: true` itself, not of this flag:
|
|
233
241
|
* the turn already runs on whichever worker takes `agent.run`, which may not be the pod holding
|
|
@@ -383,12 +391,11 @@ interface AgentModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
|
383
391
|
*/
|
|
384
392
|
durable?: boolean;
|
|
385
393
|
/**
|
|
386
|
-
* Dispatch the turn's model call and tool executions as routed durable steps.
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
* `
|
|
391
|
-
* contract.
|
|
394
|
+
* Dispatch the turn's model call and tool executions as routed durable steps. Omitted keeps the
|
|
395
|
+
* turn's steps in-process localSteps. Same static-wiring reasoning as `durable` above — it lives
|
|
396
|
+
* here (not in the async factory result) because it decides how `AgentRunWorkflow` builds its
|
|
397
|
+
* hooks at module build time. `true` without `durable: true` throws at module build. See
|
|
398
|
+
* `AgentModuleOptions.dispatchedSteps` for the full contract.
|
|
392
399
|
*/
|
|
393
400
|
dispatchedSteps?: boolean;
|
|
394
401
|
/**
|
|
@@ -223,11 +223,19 @@ interface AgentModuleOptions {
|
|
|
223
223
|
durable?: boolean;
|
|
224
224
|
/**
|
|
225
225
|
* Dispatch the turn's model call and tool executions as routed durable steps
|
|
226
|
-
* (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s.
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
226
|
+
* (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s. OMITTED
|
|
227
|
+
* keeps them in-process; `true` without `durable: true` throws at module build.
|
|
228
|
+
*
|
|
229
|
+
* WHAT IT BUYS: the run is not pinned to one pod for the two long parts of a turn, so a fleet can
|
|
230
|
+
* scale the model call and tool execution separately from the workflow itself.
|
|
231
|
+
*
|
|
232
|
+
* WHY IT IS NOT A DEFAULT. It relocates the HOST's own code. A tool handler no longer runs inside
|
|
233
|
+
* the turn's workflow body but inside whichever worker serves the routed group, and the `llm`
|
|
234
|
+
* step re-runs the host's tool-visibility callbacks there to rebuild its tool list. A handler
|
|
235
|
+
* that resolves anything per invocation from its caller's execution context — a request-scoped
|
|
236
|
+
* ORM EntityManager, an AsyncLocalStorage tenant, a CLS transaction — finds nothing in that
|
|
237
|
+
* worker, and the library has no way to know which handlers do that. Turn this on once the tools
|
|
238
|
+
* this deployment registers establish whatever context they need themselves.
|
|
231
239
|
*
|
|
232
240
|
* The cross-process-sink requirement is a property of `durable: true` itself, not of this flag:
|
|
233
241
|
* the turn already runs on whichever worker takes `agent.run`, which may not be the pod holding
|
|
@@ -383,12 +391,11 @@ interface AgentModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
|
383
391
|
*/
|
|
384
392
|
durable?: boolean;
|
|
385
393
|
/**
|
|
386
|
-
* Dispatch the turn's model call and tool executions as routed durable steps.
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
* `
|
|
391
|
-
* contract.
|
|
394
|
+
* Dispatch the turn's model call and tool executions as routed durable steps. Omitted keeps the
|
|
395
|
+
* turn's steps in-process localSteps. Same static-wiring reasoning as `durable` above — it lives
|
|
396
|
+
* here (not in the async factory result) because it decides how `AgentRunWorkflow` builds its
|
|
397
|
+
* hooks at module build time. `true` without `durable: true` throws at module build. See
|
|
398
|
+
* `AgentModuleOptions.dispatchedSteps` for the full contract.
|
|
392
399
|
*/
|
|
393
400
|
dispatchedSteps?: boolean;
|
|
394
401
|
/**
|
package/dist/durable/index.cjs
CHANGED
|
@@ -662,9 +662,9 @@ function runnerProviders() {
|
|
|
662
662
|
{
|
|
663
663
|
provide: AGENT_DISPATCHED_STEPS,
|
|
664
664
|
useFactory: /* @__PURE__ */ __name((options, sink) => {
|
|
665
|
-
const enabled = options.durable === true && options.dispatchedSteps
|
|
665
|
+
const enabled = options.durable === true && options.dispatchedSteps === true;
|
|
666
666
|
if (enabled && sink instanceof InProcessTokenStreamSink) {
|
|
667
|
-
logger.warn("
|
|
667
|
+
logger.warn("dispatchedSteps: true with the default InProcessTokenStreamSink, which only buffers tokens in-process. A dispatched `llm` step served by a different worker cannot stream into this buffer. Wire a cross-process TokenStreamSink (e.g. a Redis pub/sub sink) via AgentModule.forRoot({ sink }) before running multi-pod, or drop dispatchedSteps to keep the turn in-process localSteps.");
|
|
668
668
|
}
|
|
669
669
|
return enabled;
|
|
670
670
|
}, "useFactory"),
|