@dudousxd/nestjs-agent-opencode 0.4.1 → 1.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.
- package/README.md +1 -1
- package/dist/durable/index.cjs +69 -57
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +14 -2
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +67 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/durable/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var InMemoryOpenCodeSessionStore = class {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// src/mcp.controller.ts
|
|
22
|
+
import { CanAnyone } from "@dudousxd/nestjs-agent-core";
|
|
22
23
|
import { Body, Controller, Delete, Get, Inject, Post, Req, Res } from "@nestjs/common";
|
|
23
24
|
|
|
24
25
|
// src/tokens.ts
|
|
@@ -115,6 +116,7 @@ _ts_decorate([
|
|
|
115
116
|
_ts_metadata("design:returntype", void 0)
|
|
116
117
|
], OpenCodeMcpController.prototype, "delete", null);
|
|
117
118
|
OpenCodeMcpController = _ts_decorate([
|
|
119
|
+
CanAnyone(),
|
|
118
120
|
Controller("opencode/mcp"),
|
|
119
121
|
_ts_param(0, Inject(OPENCODE_MCP_ENDPOINT)),
|
|
120
122
|
_ts_metadata("design:type", Function),
|
|
@@ -1864,7 +1866,7 @@ import { Inject as Inject3, Injectable as Injectable2 } from "@nestjs/common";
|
|
|
1864
1866
|
// src/turns.ts
|
|
1865
1867
|
import { randomUUID } from "crypto";
|
|
1866
1868
|
import { AGENT_CHAT_QUEUE } from "@dudousxd/nestjs-agent";
|
|
1867
|
-
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";
|
|
1869
|
+
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";
|
|
1868
1870
|
import { Inject as Inject2, Injectable, Logger as Logger2, Optional } from "@nestjs/common";
|
|
1869
1871
|
|
|
1870
1872
|
// src/event-hub.ts
|
|
@@ -2978,6 +2980,12 @@ ${body}
|
|
|
2978
2980
|
kind: "cancelled"
|
|
2979
2981
|
}));
|
|
2980
2982
|
await writer.end();
|
|
2983
|
+
publishAgentRunCancelled({
|
|
2984
|
+
runId,
|
|
2985
|
+
threadId: input.threadId,
|
|
2986
|
+
durationMs,
|
|
2987
|
+
context: agentRunContext(input)
|
|
2988
|
+
});
|
|
2981
2989
|
await this.store.recordRunEnd?.({
|
|
2982
2990
|
runId,
|
|
2983
2991
|
status: "cancelled",
|
|
@@ -3008,12 +3016,16 @@ ${body}
|
|
|
3008
3016
|
this.logger.error(`agent run ${runId} failed: ${error}`);
|
|
3009
3017
|
publishAgentRunFailed({
|
|
3010
3018
|
runId,
|
|
3019
|
+
threadId: input.threadId,
|
|
3011
3020
|
code: "opencode_failed",
|
|
3012
|
-
message: error
|
|
3021
|
+
message: error,
|
|
3022
|
+
durationMs,
|
|
3023
|
+
context: agentRunContext(input)
|
|
3013
3024
|
});
|
|
3014
3025
|
await this.store.recordRunEnd?.({
|
|
3015
3026
|
runId,
|
|
3016
3027
|
status: "failed",
|
|
3028
|
+
durationMs,
|
|
3017
3029
|
errorCode: "opencode_failed",
|
|
3018
3030
|
errorMessage: error
|
|
3019
3031
|
});
|