@ouro.bot/cli 0.1.0-alpha.1305 → 0.1.0-alpha.1306
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/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1306",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The six file tools (read_file, write_file, edit_file, ls, glob, grep) have Ouro AX cards, and edit_file's refusals end with a code: read-first, no-match or ambiguous-match. read_file, ls, glob and grep now state a low-risk profile, so a turn's tool receipt no longer counts a successful call to them as a side effect."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1305",
|
|
6
12
|
"changes": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0"?>
|
|
2
2
|
<Container version="2">
|
|
3
3
|
<Name>ouro-butler</Name>
|
|
4
|
-
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1306</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -43,6 +43,8 @@ const scrutiny_1 = require("../mind/scrutiny");
|
|
|
43
43
|
const tools_base_1 = require("./tools-base");
|
|
44
44
|
const guardrails_1 = require("./guardrails");
|
|
45
45
|
const tool_limits_1 = require("./tool-limits");
|
|
46
|
+
/** The profile of a file tool that only reads, so a card can say `read`; it is the dispatcher's own default. */
|
|
47
|
+
const READS_ONLY = { mutates: "none", risk: "low" };
|
|
46
48
|
const LIST_CAP = 500;
|
|
47
49
|
const GREP_MAX_MATCHES = 100;
|
|
48
50
|
const GREP_MAX_LINE_CHARS = 500;
|
|
@@ -167,6 +169,11 @@ exports.fileToolDefinitions = [
|
|
|
167
169
|
return `${text}\n${(0, tool_limits_1.cutNotice)("read_file", `[lines ${start + 1}-${last} of ${lines.length} shown; read on with offset=${last + 1}]`, { path: resolvedPath })}`;
|
|
168
170
|
},
|
|
169
171
|
summaryKeys: ["path"],
|
|
172
|
+
riskProfile: READS_ONLY,
|
|
173
|
+
ax: { id: "tool:read_file", group: "turn-files", when: "Pick this to see a file's exact text before you quote or change it; to find which file holds something, grep or glob first.", effect: "read", idempotent: true, errors: [
|
|
174
|
+
{ code: "guardrail-blocked", means: "The path is inside the folder holding the sync key, which no tool may read, or the path can't be resolved (a link loop or a folder you can't open).", fix: "Read a file outside that folder; for a path that won't resolve, check it with ls first." },
|
|
175
|
+
{ code: "invalid-arguments", means: "path is missing, or offset, limit or char_offset isn't a number.", fix: "Call read_file again with path as text and offset, limit and char_offset as numbers." },
|
|
176
|
+
] },
|
|
170
177
|
},
|
|
171
178
|
{
|
|
172
179
|
tool: {
|
|
@@ -193,6 +200,11 @@ exports.fileToolDefinitions = [
|
|
|
193
200
|
},
|
|
194
201
|
summaryKeys: ["path"],
|
|
195
202
|
riskProfile: { mutates: "durable_state_write", risk: "high", reason: "writes file contents" },
|
|
203
|
+
ax: { id: "tool:write_file", group: "turn-files", when: "Pick this to create a new file or replace one whole; for a change to part of an existing file, edit_file is safer and smaller.", effect: "write", destructive: true, idempotent: true, errors: [
|
|
204
|
+
{ code: "guardrail-blocked", means: "The path is protected (such as agent.json, state/policy, .git, friends/, product/ or a psyche file), or this person may only have you write inside your home.", fix: "Pass an absolute path under your home that isn't protected; a psyche file changes only when your owner asks in your own chat." },
|
|
205
|
+
{ code: "orientation-hold", means: "This turn is on a correction hold, so writes wait until you know what the person meant.", fix: "Call orientation_get, settle the correction, then write the file if it is still right." },
|
|
206
|
+
{ code: "invalid-arguments", means: "path or content is missing or isn't text.", fix: "Call write_file again with path and the whole new content as text." },
|
|
207
|
+
] },
|
|
196
208
|
},
|
|
197
209
|
{
|
|
198
210
|
tool: {
|
|
@@ -214,7 +226,7 @@ exports.fileToolDefinitions = [
|
|
|
214
226
|
handler: (a, ctx) => {
|
|
215
227
|
const resolvedPath = resolveLocalToolPath(a.path, ctx);
|
|
216
228
|
if (!tools_base_1.editFileReadTracker.has(resolvedPath)) {
|
|
217
|
-
return `error: you must read the file with read_file before editing it. call read_file on ${a.path} first
|
|
229
|
+
return (0, tools_base_1.withCode)(`error: you must read the file with read_file before editing it. call read_file on ${a.path} first.`, "read-first");
|
|
218
230
|
}
|
|
219
231
|
// Check staleness before editing
|
|
220
232
|
const stalenessCheck = file_state_1.fileStateCache.isStale(resolvedPath);
|
|
@@ -236,10 +248,10 @@ exports.fileToolDefinitions = [
|
|
|
236
248
|
searchFrom = idx + 1;
|
|
237
249
|
}
|
|
238
250
|
if (occurrences.length === 0) {
|
|
239
|
-
return `error: old_string not found in ${a.path}
|
|
251
|
+
return (0, tools_base_1.withCode)(`error: old_string not found in ${a.path}`, "no-match");
|
|
240
252
|
}
|
|
241
253
|
if (occurrences.length > 1) {
|
|
242
|
-
return `error: old_string is ambiguous -- found ${occurrences.length} matches in ${a.path}. provide more context to make the match unique
|
|
254
|
+
return (0, tools_base_1.withCode)(`error: old_string is ambiguous -- found ${occurrences.length} matches in ${a.path}. provide more context to make the match unique.`, "ambiguous-match");
|
|
243
255
|
}
|
|
244
256
|
// Single unique match -- replace
|
|
245
257
|
const idx = occurrences[0];
|
|
@@ -276,6 +288,13 @@ exports.fileToolDefinitions = [
|
|
|
276
288
|
},
|
|
277
289
|
summaryKeys: ["path"],
|
|
278
290
|
riskProfile: { mutates: "durable_state_write", risk: "high", reason: "edits file contents" },
|
|
291
|
+
ax: { id: "tool:edit_file", group: "turn-files", when: "Pick this to change one exact passage of a file you have read; write_file is for new files and full rewrites.", effect: "write", errors: [
|
|
292
|
+
{ code: "read-first", means: "You haven't read this file with read_file yet, so the edit was refused.", fix: "Call read_file on the same path, then send the edit again." },
|
|
293
|
+
{ code: "no-match", means: "old_string appears nowhere in the file, often because whitespace or an earlier edit differs.", fix: "Read the file again and copy old_string from it exactly, indentation included." },
|
|
294
|
+
{ code: "ambiguous-match", means: "old_string appears more than once, so the edit can't tell which place you mean.", fix: "Add surrounding lines to old_string until it matches one place only." },
|
|
295
|
+
{ code: "guardrail-blocked", means: "The path is protected (such as agent.json, state/policy, .git or a psyche file), or this person may only have you edit inside your home.", fix: "Pass an absolute path under your home that isn't protected; a psyche file changes only when your owner asks in your own chat." },
|
|
296
|
+
{ code: "orientation-hold", means: "This turn is on a correction hold, so edits wait until you know what the person meant.", fix: "Call orientation_get, settle the correction, then make the edit if it is still right." },
|
|
297
|
+
] },
|
|
279
298
|
},
|
|
280
299
|
{
|
|
281
300
|
tool: {
|
|
@@ -298,6 +317,11 @@ exports.fileToolDefinitions = [
|
|
|
298
317
|
return lines.length > 0 ? lines.join("\n") : "(empty)";
|
|
299
318
|
},
|
|
300
319
|
summaryKeys: ["path"],
|
|
320
|
+
riskProfile: READS_ONLY,
|
|
321
|
+
ax: { id: "tool:ls", group: "turn-files", when: "Pick this to see what one folder holds, with sizes; to find files by name pattern across many folders, glob is faster.", effect: "read", idempotent: true, errors: [
|
|
322
|
+
{ code: "guardrail-blocked", means: "That folder holds the sync key, which no tool may list, or the path can't be resolved.", fix: "List a different folder; nothing in that one is meant for you." },
|
|
323
|
+
{ code: "invalid-arguments", means: "path isn't text.", fix: "Call ls again with path as a folder name, or with no path to list your home." },
|
|
324
|
+
] },
|
|
301
325
|
},
|
|
302
326
|
{
|
|
303
327
|
tool: {
|
|
@@ -327,6 +351,11 @@ exports.fileToolDefinitions = [
|
|
|
327
351
|
return [...matches.slice(0, LIST_CAP), (0, tool_limits_1.cutNotice)("glob", `[${LIST_CAP} of ${matches.length} matches shown; narrow the pattern or cwd]`, { pattern: a.pattern }), ...note].join("\n");
|
|
328
352
|
},
|
|
329
353
|
summaryKeys: ["pattern", "cwd"],
|
|
354
|
+
riskProfile: READS_ONLY,
|
|
355
|
+
ax: { id: "tool:glob", group: "turn-files", when: "Pick this to find files by name pattern, such as every Markdown file under notes; to search inside files, use grep.", effect: "read", idempotent: true, errors: [
|
|
356
|
+
{ code: "guardrail-blocked", means: "The pattern or cwd reaches into the folder holding the sync key, or cwd can't be resolved.", fix: "Narrow cwd or the pattern so the search stays out of that folder." },
|
|
357
|
+
{ code: "invalid-arguments", means: "pattern is missing, or cwd isn't text.", fix: "Call glob again with pattern set, such as **/*.md, and cwd as a folder name if you want one." },
|
|
358
|
+
] },
|
|
330
359
|
},
|
|
331
360
|
{
|
|
332
361
|
tool: {
|
|
@@ -459,5 +488,10 @@ exports.fileToolDefinitions = [
|
|
|
459
488
|
return results.join("\n");
|
|
460
489
|
},
|
|
461
490
|
summaryKeys: ["pattern", "path", "include"],
|
|
491
|
+
riskProfile: READS_ONLY,
|
|
492
|
+
ax: { id: "tool:grep", group: "turn-files", when: "Pick this to learn which files and lines contain some text or regex; then read_file shows a match in full.", effect: "read", idempotent: true, errors: [
|
|
493
|
+
{ code: "guardrail-blocked", means: "The search path is, or contains, the folder holding the sync key, or it can't be resolved.", fix: "Pass a narrower path that leaves that folder out." },
|
|
494
|
+
{ code: "invalid-arguments", means: "pattern is missing, or context_lines, ignore_case or files_only has the wrong type.", fix: "Call grep again with pattern as text, context_lines as a number and the flags as true or false." },
|
|
495
|
+
] },
|
|
462
496
|
},
|
|
463
497
|
];
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1306",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ouro.bot/cli",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.1306",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|