@dudousxd/nestjs-agent 1.39.0 → 2.0.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.
Files changed (40) hide show
  1. package/README.md +14 -7
  2. package/dist/a2ui/index.cjs +1 -0
  3. package/dist/a2ui/index.cjs.map +1 -1
  4. package/dist/a2ui/index.d.cts +3 -2
  5. package/dist/a2ui/index.d.ts +3 -2
  6. package/dist/a2ui/index.js +2 -1
  7. package/dist/a2ui/index.js.map +1 -1
  8. package/dist/{chat-queue.service-YjiKVTKE.d.ts → chat-queue.service-BjPCw4Pf.d.ts} +104 -43
  9. package/dist/{chat-queue.service-fopUN313.d.cts → chat-queue.service-C49HIuEV.d.cts} +104 -43
  10. package/dist/durable/index.cjs +13572 -1754
  11. package/dist/durable/index.cjs.map +1 -1
  12. package/dist/durable/index.d.cts +6 -6
  13. package/dist/durable/index.d.ts +6 -6
  14. package/dist/durable/index.js +12228 -390
  15. package/dist/durable/index.js.map +1 -1
  16. package/dist/genui/index.cjs.map +1 -1
  17. package/dist/genui/index.d.cts +4 -6
  18. package/dist/genui/index.d.ts +4 -6
  19. package/dist/genui/index.js.map +1 -1
  20. package/dist/{index-BJFM1tG8.d.cts → index-BBkyvNUi.d.cts} +1 -1
  21. package/dist/{index-De98CGXa.d.ts → index-CRCbsO6E.d.ts} +1 -1
  22. package/dist/index.cjs +12408 -450
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +318 -18
  25. package/dist/index.d.ts +318 -18
  26. package/dist/index.js +12313 -346
  27. package/dist/index.js.map +1 -1
  28. package/dist/media/index.cjs +4 -9
  29. package/dist/media/index.cjs.map +1 -1
  30. package/dist/media/index.d.cts +14 -3
  31. package/dist/media/index.d.ts +14 -3
  32. package/dist/media/index.js +6 -11
  33. package/dist/media/index.js.map +1 -1
  34. package/dist/workflows/index.cjs +1496 -0
  35. package/dist/workflows/index.cjs.map +1 -0
  36. package/dist/workflows/index.d.cts +158 -0
  37. package/dist/workflows/index.d.ts +158 -0
  38. package/dist/workflows/index.js +1464 -0
  39. package/dist/workflows/index.js.map +1 -0
  40. package/package.json +39 -8
@@ -1,10 +1,11 @@
1
- import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, BufferedModelTurnResult, ToolStepEnvelope, AgentRunner, TokenStreamSink, AgentRunStartOptions, HumanReply } from '@dudousxd/nestjs-agent-core';
1
+ import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, ToolStepEnvelope, BufferedModelTurnResult, AgentRunner, TokenStreamSink, AgentRunStartOptions, HumanReply } from '@dudousxd/nestjs-agent-core';
2
2
  import { WorkflowService } from '@dudousxd/nestjs-durable';
3
3
  import { RunGateway, WorkflowCtx } from '@dudousxd/nestjs-durable-core';
4
- import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-fopUN313.cjs';
4
+ import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-C49HIuEV.cjs';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@dudousxd/nestjs-agent-core/genui';
7
7
  import '@standard-schema/spec';
8
+ import '@nestjs/ai';
8
9
  import '../genui/index.cjs';
9
10
 
10
11
  declare class AgentRunWorkflow {
@@ -116,6 +117,7 @@ interface DispatchedToolInput extends ToolStepEnvelope {
116
117
  sinkRunId?: string;
117
118
  childSink?: boolean;
118
119
  }
120
+
119
121
  /**
120
122
  * The two long steps every turn dispatches as routed remote steps (`AgentRunSteps.llm` /
121
123
  * `AgentRunSteps.tool`). Both re-resolve their deps from THIS worker's own DI via
@@ -135,7 +137,6 @@ declare class AgentRunSteps {
135
137
  * across however many turns/retries it takes.
136
138
  */
137
139
  llm(input: DispatchedLlmInput): Promise<BufferedModelTurnResult>;
138
- private runLlm;
139
140
  /**
140
141
  * NO DURABLE retries — a tool may not be idempotent (a bare `@Step()` carries none, unlike `llm`
141
142
  * above). What it does retry, in place, is a CLASSIFIED-TRANSIENT error from the tool's own
@@ -147,7 +148,6 @@ declare class AgentRunSteps {
147
148
  * ATTEMPT, so a retried invocation gets its own fresh timeout window.
148
149
  */
149
150
  tool(input: DispatchedToolInput): Promise<unknown>;
150
- private runTool;
151
151
  }
152
152
 
