bare-agent 0.10.1 → 0.10.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.
Files changed (2) hide show
  1. package/README.md +11 -4
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -101,17 +101,24 @@ Every piece works alone — take what you need, ignore the rest.
101
101
 
102
102
  ```js
103
103
  const { Gate } = require('bareguard');
104
- const { Loop } = require('bare-agent');
105
- const { wireGate } = require('bare-agent/bareguard');
104
+ const { Loop, wireGate, defaultActionTranslator } = require('bare-agent');
106
105
 
107
106
  const gate = new Gate({
108
107
  budget: { maxCostUsd: 0.50 },
109
- limits: { maxTurns: 20 },
108
+ limits: { maxToolRounds: 20 }, // bareguard 0.4.2+ — N tool rounds, LLM rounds bypass
110
109
  audit: { path: './audit.jsonl' },
111
110
  });
112
111
  await gate.init();
113
112
 
114
- const { policy, onLlmResult, onToolResult, filterTools } = wireGate(gate);
113
+ const { policy, onLlmResult, onToolResult, filterTools } = wireGate(gate, {
114
+ // Optional: translate tool names → bareguard primitive types for bash/fs/net rules.
115
+ // bareguard 0.4.1+ reads args.command / args.path verbatim, so args passes through.
116
+ actionTranslator: (toolName, args, ctx) => {
117
+ if (toolName === 'shell_exec') return { type: 'bash', args, _ctx: ctx };
118
+ if (toolName === 'shell_read') return { type: 'read', args, _ctx: ctx };
119
+ return defaultActionTranslator(toolName, args, ctx);
120
+ },
121
+ });
115
122
  const tools = await filterTools(myTools); // drop tools denied by static policy
116
123
 
117
124
  const loop = new Loop({ provider, policy, onLlmResult, onToolResult });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-agent",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "files": [
5
5
  "index.js",
6
6
  "src/",
@@ -46,7 +46,7 @@
46
46
  "governance"
47
47
  ],
48
48
  "dependencies": {
49
- "bareguard": "^0.2.0"
49
+ "bareguard": "^0.4.2"
50
50
  },
51
51
  "optionalDependencies": {
52
52
  "barebrowse": "^0.5.0",