@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.
@@ -1,6 +1,6 @@
1
1
  import { LlmStepEnvelope, ModelTurnResult, ToolStepEnvelope, AgentStore, AgentRunInput, AgentRunner, Decision } from '@dudousxd/nestjs-agent-core';
2
2
  import { WorkflowCtx } from '@dudousxd/nestjs-durable-core';
3
- import { A as AgentDepsFactory, a as AgentModuleOptions } from '../agent-deps.factory-DGM0IVtA.cjs';
3
+ import { A as AgentDepsFactory, a as AgentModuleOptions } from '../agent-deps.factory-BlC9tumI.cjs';
4
4
  import { WorkflowService } from '@dudousxd/nestjs-durable';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
 
@@ -25,9 +25,9 @@ interface DispatchedLlmInput extends LlmStepEnvelope {
25
25
  childSink: boolean;
26
26
  }
27
27
  /**
28
- * The two long steps `AgentRunWorkflow` dispatches as routed remote steps when
29
- * `dispatchedSteps: true` (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of running them
30
- * in-process under `ctx.localStep`. Both re-resolve their deps from THIS worker's own DI via
28
+ * The two long steps `AgentRunWorkflow` dispatches as routed remote steps (`AgentRunSteps.llm` /
29
+ * `AgentRunSteps.tool`) — the default under `durable: true`; `dispatchedSteps: false` runs them
30
+ * in-process under `ctx.localStep` instead. Both re-resolve their deps from THIS worker's own DI via
31
31
  * `AGENT_DEPS_FACTORY.forAgent` — a step can be served by any worker in the fleet, not just the one
32
32
  * that started the run. Always provided by `AgentDurableModule` regardless of `dispatchedSteps`, so
33
33
  * the worker group is never orphaned.
@@ -51,14 +51,16 @@ declare class AgentRunSteps {
51
51
  }
52
52
 
53
53
  /**
54
- * The agent turn AS a durable workflow. Each model/tool call is a checkpointed `ctx.localStep` — the
55
- * in-process primitive, NOT the always-dispatched `ctx.step`: the loop's deps (model provider, store,
56
- * sink) live in THIS workflow worker's DI, and the step names are dynamic checkpoint identities
57
- * (`llm:0`, `persist:toolcall:<id>`), not routable worker groups. HITL is
58
- * `ctx.waitForSignal`, and sub-agent delegation is `ctx.child(AgentRunWorkflow)` — a replay-safe,
59
- * observable child run (it shows up as a node in the durable dashboard). A child streams into its
60
- * top-level ancestor's sink (`sinkRunId`) so the human watching the parent sees it and can approve
61
- * its action tools; the approval routes to the child's own run via `runForToolCall`.
54
+ * The agent turn AS a durable workflow. Persist/stream checkpoints are `ctx.localStep`s — the
55
+ * in-process primitive, NOT the always-dispatched `ctx.step`: their names are dynamic checkpoint
56
+ * identities (`persist:toolcall:<id>`), not routable worker groups, and their deps (store, sink)
57
+ * live in THIS workflow worker's DI. The two LONG steps (model call, tool execution) are dispatched
58
+ * through `AgentRunSteps` by default (`AGENT_DISPATCHED_STEPS`, ON under `durable: true`) so the
59
+ * run isn't pinned to this pod while they execute; `dispatchedSteps: false` keeps them localSteps
60
+ * too. HITL is `ctx.waitForSignal`, and sub-agent delegation is `ctx.child(AgentRunWorkflow)` — a
61
+ * replay-safe, observable child run (it shows up as a node in the durable dashboard). A child
62
+ * streams into its top-level ancestor's sink (`sinkRunId`) so the human watching the parent sees it
63
+ * and can approve its action tools; the approval routes to the child's own run via `runForToolCall`.
62
64
  */
