@ouro.bot/cli 0.1.0-alpha.995 → 0.1.0-alpha.996
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,14 @@
|
|
|
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.996",
|
|
6
|
+
"changes": [
|
|
7
|
+
"A grep or glob of your whole home leaves out state/ (the runtime's own mail, sessions and logs) and says so at the end; pass path or cwd \"state\" to search it.",
|
|
8
|
+
"When grep stops at 100 matches it says how many there were in all (\"100 of 41,000 matches shown\"), so a capped search never reads as an absent fact.",
|
|
9
|
+
"The release gate now asks the Butler about his own home: he must list it and read his TACIT, and write nothing."
|
|
10
|
+
]
|
|
11
|
+
},
|
|
4
12
|
{
|
|
5
13
|
"version": "0.1.0-alpha.995",
|
|
6
14
|
"changes": [
|
|
@@ -652,6 +652,26 @@ export const CASES = [
|
|
|
652
652
|
]
|
|
653
653
|
},
|
|
654
654
|
},
|
|
655
|
+
{
|
|
656
|
+
// 0.1.0-alpha.994: every agent wakes with a home kit. He looks around his own home with ls and reads his own TACIT with
|
|
657
|
+
// read_file, by home-relative paths, and answers from what he saw. Read-only, so the run leaves nothing behind.
|
|
658
|
+
id: "home-kit",
|
|
659
|
+
words: "quick one about your own home, nothing online: what's at the top level of it, and how many lines long is your psyche/TACIT.md?",
|
|
660
|
+
sender: "principal",
|
|
661
|
+
delegated: false,
|
|
662
|
+
readback: ({ trace, reply, said }) => {
|
|
663
|
+
const text = String(said || reply || "")
|
|
664
|
+
const reads = trace.filter((entry) => entry.name === "read_file" && WROTE_TACIT.test(filePathOf(entry.args)))
|
|
665
|
+
const writes = trace.filter((entry) => /^(write_file|edit_file)$/.test(entry.name))
|
|
666
|
+
return [
|
|
667
|
+
check("he listed his home (ls)", callsNamed(trace, /^ls$/).length > 0, `${trace.length} tool calls`),
|
|
668
|
+
check("he read psyche/TACIT.md (read_file)", reads.length > 0),
|
|
669
|
+
check("the reply names what is at the top of his home (psyche)", /\bpsyche\b/i.test(text)),
|
|
670
|
+
check("the reply gives a line count", /\b\d+\s*lines?\b/i.test(text)),
|
|
671
|
+
check("nothing in his home was written", writes.length === 0, writes.map((entry) => filePathOf(entry.args)).join(", ")),
|
|
672
|
+
]
|
|
673
|
+
},
|
|
674
|
+
},
|
|
655
675
|
{
|
|
656
676
|
// 2026-10-11: the owner handed his chat to his wife and asked the Butler to say hi and interview her. It sent a title with no
|
|
657
677
|
// greeting, and later its own note about the brevity rules. A handoff gets a greeting and a question. The words name no
|
|
@@ -1420,6 +1440,12 @@ export function selfTestFixtures() {
|
|
|
1420
1440
|
pass: { trace: [], reply: "A movie is one film. A series has seasons of episodes.", before: emptyObservation(), after: emptyObservation() },
|
|
1421
1441
|
fail: { trace: [], reply: `## Difference\n**Movies**: ${"long ".repeat(130)}\nWant me to go on?`, before: emptyObservation(), after: emptyObservation() },
|
|
1422
1442
|
},
|
|
1443
|
+
"home-kit": {
|
|
1444
|
+
pass: { trace: [call("1", "ls", {}, "arc/\nfriends/\npsyche/\nstate/"), call("2", "read_file", { path: "psyche/TACIT.md" }, "rule one\nrule two")], reply: "arc, friends, psyche and state are up top. TACIT is 2 lines.", before: emptyObservation(), after: emptyObservation() },
|
|
1445
|
+
// Answering from memory, with no look around the home.
|
|
1446
|
+
fail: { trace: [], reply: "probably psyche and some config; TACIT is a few dozen lines.", before: emptyObservation(), after: emptyObservation() },
|
|
1447
|
+
failWrote: { trace: [call("1", "ls", {}, "psyche/"), call("2", "read_file", { path: "psyche/TACIT.md" }, "x"), call("3", "write_file", { path: "notes/home.md", content: "x" }, "ok")], reply: "psyche is up top; TACIT is 1 line.", before: emptyObservation(), after: emptyObservation() },
|
|
1448
|
+
},
|
|
1423
1449
|
"handoff-greeting": {
|
|
1424
1450
|
pass: { trace: [], reply: "hi! silly and cosy, or loud and dumb-fun tonight?", before: emptyObservation(), after: emptyObservation() },
|
|
1425
1451
|
failInventedName: { trace: [], reply: "hi Morgan! what are you in the mood for?", before: emptyObservation(), after: emptyObservation() },
|
|
@@ -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.996</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -71,6 +71,14 @@ function resolveLocalToolPath(targetPath, ctx) {
|
|
|
71
71
|
function homeOf(ctx) {
|
|
72
72
|
return ctx?.agentRoot ?? (0, identity_1.getAgentRoot)();
|
|
73
73
|
}
|
|
74
|
+
/** state/ holds the runtime's own data (mail, sessions, logs, saved tool output): a search of the whole home leaves it out and says so. */
|
|
75
|
+
const RUNTIME_DATA_DIR = "state";
|
|
76
|
+
function searchesWholeHome(target, home) {
|
|
77
|
+
return path.resolve(target) === path.resolve(home) && fs.statSync(path.join(home, RUNTIME_DATA_DIR), { throwIfNoEntry: false })?.isDirectory() === true;
|
|
78
|
+
}
|
|
79
|
+
function skippedStateNote(param) {
|
|
80
|
+
return `[skipped state/, the runtime's own data; pass ${param} "state" to search it]`;
|
|
81
|
+
}
|
|
74
82
|
/** Keep the whole lines that fit the line and character caps. A first line over the character cap is cut to it. */
|
|
75
83
|
function fitLines(lines) {
|
|
76
84
|
const kept = [];
|
|
@@ -296,7 +304,7 @@ exports.fileToolDefinitions = [
|
|
|
296
304
|
type: "function",
|
|
297
305
|
function: {
|
|
298
306
|
name: "glob",
|
|
299
|
-
description: "Find files in your home matching a glob pattern, sorted. Skips .git and
|
|
307
|
+
description: "Find files in your home matching a glob pattern, sorted. Skips .git, node_modules and, from the top of your home, state/, and shows at most 500 matches.",
|
|
300
308
|
parameters: {
|
|
301
309
|
type: "object",
|
|
302
310
|
properties: {
|
|
@@ -309,10 +317,14 @@ exports.fileToolDefinitions = [
|
|
|
309
317
|
},
|
|
310
318
|
handler: (a, ctx) => {
|
|
311
319
|
const cwd = a.cwd ? resolveLocalToolPath(a.cwd, ctx) : homeOf(ctx);
|
|
312
|
-
|
|
320
|
+
// A cwd the caller chose is searched as asked; only the default (the whole home) leaves state/ out.
|
|
321
|
+
const skipsState = !a.cwd && searchesWholeHome(cwd, cwd);
|
|
322
|
+
const ignore = [...tool_limits_1.SKIP_DIRS.map((d) => `**/${d}/**`), ...(skipsState ? [`${RUNTIME_DATA_DIR}/**`] : [])];
|
|
323
|
+
const matches = fg.globSync(a.pattern, { cwd, dot: true, ignore }).sort();
|
|
324
|
+
const note = skipsState ? [skippedStateNote("cwd")] : [];
|
|
313
325
|
if (matches.length <= LIST_CAP)
|
|
314
|
-
return matches.join("\n");
|
|
315
|
-
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 })].join("\n");
|
|
326
|
+
return [...matches, ...note].join("\n");
|
|
327
|
+
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");
|
|
316
328
|
},
|
|
317
329
|
summaryKeys: ["pattern", "cwd"],
|
|
318
330
|
},
|
|
@@ -321,7 +333,7 @@ exports.fileToolDefinitions = [
|
|
|
321
333
|
type: "function",
|
|
322
334
|
function: {
|
|
323
335
|
name: "grep",
|
|
324
|
-
description: "Search file contents in your home for a regex, with file path and line numbers; skips .git, node_modules
|
|
336
|
+
description: "Search file contents in your home for a regex, with file path and line numbers; skips .git, node_modules, binary files and, from the top of your home, state/. Shows at most 100 matches and says how many there were in all.",
|
|
325
337
|
parameters: {
|
|
326
338
|
type: "object",
|
|
327
339
|
properties: {
|
|
@@ -344,8 +356,11 @@ exports.fileToolDefinitions = [
|
|
|
344
356
|
const filesOnly = Boolean(a.files_only);
|
|
345
357
|
let matchCount = 0;
|
|
346
358
|
let stopped = false;
|
|
359
|
+
let totalMatches = 0;
|
|
347
360
|
const clipLine = (line) => line.length > GREP_MAX_LINE_CHARS ? `${line.slice(0, GREP_MAX_LINE_CHARS - 3)}...` : line;
|
|
348
361
|
const home = homeOf(ctx);
|
|
362
|
+
const skipsState = searchesWholeHome(targetPath, home);
|
|
363
|
+
const stateDir = path.join(home, RUNTIME_DATA_DIR);
|
|
349
364
|
// Paths inside the home are shown relative to it.
|
|
350
365
|
const shown = (filePath) => {
|
|
351
366
|
const relative = path.relative(home, filePath);
|
|
@@ -366,9 +381,13 @@ exports.fileToolDefinitions = [
|
|
|
366
381
|
for (let i = 0; i < lines.length; i++) {
|
|
367
382
|
if (!regex.test(lines[i]))
|
|
368
383
|
continue;
|
|
384
|
+
// Past the cap, matches are still counted so the notice can say how much was left unseen.
|
|
385
|
+
totalMatches++;
|
|
369
386
|
if (matchCount >= GREP_MAX_MATCHES) {
|
|
370
387
|
stopped = true;
|
|
371
|
-
|
|
388
|
+
if (filesOnly)
|
|
389
|
+
break;
|
|
390
|
+
continue;
|
|
372
391
|
}
|
|
373
392
|
matchCount++;
|
|
374
393
|
matchIndices.add(i);
|
|
@@ -402,7 +421,7 @@ exports.fileToolDefinitions = [
|
|
|
402
421
|
for (const entry of entries) {
|
|
403
422
|
const fullPath = path.join(dir, entry.name);
|
|
404
423
|
if (entry.isDirectory()) {
|
|
405
|
-
if (!tool_limits_1.SKIP_DIRS.includes(entry.name))
|
|
424
|
+
if (!tool_limits_1.SKIP_DIRS.includes(entry.name) && !(skipsState && fullPath === stateDir))
|
|
406
425
|
walk(fullPath);
|
|
407
426
|
}
|
|
408
427
|
else if (entry.isFile()) {
|
|
@@ -432,11 +451,11 @@ exports.fileToolDefinitions = [
|
|
|
432
451
|
const results = [];
|
|
433
452
|
for (const file of files) {
|
|
434
453
|
results.push(...searchFile(file));
|
|
435
|
-
if (stopped)
|
|
436
|
-
break;
|
|
437
454
|
}
|
|
438
455
|
if (stopped)
|
|
439
|
-
results.push((0, tool_limits_1.cutNotice)("grep", `[
|
|
456
|
+
results.push((0, tool_limits_1.cutNotice)("grep", `[${GREP_MAX_MATCHES} of ${totalMatches} ${filesOnly ? "files" : "matches"} shown; narrow the pattern or path]`, { pattern: a.pattern }));
|
|
457
|
+
if (skipsState)
|
|
458
|
+
results.push(skippedStateNote("path"));
|
|
440
459
|
return results.join("\n");
|
|
441
460
|
},
|
|
442
461
|
summaryKeys: ["pattern", "path", "include"],
|
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.996",
|
|
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.996",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@azure/identity": "^4.13.0",
|