@ouro.bot/cli 0.1.0-alpha.1080 → 0.1.0-alpha.1083
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.1083",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The prompt's skills list shows each skill's own 'i use this when…' sentence (or frontmatter description), so a question a skill covers is answered with it, not from whatever the prompt already holds"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1080",
|
|
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.1083</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/mind/prompt.js
CHANGED
|
@@ -70,6 +70,7 @@ const core_1 = require("../heart/core");
|
|
|
70
70
|
const ouro_version_manager_1 = require("../heart/versioning/ouro-version-manager");
|
|
71
71
|
const tools_1 = require("../repertoire/tools");
|
|
72
72
|
const skills_1 = require("../repertoire/skills");
|
|
73
|
+
const skill_summaries_1 = require("../repertoire/skill-summaries");
|
|
73
74
|
const identity_1 = require("../heart/identity");
|
|
74
75
|
const runtime_cwd_1 = require("../heart/runtime-cwd");
|
|
75
76
|
const config_1 = require("../heart/config");
|
|
@@ -850,7 +851,17 @@ function skillsSection() {
|
|
|
850
851
|
const names = (0, skills_1.listSkills)() || [];
|
|
851
852
|
if (!names.length)
|
|
852
853
|
return "";
|
|
853
|
-
|
|
854
|
+
const when = (0, skill_summaries_1.skillWhenLines)(names);
|
|
855
|
+
if (!when.size)
|
|
856
|
+
return `## my skills (use load_skill to activate)\n${names.join(", ")}`;
|
|
857
|
+
// A question one of these covers is answered with the skill, not from what this prompt already holds.
|
|
858
|
+
const described = names.filter((name) => when.has(name)).map((name) => `- ${name}: ${when.get(name)}`);
|
|
859
|
+
const rest = names.filter((name) => !when.has(name));
|
|
860
|
+
return [
|
|
861
|
+
"## my skills (use load_skill to activate; when a question matches one, i load it and follow it before answering)",
|
|
862
|
+
...described,
|
|
863
|
+
...(rest.length ? [`also: ${rest.join(", ")}`] : []),
|
|
864
|
+
].join("\n");
|
|
854
865
|
}
|
|
855
866
|
function toolContractsSection(channel, options) {
|
|
856
867
|
const lines = [
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.whenLine = whenLine;
|
|
37
|
+
exports.skillWhenLines = skillWhenLines;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const identity_1 = require("../heart/identity");
|
|
41
|
+
const runtime_1 = require("../nerves/runtime");
|
|
42
|
+
const MAX_WHEN_LENGTH = 220;
|
|
43
|
+
/**
|
|
44
|
+
* The sentence a skill uses to say when it applies: a frontmatter `description:`, else the first line that starts
|
|
45
|
+
* "i use this when", "use this when" or "use when". Shown beside the skill's name in the prompt, so a question that
|
|
46
|
+
* a skill covers is answered with the skill rather than from whatever the prompt already holds.
|
|
47
|
+
*/
|
|
48
|
+
function whenLine(markdown) {
|
|
49
|
+
const lines = markdown.split(/\r?\n/);
|
|
50
|
+
let body = lines;
|
|
51
|
+
if (lines[0]?.trim() === "---") {
|
|
52
|
+
const end = lines.indexOf("---", 1);
|
|
53
|
+
if (end > 0) {
|
|
54
|
+
const description = lines.slice(1, end).find((line) => /^description:\s*\S/i.test(line));
|
|
55
|
+
if (description)
|
|
56
|
+
return clip(description.replace(/^description:\s*/i, "").replace(/^["']|["']$/g, ""));
|
|
57
|
+
body = lines.slice(end + 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const line = body.map((l) => l.trim()).find((l) => /^(i |we )?use (this|it|me) when\b|^use when\b/i.test(l));
|
|
61
|
+
return line ? clip(line) : null;
|
|
62
|
+
}
|
|
63
|
+
function clip(text) {
|
|
64
|
+
const sentence = text.trim().match(/^.*?[.!?](?=\s|$)/)?.[0] ?? text.trim();
|
|
65
|
+
return sentence.length > MAX_WHEN_LENGTH ? `${sentence.slice(0, MAX_WHEN_LENGTH - 1)}…` : sentence;
|
|
66
|
+
}
|
|
67
|
+
function skillPath(name) {
|
|
68
|
+
const roots = [
|
|
69
|
+
() => path.join((0, identity_1.getAgentRoot)(), "skills"),
|
|
70
|
+
() => path.join((0, identity_1.getAgentRoot)(), "skills", "protocols"),
|
|
71
|
+
() => path.join((0, identity_1.getRepoRoot)(), "skills"),
|
|
72
|
+
];
|
|
73
|
+
for (const root of roots) {
|
|
74
|
+
try {
|
|
75
|
+
const candidate = path.join(root(), `${name}.md`);
|
|
76
|
+
if (fs.existsSync(candidate))
|
|
77
|
+
return candidate;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// a root that cannot be resolved (no agent yet) has no skills
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/** Each skill's "when" sentence, for the skills it can read; skills without one are left out. */
|
|
86
|
+
function skillWhenLines(names) {
|
|
87
|
+
const found = new Map();
|
|
88
|
+
for (const name of names) {
|
|
89
|
+
const file = skillPath(name);
|
|
90
|
+
if (!file)
|
|
91
|
+
continue;
|
|
92
|
+
try {
|
|
93
|
+
const when = whenLine(fs.readFileSync(file, "utf-8"));
|
|
94
|
+
if (when)
|
|
95
|
+
found.set(name, when);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// an unreadable skill keeps just its name
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
(0, runtime_1.emitNervesEvent)({
|
|
102
|
+
component: "repertoire",
|
|
103
|
+
event: "repertoire.skill_when_lines",
|
|
104
|
+
message: "read when-lines for the prompt's skills list",
|
|
105
|
+
meta: { skills: names.length, described: found.size },
|
|
106
|
+
});
|
|
107
|
+
return found;
|
|
108
|
+
}
|
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.1083",
|
|
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.1083",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|