63
65
  declare class AgentRunWorkflow {
64
66
  private readonly factory;
@@ -119,12 +121,12 @@ declare class AgentDurableModule {
119
121
  declare function agentDurable(options: AgentModuleOptions): DynamicModule[];
120
122
 
121
123
  /**
122
- * DI flag mirroring `AgentModuleOptions.dispatchedSteps`: whether `AgentRunWorkflow` dispatches its
124
+ * DI flag carrying the EFFECTIVE `dispatchedSteps` value: whether `AgentRunWorkflow` dispatches its
123
125
  * `llm`/`tool` steps as routed remote steps (`AgentRunSteps`) instead of in-process `ctx.localStep`s.
124
- * `AgentDurableModule` binds it from `AGENT_OPTIONS` (defaulting to `false`); `AgentRunWorkflow`
125
- * injects it. Kept in its own file — `AgentDurableModule` provides `AgentRunWorkflow` and
126
- * `AgentRunWorkflow` injects this token, so declaring it in either of those two files would make them
127
- * import each other.
126
+ * `AgentDurableModule` derives it from `AGENT_OPTIONS` (`durable === true && dispatchedSteps !==
127
+ * false` — default ON under durable); `AgentRunWorkflow` injects it. Kept in its own file —
128
+ * `AgentDurableModule` provides `AgentRunWorkflow` and `AgentRunWorkflow` injects this token, so
129
+ * declaring it in either of those two files would make them import each other.
128
130
  */
129
131
  declare const AGENT_DISPATCHED_STEPS: unique symbol;
130
132
 
@@ -1,6 +1,6 @@
1
1
  import { LlmStepEnvelope, ModelTurnResult, ToolStepEnvelope, AgentStore, AgentRunInput, AgentRunner, Decision } from '@dudousxd/nestjs-agent-core';
2
2
  import { WorkflowCtx } from '@dudousxd/nestjs-durable-core';
3
- import { A as AgentDepsFactory, a as AgentModuleOptions } from '../agent-deps.factory-DGM0IVtA.js';
3
+ import { A as AgentDepsFactory, a as AgentModuleOptions } from '../agent-deps.factory-BlC9tumI.js';
4
4
  import { WorkflowService } from '@dudousxd/nestjs-durable';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
 
@@ -25,9 +25,9 @@ interface DispatchedLlmInput extends LlmStepEnvelope {
25
25
  childSink: boolean;
26
26
  }
27
27
  /**
28
- * The two long steps `AgentRunWorkflow` dispatches as routed remote steps when
29
- * `dispatchedSteps: true` (`AgentRunSteps.llm` / `AgentRunSteps.tool`) instead of running them
30
- * in-process under `ctx.localStep`. Both re-resolve their deps from THIS worker's own DI via
28
+ * The two long steps `AgentRunWorkflow` dispatches as routed remote steps (`AgentRunSteps.llm` /
29
+ * `AgentRunSteps.tool`) — the default under `durable: true`; `dispatchedSteps: false` runs them
30
+ * in-process under `ctx.localStep` instead. Both re-resolve their deps from THIS worker's own DI via
31
31
  * `AGENT_DEPS_FACTORY.forAgent` — a step can be served by any worker in the fleet, not just the one
32
32
  * that started the run. Always provided by `AgentDurableModule` regardless of `dispatchedSteps`, so
33
33
  * the worker group is never orphaned.
@@ -51,14 +51,16 @@ declare class AgentRunSteps {
51
51
  }
52
52
 
53
53
  /**
54
- * The agent turn AS a durable workflow. Each model/tool call is a checkpointed `ctx.localStep` — the
55
- * in-process primitive, NOT the always-dispatched `ctx.step`: the loop's deps (model provider, store,
56
- * sink) live in THIS workflow worker's DI, and the step names are dynamic checkpoint identities
57
- * (`llm:0`, `persist:toolcall:<id>`), not routable worker groups. HITL is
58
- * `ctx.waitForSignal`, and sub-agent delegation is `ctx.child(AgentRunWorkflow)` — a replay-safe,
59
- * observable child run (it shows up as a node in the durable dashboard). A child streams into its
60
- * top-level ancestor's sink (`sinkRunId`) so the human watching the parent sees it and can approve
61
- * its action tools; the approval routes to the child's own run via `runForToolCall`.
54
+ * The agent turn AS a durable workflow. Persist/stream checkpoints are `ctx.localStep`s — the
55
+ * in-process primitive, NOT the always-dispatched `ctx.step`: their names are dynamic checkpoint
56
+ * identities (`persist:toolcall:<id>`), not routable worker groups, and their deps (store, sink)
57
+ * live in THIS workflow worker's DI. The two LONG steps (model call, tool execution) are dispatched
58
+ * through `AgentRunSteps` by default (`AGENT_DISPATCHED_STEPS`, ON under `durable: true`) so the
59
+ * run isn't pinned to this pod while they execute; `dispatchedSteps: false` keeps them localSteps
60
+ * too. HITL is `ctx.waitForSignal`, and sub-agent delegation is `ctx.child(AgentRunWorkflow)` — a
61
+ * replay-safe, observable child run (it shows up as a node in the durable dashboard). A child
62
+ * streams into its top-level ancestor's sink (`sinkRunId`) so the human watching the parent sees it
63
+ * and can approve its action tools; the approval routes to the child's own run via `runForToolCall`.
62
64
  */
63
65
  declare class AgentRunWorkflow {
64
66
  private readonly factory;
@@ -119,12 +121,12 @@ declare class AgentDurableModule {
119
121
  declare function agentDurable(options: AgentModuleOptions): DynamicModule[];
120
122
 
121
123
  /**
122
- * DI flag mirroring `AgentModuleOptions.dispatchedSteps`: whether `AgentRunWorkflow` dispatches its
124
+ * DI flag carrying the EFFECTIVE `dispatchedSteps` value: whether `AgentRunWorkflow` dispatches its
123
125
  * `llm`/`tool` steps as routed remote steps (`AgentRunSteps`) instead of in-process `ctx.localStep`s.
124
- * `AgentDurableModule` binds it from `AGENT_OPTIONS` (defaulting to `false`); `AgentRunWorkflow`
125
- * injects it. Kept in its own file — `AgentDurableModule` provides `AgentRunWorkflow` and
126
- * `AgentRunWorkflow` injects this token, so declaring it in either of those two files would make them
127
- * import each other.
126
+ * `AgentDurableModule` derives it from `AGENT_OPTIONS` (`durable === true && dispatchedSteps !==
127
+ * false` — default ON under durable); `AgentRunWorkflow` injects it. Kept in its own file —
128
+ * `AgentDurableModule` provides `AgentRunWorkflow` and `AgentRunWorkflow` injects this token, so
129
+ * declaring it in either of those two files would make them import each other.
128
130
  */
129
131
  declare const AGENT_DISPATCHED_STEPS: unique symbol;
130
132