@ouro.bot/cli 0.1.0-alpha.1214 → 0.1.0-alpha.1216
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,19 @@
|
|
|
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.1216",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The release gate passes --why when it sends its replay messages, so the CLI gate added in #1321 no longer refuses them and good releases can ship to Sanctuary again."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1215",
|
|
12
|
+
"changes": [
|
|
13
|
+
"The shelf check no longer warns about a book that the books CLI found, added or delivered in the same turn, and it never adds its warning to a reply that apologises for or corrects an earlier warning. When a library lookup ran but matched nothing, the warning now says so instead of claiming nothing was checked.",
|
|
14
|
+
"Update the Ouro UI files to Ouro UI v1.3.319."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
4
17
|
{
|
|
5
18
|
"version": "0.1.0-alpha.1214",
|
|
6
19
|
"changes": [
|
|
@@ -1871,7 +1871,7 @@ export function makeHost({ bundle = DEFAULT_BUNDLE, trustDir = DEFAULT_TRUST_DIR
|
|
|
1871
1871
|
}
|
|
1872
1872
|
},
|
|
1873
1873
|
async send({ who, text, delegated, context }) {
|
|
1874
|
-
const args = ["exec", "-u", "0", CONTAINER, "node", CLI_ENTRY, "a2a", "message", "--to", card, "--text", text, "--context", context, "--identity-file", identityFor(who), "--json", ...(delegated ? ["--delegated"] : [])]
|
|
1874
|
+
const args = ["exec", "-u", "0", CONTAINER, "node", CLI_ENTRY, "a2a", "message", "--to", card, "--text", text, "--context", context, "--why", `release gate replay: case context ${context}, sent as ${who}`, "--identity-file", identityFor(who), "--json", ...(delegated ? ["--delegated"] : [])]
|
|
1875
1875
|
try {
|
|
1876
1876
|
const out = exec("docker", args, { timeout: MESSAGE_TIMEOUT_MS })
|
|
1877
1877
|
const parsed = JSON.parse(out.trim().split("\n").at(-1))
|
|
@@ -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.1216</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -16,6 +16,11 @@ const NOT_A_CLAIM = /\bnot\b|n['’]t\b|\bno\s+longer\b|\bnever\b|\bif\b|\bwheth
|
|
|
16
16
|
const DENIAL_REACH_WORDS = 4;
|
|
17
17
|
const LIBRARY_LOOKUP_TOOLS = new Set(["media_search", "sanctuary_search_media_catalog"]);
|
|
18
18
|
const MIN_TITLE_LENGTH = 3;
|
|
19
|
+
/** The bundle's books CLI reading or changing the house book library: `./books get … --deliver`, `books library find …`. */
|
|
20
|
+
const BOOKS_COMMAND = /(?:^|[\s;&|(])(?:[\w.~/-]*\/)?books\s+(?:get|deliver|library\s+(?:find|add))\b/;
|
|
21
|
+
/** A reply about the gate's own line ("sorry, that note was wrong"): it corrects a disclosure, so it gets none of its own. */
|
|
22
|
+
const APOLOGY = /\b(?:sorry|apolog\w*|my\s+(?:mistake|bad)|ignore|disregard)\b|\bwas\s+wrong\b/i;
|
|
23
|
+
const DISCLOSURE_REF = /\bha(?:ve|d)n['’]?t\s+checked\s+the\s+library\b|\bcan['’]?t\s+promise\s+it['’]?s\s+on\s+the\s+shelf\b|\b(?:that|the|this)\s+(?:line|note|disclaimer|disclosure|warning)\b/i;
|
|
19
24
|
function normalize(text) {
|
|
20
25
|
return ` ${text.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/&/g, " and ").replace(/[^\p{L}\p{N}]+/gu, " ").trim()} `;
|
|
21
26
|
}
|
|
@@ -53,12 +58,37 @@ function titlesFrom(records) {
|
|
|
53
58
|
}
|
|
54
59
|
return { onShelf, offShelf: offShelf.filter((title) => !onShelf.some((found) => found.key === title.key)) };
|
|
55
60
|
}
|
|
61
|
+
/** True when a books CLI run this turn succeeded and, if it was a search, found something: the book library backs the claim. */
|
|
62
|
+
function bookLibraryBacked(records) {
|
|
63
|
+
return records.some((record) => {
|
|
64
|
+
if (record.name !== "shell" || !BOOKS_COMMAND.test(record.args.command ?? "") || /^error:/i.test(record.result.trim()))
|
|
65
|
+
return false;
|
|
66
|
+
let parsed;
|
|
67
|
+
try {
|
|
68
|
+
parsed = JSON.parse(record.result);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return record.result.trim().length > 0;
|
|
72
|
+
}
|
|
73
|
+
if (!parsed || typeof parsed !== "object")
|
|
74
|
+
return true;
|
|
75
|
+
const fields = parsed;
|
|
76
|
+
if (fields.ok === false)
|
|
77
|
+
return false;
|
|
78
|
+
const lists = ["results", "items", "books", "matches"].map((key) => fields[key]).filter(Array.isArray);
|
|
79
|
+
return lists.length === 0 || lists.some((list) => list.length > 0);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
56
82
|
/** Null when the reply's shelf claims are backed; otherwise the titles this turn's lookup showed missing (empty: nothing found). */
|
|
57
83
|
function unbackedClaim(answer, tools) {
|
|
58
84
|
const clauses = answer.split(/[.!?,;\n]+/);
|
|
59
85
|
const denied = (clause) => NOT_A_CLAIM.test(clause.slice(0, clause.search(SHELF_CLAIM)).trim().split(/\s+/).slice(-DENIAL_REACH_WORDS).join(" "));
|
|
60
86
|
if (!clauses.some((clause) => SHELF_CLAIM.test(clause) && !denied(clause)))
|
|
61
87
|
return null;
|
|
88
|
+
if (APOLOGY.test(answer) && DISCLOSURE_REF.test(answer))
|
|
89
|
+
return null;
|
|
90
|
+
if (bookLibraryBacked(tools))
|
|
91
|
+
return null;
|
|
62
92
|
// Titles count from everything but the denials, so "Dune isn't on the shelf" never reads as a claim about Dune.
|
|
63
93
|
const said = normalize(clauses.filter((clause) => !SHELF_CLAIM.test(clause) || !denied(clause)).join(" "));
|
|
64
94
|
const { onShelf, offShelf } = titlesFrom(tools);
|
|
@@ -80,9 +110,12 @@ function shelfClaimError(answer, tools) {
|
|
|
80
110
|
: "no library lookup this turn found what you named";
|
|
81
111
|
return `you said something is on the shelf, but ${why}. say "on the shelf" only for a title a lookup in this turn found there. otherwise say it plainly, like "I can check if we have it", or look it up first.`;
|
|
82
112
|
}
|
|
83
|
-
/** An unbacked shelf claim that survived its retry goes out with the truth in front: what the lookup showed missing, or that nothing was checked. */
|
|
113
|
+
/** An unbacked shelf claim that survived its retry goes out with the truth in front: what the lookup showed missing, that it found no match, or that nothing was checked. */
|
|
84
114
|
function withShelfDisclosure(answer, tools) {
|
|
85
115
|
const { missing } = unbackedClaim(answer, tools);
|
|
86
|
-
const
|
|
116
|
+
const looked = tools.some((record) => LIBRARY_LOOKUP_TOOLS.has(record.name));
|
|
117
|
+
const note = missing.length > 0 ? `My lookup shows ${missing.join(", ")} isn't on the shelf.`
|
|
118
|
+
: looked ? "My library lookup didn't find that, so I can't promise it's on the shelf."
|
|
119
|
+
: "I haven't checked the library for that yet, so I can't promise it's on the shelf.";
|
|
87
120
|
return `${note}\n\n${answer}`;
|
|
88
121
|
}
|
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.1216",
|
|
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.1216",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|