@dudousxd/nestjs-agent 0.5.0 → 0.7.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-DGM0IVtA.d.cts → agent-deps.factory-BlC9tumI.d.cts} +17 -10
- package/dist/{agent-deps.factory-DGM0IVtA.d.ts → agent-deps.factory-BlC9tumI.d.ts} +17 -10
- package/dist/durable/index.cjs +320 -232
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +19 -17
- package/dist/durable/index.d.ts +19 -17
- package/dist/durable/index.js +240 -152
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +313 -226
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -9
- package/dist/index.d.ts +48 -9
- package/dist/index.js +230 -144
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/durable/index.d.cts
CHANGED
|
@@ -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-
|
|
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
|
|
29
|
-
* `
|
|
30
|
-
* in-process under `ctx.localStep
|
|
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.
|
|
55
|
-
* in-process primitive, NOT the always-dispatched `ctx.step`:
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
|
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`
|
|
125
|
-
* injects it. Kept in its own file —
|
|
126
|
-
* `AgentRunWorkflow` injects this token, so
|
|
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
|
|
package/dist/durable/index.d.ts
CHANGED
|
@@ -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-
|
|
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
|
|
29
|
-
* `
|
|
30
|
-
* in-process under `ctx.localStep
|
|
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.
|
|
55
|
-
* in-process primitive, NOT the always-dispatched `ctx.step`:
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
|
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`
|
|
125
|
-
* injects it. Kept in its own file —
|
|
126
|
-
* `AgentRunWorkflow` injects this token, so
|
|
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
|
|