@dudousxd/nestjs-agent-opencode 0.4.1 → 0.5.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/index.js CHANGED
@@ -1882,7 +1882,7 @@ import { Inject as Inject3, Injectable as Injectable2 } from "@nestjs/common";
1882
1882
  // src/turns.ts
1883
1883
  import { randomUUID } from "crypto";
1884
1884
  import { AGENT_CHAT_QUEUE } from "@dudousxd/nestjs-agent";
1885
- import { AGENT_DEPS_FACTORY, AGENT_MEMORY, AGENT_OPTIONS, AGENT_PRICING_STORE, AGENT_SINK, AGENT_SKILLS, AGENT_STORE, AGENT_TOOL_REGISTRY, DEFAULT_MAX_FACT_CHARS, DefaultApprovalPolicy, ModelPriceResolver, RUN_ENDED_BEFORE_TOOL_CALL, actorScope, buildMemoryBlock, defaultScopeResolver, encodeStreamEvent as encodeStreamEvent2, memoryWriteVerdict, parseBedrockModelId, publishAgentRunFailed, releaseThreadRun, resolveMemoryDigest, resolveSkillCatalog, resolveUsageCost, streamFailure } from "@dudousxd/nestjs-agent-core";
1885
+ import { AGENT_DEPS_FACTORY, AGENT_MEMORY, AGENT_OPTIONS, AGENT_PRICING_STORE, AGENT_SINK, AGENT_SKILLS, AGENT_STORE, AGENT_TOOL_REGISTRY, DEFAULT_MAX_FACT_CHARS, DefaultApprovalPolicy, ModelPriceResolver, RUN_ENDED_BEFORE_TOOL_CALL, actorScope, agentRunContext, buildMemoryBlock, defaultScopeResolver, encodeStreamEvent as encodeStreamEvent2, memoryWriteVerdict, parseBedrockModelId, publishAgentRunCancelled, publishAgentRunFailed, releaseThreadRun, resolveMemoryDigest, resolveSkillCatalog, resolveUsageCost, streamFailure } from "@dudousxd/nestjs-agent-core";
1886
1886
  import { Inject as Inject2, Injectable, Logger as Logger2, Optional } from "@nestjs/common";
1887
1887
 
1888
1888
  // src/event-hub.ts
@@ -2996,6 +2996,12 @@ ${body}
2996
2996
  kind: "cancelled"
2997
2997
  }));
2998
2998
  await writer.end();
2999
+ publishAgentRunCancelled({
3000
+ runId,
3001
+ threadId: input.threadId,
3002
+ durationMs,
3003
+ context: agentRunContext(input)
3004
+ });
2999
3005
  await this.store.recordRunEnd?.({
3000
3006
  runId,
3001
3007
  status: "cancelled",
@@ -3026,12 +3032,16 @@ ${body}
3026
3032
  this.logger.error(`agent run ${runId} failed: ${error}`);
3027
3033
  publishAgentRunFailed({
3028
3034
  runId,
3035
+ threadId: input.threadId,
3029
3036
  code: "opencode_failed",
3030
- message: error
3037
+ message: error,
3038
+ durationMs,
3039
+ context: agentRunContext(input)
3031
3040
  });
3032
3041
  await this.store.recordRunEnd?.({
3033
3042
  runId,
3034
3043
  status: "failed",
3044
+ durationMs,
3035
3045
  errorCode: "opencode_failed",
3036
3046
  errorMessage: error
3037
3047
  });