@open-cr-agent/runtime-direct 0.20.0 → 0.22.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/runtime.d.ts +1 -0
- package/dist/runtime.js +9 -4
- package/package.json +2 -2
package/dist/runtime.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface DirectRuntimeOptions extends RuntimeOptions {
|
|
|
4
4
|
}
|
|
5
5
|
export declare class DirectRuntime implements AgentRuntime {
|
|
6
6
|
readonly name = "direct";
|
|
7
|
+
readonly toolsets = true;
|
|
7
8
|
readonly sampling: AppliedSampling;
|
|
8
9
|
private readonly chains;
|
|
9
10
|
private readonly tools;
|
package/dist/runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainRunner, MAX_AGENT_STEPS, OcraError, parseModel, proxiedFetch, RESUME_MESSAGE, reviewTools, WRAP_UP_MESSAGE, WRAP_UP_STEPS, WRAP_UP_TOOLS, } from "@open-cr-agent/core";
|
|
1
|
+
import { ChainRunner, MAX_AGENT_STEPS, OcraError, parseModel, proxiedFetch, RESUME_MESSAGE, readTools, reviewTools, WRAP_UP_MESSAGE, WRAP_UP_STEPS, WRAP_UP_TOOLS, } from "@open-cr-agent/core";
|
|
2
2
|
import { anthropicWire } from "./anthropic.js";
|
|
3
3
|
import { EffortLedger } from "./effort.js";
|
|
4
4
|
import { runLoop } from "./loop.js";
|
|
@@ -12,6 +12,7 @@ import { SharedStarts } from "./shared-starts.js";
|
|
|
12
12
|
// runtime knows no other address to send code to.
|
|
13
13
|
export class DirectRuntime {
|
|
14
14
|
name = "direct";
|
|
15
|
+
toolsets = true;
|
|
15
16
|
// The chat completions protocol takes both settings; an agent on a
|
|
16
17
|
// Messages endpoint reports them as not applied.
|
|
17
18
|
sampling;
|
|
@@ -78,11 +79,15 @@ export class DirectRuntime {
|
|
|
78
79
|
system: spec.systemPrompt,
|
|
79
80
|
user: spec.userPrompt,
|
|
80
81
|
...(spec.sharedPrefixes ? { shared: spec.sharedPrefixes } : {}),
|
|
81
|
-
tools: this.tools,
|
|
82
|
+
tools: spec.toolset ? [...readTools, ...spec.toolset.tools] : this.tools,
|
|
82
83
|
context: spec.context,
|
|
83
84
|
maxSteps: MAX_AGENT_STEPS,
|
|
84
|
-
resume: RESUME_MESSAGE,
|
|
85
|
-
wrapUp: {
|
|
85
|
+
resume: spec.toolset?.resume ?? RESUME_MESSAGE,
|
|
86
|
+
wrapUp: {
|
|
87
|
+
message: spec.toolset?.wrapUp.message ?? WRAP_UP_MESSAGE,
|
|
88
|
+
tools: spec.toolset?.wrapUp.tools ?? WRAP_UP_TOOLS,
|
|
89
|
+
steps: WRAP_UP_STEPS,
|
|
90
|
+
},
|
|
86
91
|
timeoutMs: spec.timeoutMs,
|
|
87
92
|
signal,
|
|
88
93
|
onUsage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-cr-agent/runtime-direct",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Agent runtime for Open-CR-Agent that calls declared OpenAI-compatible and Anthropic endpoints directly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-review",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@anthropic-ai/sdk": "^1.12.0",
|
|
38
|
-
"@open-cr-agent/core": "0.
|
|
38
|
+
"@open-cr-agent/core": "0.22.0",
|
|
39
39
|
"zod": "^4.6.6"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|