@dudousxd/nestjs-agent 0.5.0 → 0.6.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.
@@ -114,12 +114,17 @@ interface AgentModuleOptions {
114
114
  durable?: boolean;
115
115
  /**
116
116
  * Dispatch the turn's model call and tool executions as routed durable steps
117
- * (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s. Requires
118
- * `durable: true` (module build throws otherwise). Multi-pod fleets MUST wire a cross-process
119
- * token sink (e.g. a Redis pub/sub `TokenStreamSink`) — the dispatched `llm` step streams from
120
- * whichever worker serves it, not necessarily the one running this workflow. STATIC top-level flag
121
- * (like `durable`/`attachments.upload`): it changes what gets registered and how the workflow
122
- * dispatches, decided at module build time.
117
+ * (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s.
118
+ * DEFAULT `true` under `durable: true` — dispatching moves the run off its pod during the two
119
+ * long steps (the correct production posture), and `AgentRunSteps` is always registered so the
120
+ * routed groups are never unserved. Set `false` to keep the turn's steps in-process localSteps.
121
+ * `true` without `durable: true` throws at module build.
122
+ *
123
+ * The cross-process-sink requirement is a property of `durable: true` itself, not of this flag:
124
+ * the turn already runs on whichever worker takes `agent.run`, which may not be the pod holding
125
+ * the SSE connection — multi-pod fleets MUST wire a cross-process token sink (e.g. a Redis
126
+ * pub/sub `TokenStreamSink`) either way. STATIC top-level flag (like `durable`/
127
+ * `attachments.upload`): it decides how the workflow dispatches at module build time.
123
128
  */
124
129
  dispatchedSteps?: boolean;
125
130
  /**
@@ -184,10 +189,12 @@ interface AgentModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
184
189
  */
185
190
  durable?: boolean;
186
191
  /**
187
- * Dispatch the turn's model call and tool executions as routed durable steps. Same static-wiring
188
- * reasoning as `durable` above — it lives here (not in the async factory result) because it decides
189
- * how `AgentRunWorkflow` builds its hooks at module build time. Requires `durable: true` (module
190
- * build throws otherwise). See `AgentModuleOptions.dispatchedSteps` for the full contract.
192
+ * Dispatch the turn's model call and tool executions as routed durable steps. DEFAULT `true`
193
+ * under `durable: true`; set `false` to keep the turn's steps in-process localSteps. Same
194
+ * static-wiring reasoning as `durable` above — it lives here (not in the async factory result)
195
+ * because it decides how `AgentRunWorkflow` builds its hooks at module build time. `true` without
196
+ * `durable: true` throws at module build. See `AgentModuleOptions.dispatchedSteps` for the full
197
+ * contract.
191
198
  */
192
199
  dispatchedSteps?: boolean;
193
200
  /**
@@ -114,12 +114,17 @@ interface AgentModuleOptions {
114
114
  durable?: boolean;
115
115
  /**
116
116
  * Dispatch the turn's model call and tool executions as routed durable steps
117
- * (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s. Requires
118
- * `durable: true` (module build throws otherwise). Multi-pod fleets MUST wire a cross-process
119
- * token sink (e.g. a Redis pub/sub `TokenStreamSink`) — the dispatched `llm` step streams from
120
- * whichever worker serves it, not necessarily the one running this workflow. STATIC top-level flag
121
- * (like `durable`/`attachments.upload`): it changes what gets registered and how the workflow
122
- * dispatches, decided at module build time.
117
+ * (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of in-process `ctx.localStep`s.
118
+ * DEFAULT `true` under `durable: true` — dispatching moves the run off its pod during the two
119
+ * long steps (the correct production posture), and `AgentRunSteps` is always registered so the
120
+ * routed groups are never unserved. Set `false` to keep the turn's steps in-process localSteps.
121
+ * `true` without `durable: true` throws at module build.
122
+ *
123
+ * The cross-process-sink requirement is a property of `durable: true` itself, not of this flag:
124
+ * the turn already runs on whichever worker takes `agent.run`, which may not be the pod holding
125
+ * the SSE connection — multi-pod fleets MUST wire a cross-process token sink (e.g. a Redis
126
+ * pub/sub `TokenStreamSink`) either way. STATIC top-level flag (like `durable`/
127
+ * `attachments.upload`): it decides how the workflow dispatches at module build time.
123
128
  */
124
129
  dispatchedSteps?: boolean;
125
130
  /**
@@ -184,10 +189,12 @@ interface AgentModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
184
189
  */
185
190
  durable?: boolean;
186
191
  /**
187
- * Dispatch the turn's model call and tool executions as routed durable steps. Same static-wiring
188
- * reasoning as `durable` above — it lives here (not in the async factory result) because it decides
189
- * how `AgentRunWorkflow` builds its hooks at module build time. Requires `durable: true` (module
190
- * build throws otherwise). See `AgentModuleOptions.dispatchedSteps` for the full contract.
192
+ * Dispatch the turn's model call and tool executions as routed durable steps. DEFAULT `true`
193
+ * under `durable: true`; set `false` to keep the turn's steps in-process localSteps. Same
194
+ * static-wiring reasoning as `durable` above — it lives here (not in the async factory result)
195
+ * because it decides how `AgentRunWorkflow` builds its hooks at module build time. `true` without
196
+ * `durable: true` throws at module build. See `AgentModuleOptions.dispatchedSteps` for the full
197
+ * contract.
191
198
  */
192
199
  dispatchedSteps?: boolean;
193
200
  /**