@ouro.bot/cli 0.1.0-alpha.1114 → 0.1.0-alpha.1115
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.1115",
|
|
6
|
+
"changes": [
|
|
7
|
+
"An issue drain can list `ignoredLabels` (for example `agent:drain`): adding or removing one of those labels no longer wakes the drain. Labels starting with `drain:` stay ignored as before, and any other label still wakes it."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1114",
|
|
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.1115</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
package/dist/heart/identity.js
CHANGED
|
@@ -188,7 +188,7 @@ function normalizeIssueDrains(rawSense, configFile) {
|
|
|
188
188
|
const seen = new Set();
|
|
189
189
|
result.issueDrains = issueDrains.map((entry, index) => {
|
|
190
190
|
const item = (entry && typeof entry === "object" ? entry : {});
|
|
191
|
-
const { repo, session, account, ignoredBodyTrailers } = item;
|
|
191
|
+
const { repo, session, account, ignoredBodyTrailers, ignoredLabels } = item;
|
|
192
192
|
if (typeof repo !== "string" || !/^[\w.-]+\/[\w.-]+$/.test(repo))
|
|
193
193
|
fail(`issueDrains[${index}].repo must be "owner/name"`);
|
|
194
194
|
if (typeof session !== "string" || !session.trim())
|
|
@@ -198,6 +198,9 @@ function normalizeIssueDrains(rawSense, configFile) {
|
|
|
198
198
|
if (ignoredBodyTrailers !== undefined && (!Array.isArray(ignoredBodyTrailers) || ignoredBodyTrailers.some(key => typeof key !== "string" || !/^[\w][\w -]*$/.test(key.trim())))) {
|
|
199
199
|
fail(`issueDrains[${index}].ignoredBodyTrailers must be an array of trailer keys such as "Active-at"`);
|
|
200
200
|
}
|
|
201
|
+
if (ignoredLabels !== undefined && (!Array.isArray(ignoredLabels) || ignoredLabels.some(name => typeof name !== "string" || !name.trim()))) {
|
|
202
|
+
fail(`issueDrains[${index}].ignoredLabels must be an array of label names such as "agent:drain"`);
|
|
203
|
+
}
|
|
201
204
|
if (seen.has(repo))
|
|
202
205
|
fail(`issueDrains[${index}].repo ${repo} is listed twice`);
|
|
203
206
|
seen.add(repo);
|
|
@@ -206,6 +209,7 @@ function normalizeIssueDrains(rawSense, configFile) {
|
|
|
206
209
|
session: session.trim(),
|
|
207
210
|
...(account !== undefined ? { account: account.trim() } : {}),
|
|
208
211
|
...(ignoredBodyTrailers !== undefined ? { ignoredBodyTrailers: ignoredBodyTrailers.map(key => key.trim()) } : {}),
|
|
212
|
+
...(ignoredLabels !== undefined ? { ignoredLabels: ignoredLabels.map(name => name.trim()) } : {}),
|
|
209
213
|
};
|
|
210
214
|
});
|
|
211
215
|
}
|
|
@@ -50,10 +50,17 @@ function bodyWithoutTrailers(body, keys) {
|
|
|
50
50
|
const digestOf = (issue, keys) => (0, node_crypto_1.createHash)("sha1").update(`${issue.title}\n${bodyWithoutTrailers(issue.body ?? "", keys)}`).digest("hex").slice(0, 16);
|
|
51
51
|
/** The drain's own status comment: the marker, written by the polling account. Its creation and every edit are skipped. */
|
|
52
52
|
const ownStatus = (comment, login) => comment.user?.login?.toLowerCase() === login.toLowerCase() && !!comment.body?.includes(exports.DRAIN_STATUS_MARKER);
|
|
53
|
-
/** A reopen, or a label
|
|
54
|
-
const newsEvent = (event) =>
|
|
53
|
+
/** A reopen, or a change to a label that is neither in the drain's namespace nor on its ignored list. Closes, assignments and mentions are not news. */
|
|
54
|
+
const newsEvent = (event, ignoredLabels) => {
|
|
55
|
+
if (event.event === "reopened")
|
|
56
|
+
return true;
|
|
57
|
+
if (event.event !== "labeled" && event.event !== "unlabeled")
|
|
58
|
+
return false;
|
|
59
|
+
const name = (event.label?.name ?? "").toLowerCase();
|
|
60
|
+
return !name.startsWith(exports.DRAIN_LABEL_PREFIX) && !ignoredLabels.includes(name);
|
|
61
|
+
};
|
|
55
62
|
/** Whether anyone but the drain changed the issue since `before`: a new issue, an edit, another comment, a reopen or a label outside the drain's own. */
|
|
56
|
-
async function changedByOthers(api, repo, issue, before, digest, ignored) {
|
|
63
|
+
async function changedByOthers(api, repo, issue, before, digest, ignored, ignoredLabels) {
|
|
57
64
|
if (!before)
|
|
58
65
|
return true;
|
|
59
66
|
if (before.digest && (before.ignored ?? "") === ignored && before.digest !== digest)
|
|
@@ -63,7 +70,7 @@ async function changedByOthers(api, repo, issue, before, digest, ignored) {
|
|
|
63
70
|
if (comments.some(comment => !ownStatus(comment, api.login)))
|
|
64
71
|
return true;
|
|
65
72
|
const events = (await api.issueEvents(repo, issue.number)).filter(event => event.created_at > since);
|
|
66
|
-
return events.some(newsEvent);
|
|
73
|
+
return events.some(event => newsEvent(event, ignoredLabels));
|
|
67
74
|
}
|
|
68
75
|
/** Poll one drain's repository, record what changed, then wake its session once with the whole batch. */
|
|
69
76
|
async function pollDrain(drain, states, save, deps) {
|
|
@@ -74,6 +81,7 @@ async function pollDrain(drain, states, save, deps) {
|
|
|
74
81
|
const issues = await api.openIssues(drain.repo);
|
|
75
82
|
const trailers = drain.ignoredBodyTrailers ?? [];
|
|
76
83
|
const ignored = trailers.join(",");
|
|
84
|
+
const labels = (drain.ignoredLabels ?? []).map(name => name.toLowerCase());
|
|
77
85
|
const seen = {};
|
|
78
86
|
const recorded = [];
|
|
79
87
|
for (const issue of issues) {
|
|
@@ -83,7 +91,7 @@ async function pollDrain(drain, states, save, deps) {
|
|
|
83
91
|
seen[key] = { updatedAt: issue.updated_at, digest, ...(ignored ? { ignored } : {}) };
|
|
84
92
|
if (!state.seeded || before?.updatedAt === issue.updated_at)
|
|
85
93
|
continue;
|
|
86
|
-
if (await changedByOthers(api, drain.repo, issue, before, digest, ignored))
|
|
94
|
+
if (await changedByOthers(api, drain.repo, issue, before, digest, ignored, labels))
|
|
87
95
|
recorded.push({ number: issue.number, title: issue.title, updatedAt: issue.updated_at });
|
|
88
96
|
}
|
|
89
97
|
for (const [key, entry] of Object.entries(state.seen)) {
|
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.1115",
|
|
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.1115",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|