153
153
  /**
@@ -252,7 +252,7 @@ interface AgentDurableModuleOptions {
252
252
  surface?: AgentSurface;
253
253
  }
254
254
  /**
255
- * Opt-in durable runner. Import this alongside `AgentModule.forRoot({ durable: true })` and a
255
+ * Opt-in durable runner. Import this alongside `AgentModule.forRoot({ durable: { engine: 'aviary' } })` and a
256
256
  * configured `DurableModule`. It registers the `agent.run` workflow (discovered by DurableModule)
257
257
  * and exposes the durable runner via `AGENT_DURABLE_RUNNER`, which AgentModule binds to
258
258
  * `AGENT_RUNNER`. Forgetting this import makes AgentModule throw a clear error at boot.
@@ -281,7 +281,7 @@ declare class AgentDurableModule {
281
281
  * imports: [DurableModule.forRoot({ ... }), ...agentDurable({ model, store, defaultAgent })]
282
282
  * ```
283
283
  *
284
- * It wires `AgentModule.forRoot({ ...options, durable: true })` together with `AgentDurableModule`,
284
+ * It wires `AgentModule.forRoot({ ...options, durable: { engine: 'aviary' } })` together with `AgentDurableModule`,
285
285
  * the equivalent of importing both by hand. A configured `DurableModule` is still required. The
286
286
  * durable runner has no configuration of its own beyond the agent options, so `options` is exactly
287
287
  * `AgentModuleOptions` — including `surface`, which this helper threads to BOTH calls so a consumer
@@ -1,10 +1,11 @@
1
- import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, BufferedModelTurnResult, ToolStepEnvelope, AgentRunner, TokenStreamSink, AgentRunStartOptions, HumanReply } from '@dudousxd/nestjs-agent-core';
1
+ import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, ToolStepEnvelope, BufferedModelTurnResult, AgentRunner, TokenStreamSink, AgentRunStartOptions, HumanReply } from '@dudousxd/nestjs-agent-core';
2
2
  import { WorkflowService } from '@dudousxd/nestjs-durable';
3
3
  import { RunGateway, WorkflowCtx } from '@dudousxd/nestjs-durable-core';
4
- import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-YjiKVTKE.js';
4
+ import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-BjPCw4Pf.js';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@dudousxd/nestjs-agent-core/genui';
7
7
  import '@standard-schema/spec';
8
+ import '@nestjs/ai';
8
9
  import '../genui/index.js';
9
10
 
10
11
  declare class AgentRunWorkflow {
@@ -116,6 +117,7 @@ interface DispatchedToolInput extends ToolStepEnvelope {
116
117
  sinkRunId?: string;
117
118
  childSink?: boolean;
118
119
  }
120
+
119
121
  /**
120
122
  * The two long steps every turn dispatches as routed remote steps (`AgentRunSteps.llm` /
121
123
  * `AgentRunSteps.tool`). Both re-resolve their deps from THIS worker's own DI via
@@ -135,7 +137,6 @@ declare class AgentRunSteps {
135
137
  * across however many turns/retries it takes.
136
138
  */
137
139
  llm(input: DispatchedLlmInput): Promise<BufferedModelTurnResult>;
138
- private runLlm;
139
140
  /**
140
141
  * NO DURABLE retries — a tool may not be idempotent (a bare `@Step()` carries none, unlike `llm`
141
142
  * above). What it does retry, in place, is a CLASSIFIED-TRANSIENT error from the tool's own
@@ -147,7 +148,6 @@ declare class AgentRunSteps {
147
148
  * ATTEMPT, so a retried invocation gets its own fresh timeout window.
148
149
  */
149
150
  tool(input: DispatchedToolInput): Promise<unknown>;
150
- private runTool;
151
151
  }
152
152
 
153
153
  /**
@@ -252,7 +252,7 @@ interface AgentDurableModuleOptions {
252
252
  surface?: AgentSurface;
253
253
  }
254
254
  /**
255
- * Opt-in durable runner. Import this alongside `AgentModule.forRoot({ durable: true })` and a
255
+ * Opt-in durable runner. Import this alongside `AgentModule.forRoot({ durable: { engine: 'aviary' } })` and a
256
256
  * configured `DurableModule`. It registers the `agent.run` workflow (discovered by DurableModule)
257
257
  * and exposes the durable runner via `AGENT_DURABLE_RUNNER`, which AgentModule binds to
258
258
  * `AGENT_RUNNER`. Forgetting this import makes AgentModule throw a clear error at boot.
@@ -281,7 +281,7 @@ declare class AgentDurableModule {
281
281
  * imports: [DurableModule.forRoot({ ... }), ...agentDurable({ model, store, defaultAgent })]
282
282
  * ```
283
283
  *
284
- * It wires `AgentModule.forRoot({ ...options, durable: true })` together with `AgentDurableModule`,
284
+ * It wires `AgentModule.forRoot({ ...options, durable: { engine: 'aviary' } })` together with `AgentDurableModule`,
285
285
  * the equivalent of importing both by hand. A configured `DurableModule` is still required. The
286
286
  * durable runner has no configuration of its own beyond the agent options, so `options` is exactly
287
287
  * `AgentModuleOptions` — including `surface`, which this helper threads to BOTH calls so a consumer