@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/index.js
CHANGED
|
@@ -37,6 +37,7 @@ function keyValueOpenCodeSessionStore(kv, prefix = "aviary:opencode:session:") {
|
|
|
37
37
|
__name(keyValueOpenCodeSessionStore, "keyValueOpenCodeSessionStore");
|
|
38
38
|
|
|
39
39
|
// src/mcp.controller.ts
|
|
40
|
+
import { CanAnyone } from "@dudousxd/nestjs-agent-core";
|
|
40
41
|
import { Body, Controller, Delete, Get, Inject, Post, Req, Res } from "@nestjs/common";
|
|
41
42
|
|
|
42
43
|
// src/tokens.ts
|
|
@@ -133,6 +134,7 @@ _ts_decorate([
|
|
|
133
134
|
_ts_metadata("design:returntype", void 0)
|
|
134
135
|
], OpenCodeMcpController.prototype, "delete", null);
|
|
135
136
|
OpenCodeMcpController = _ts_decorate([
|
|
137
|
+
CanAnyone(),
|
|
136
138
|
Controller("opencode/mcp"),
|
|
137
139
|
_ts_param(0, Inject(OPENCODE_MCP_ENDPOINT)),
|
|
138
140
|
_ts_metadata("design:type", Function),
|
|
@@ -1882,7 +1884,7 @@ import { Inject as Inject3, Injectable as Injectable2 } from "@nestjs/common";
|
|
|
1882
1884
|
// src/turns.ts
|
|
1883
1885
|
import { randomUUID } from "crypto";
|
|
1884
1886
|
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";
|
|
1887
|
+
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
1888
|
import { Inject as Inject2, Injectable, Logger as Logger2, Optional } from "@nestjs/common";
|
|
1887
1889
|
|
|
1888
1890
|
// src/event-hub.ts
|
|
@@ -2996,6 +2998,12 @@ ${body}
|
|
|
2996
2998
|
kind: "cancelled"
|
|
2997
2999
|
}));
|
|
2998
3000
|
await writer.end();
|
|
3001
|
+
publishAgentRunCancelled({
|
|
3002
|
+
runId,
|
|
3003
|
+
threadId: input.threadId,
|
|
3004
|
+
durationMs,
|
|
3005
|
+
context: agentRunContext(input)
|
|
3006
|
+
});
|
|
2999
3007
|
await this.store.recordRunEnd?.({
|
|
3000
3008
|
runId,
|
|
3001
3009
|
status: "cancelled",
|
|
@@ -3026,12 +3034,16 @@ ${body}
|
|
|
3026
3034
|
this.logger.error(`agent run ${runId} failed: ${error}`);
|
|
3027
3035
|
publishAgentRunFailed({
|
|
3028
3036
|
runId,
|
|
3037
|
+
threadId: input.threadId,
|
|
3029
3038
|
code: "opencode_failed",
|
|
3030
|
-
message: error
|
|
3039
|
+
message: error,
|
|
3040
|
+
durationMs,
|
|
3041
|
+
context: agentRunContext(input)
|
|
3031
3042
|
});
|
|
3032
3043
|
await this.store.recordRunEnd?.({
|
|
3033
3044
|
runId,
|
|
3034
3045
|
status: "failed",
|
|
3046
|
+
durationMs,
|
|
3035
3047
|
errorCode: "opencode_failed",
|
|
3036
3048
|
errorMessage: error
|
|
3037
3049
|
});
|