bare-agent 0.44.0 → 0.44.2
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/package.json +1 -1
- package/primitives.json +5 -6
- package/src/provider-openai.js +1 -0
package/package.json
CHANGED
package/primitives.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "bare-agent",
|
|
3
|
-
"version": "0.44.0",
|
|
4
3
|
"primitives": [
|
|
5
4
|
{
|
|
6
5
|
"name": "AnthropicProvider",
|
|
@@ -106,7 +105,7 @@
|
|
|
106
105
|
"category": "tools",
|
|
107
106
|
"when": "you want a tool that queues an action to a JSONL file for an external waker (cron) to fire later — two-phase governance (emit-time + fire-time)",
|
|
108
107
|
"import": "import { createDeferTool } from 'bare-agent/tools'",
|
|
109
|
-
"signature": "createDeferTool(options?: object) => {tool:
|
|
108
|
+
"signature": "createDeferTool(options?: object) => {tool: ToolDef, readQueue: () => Promise<Record<string, any>[]>, queuePath: string}",
|
|
110
109
|
"fails": "returns {tool, readQueue, queuePath}; the inner action is re-gated at fire time when the waker runs. bareguard caps via defer.ratePerMinute.",
|
|
111
110
|
"example": "const { tool } = createDeferTool();\nconst loop = new Loop({ provider, tools: [tool] });"
|
|
112
111
|
},
|
|
@@ -142,7 +141,7 @@
|
|
|
142
141
|
"category": "tools",
|
|
143
142
|
"when": "you want an LLM-callable spawn tool so a model can fork child bareagents itself — governed per-family by bareguard",
|
|
144
143
|
"import": "import { createSpawnTool } from 'bare-agent/tools'",
|
|
145
|
-
"signature": "createSpawnTool(options?: object) => {tool:
|
|
144
|
+
"signature": "createSpawnTool(options?: object) => {tool: ToolDef, spawnChild: typeof spawnChild}",
|
|
146
145
|
"fails": "returns {tool, spawnChild}; the tool blocks per child and child stderr is re-emitted as child:stderr on the wired Stream.",
|
|
147
146
|
"example": "const { tool } = createSpawnTool();\nconst loop = new Loop({ provider, tools: [tool] });"
|
|
148
147
|
},
|
|
@@ -241,7 +240,7 @@
|
|
|
241
240
|
"category": "governance",
|
|
242
241
|
"when": "you want to surface a judge() verdict on a gate's audit/humanChannel via gate.annotate, keeping the render pure (it never calls the gate)",
|
|
243
242
|
"import": "import { judgeToAnnotation } from 'bare-agent'",
|
|
244
|
-
"signature": "judgeToAnnotation(verdict:
|
|
243
|
+
"signature": "judgeToAnnotation(verdict: JudgeVerdict | { verdict?: string, where?: any }, opts?: JudgeToAnnotationOptions) => Annotation",
|
|
245
244
|
"fails": "never throws and never calls the gate; surfaces fail-open (a non-honored verdict surfaces) and bounds fields against the sink's silent caps with a visible clip marker.",
|
|
246
245
|
"example": "gate.annotate(judgeToAnnotation(await judge({ request, artifact, provider })));"
|
|
247
246
|
},
|
|
@@ -259,7 +258,7 @@
|
|
|
259
258
|
"category": "integration",
|
|
260
259
|
"when": "you want to connect a litectx instance to a bareagent runner over the MCP bridge — a curated, child-db-local litectx server",
|
|
261
260
|
"import": "import { liteCtxMcpBridgeConfig } from 'bare-agent/tools'",
|
|
262
|
-
"signature": "liteCtxMcpBridgeConfig(opts: object) =>
|
|
261
|
+
"signature": "liteCtxMcpBridgeConfig(opts: object) => BridgeConfig",
|
|
263
262
|
"fails": "read-only by default (opt-in `writable` allows remember/forget); pre-seeding `now` makes createMCPBridge skip IDE discovery and connect straight to this server.",
|
|
264
263
|
"example": "const cfg = liteCtxMcpBridgeConfig({ root: './child.db' });\nconst { tools } = await createMCPBridge({ config: cfg });"
|
|
265
264
|
},
|
|
@@ -441,7 +440,7 @@
|
|
|
441
440
|
"import": "import { wireGate } from 'bare-agent'",
|
|
442
441
|
"signature": "wireGate(gate: Gate, options?: object) => {policy: Function, onLlmResult: Function, onToolResult: Function, filterTools: Function, wrapTool: Function, wrapTools: Function}",
|
|
443
442
|
"fails": "never throws; a gate halt surfaces as a HaltError the Loop catches and exits cleanly, and a deny is an advisory string fed back to the model.",
|
|
444
|
-
"example": "const { Gate } = require('bareguard');\nconst { Loop } = require('bare-agent');\nconst { wireGate } = require('bare-agent/bareguard');\n\nconst gate = new Gate({\n
|
|
443
|
+
"example": "const { Gate } = require('bareguard');\nconst { Loop } = require('bare-agent');\nconst { wireGate } = require('bare-agent/bareguard');\n\nconst gate = new Gate({\n budget: { maxCostUsd: 0.50 },\n limits: { maxTurns: 20 },\n audit: { path: './audit.jsonl' },\n});\nawait gate.init();\n\nconst { policy, onLlmResult, onToolResult, filterTools } = wireGate(gate);\nconst loop = new Loop({ provider, policy, onLlmResult, onToolResult });\nconst tools = await filterTools(myTools);\nawait loop.run(messages, tools);"
|
|
445
444
|
}
|
|
446
445
|
]
|
|
447
446
|
}
|
package/src/provider-openai.js
CHANGED
|
@@ -37,6 +37,7 @@ function toOpenAIToolChoice(choice) {
|
|
|
37
37
|
} catch {
|
|
38
38
|
describedChoice = '<unserializable>';
|
|
39
39
|
}
|
|
40
|
+
if (describedChoice === undefined) describedChoice = `<${typeof choice}>`;
|
|
40
41
|
throw new ProviderError(`[OpenAIProvider] invalid toolChoice: expected 'auto', 'required', or { name }, got ${describedChoice}`);
|
|
41
42
|
}
|
|
42
43
|
|