@ouro.bot/cli 0.1.0-alpha.1364 → 0.1.0-alpha.1366
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 +13 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/daemon/runtime-logging.js +9 -3
- package/dist/heart/mcp/mcp-server.js +2 -2
- package/dist/senses/bluebubbles/semantic-receipts.js +19 -0
- package/dist/senses/telegram-effect-adapter.js +4 -3
- package/dist/senses/telegram.js +22 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
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.1366",
|
|
6
|
+
"changes": [
|
|
7
|
+
"shepherd_feedback and shepherd_feedback_status say what they do instead of giving the agent rules, so they pass the Ouro AX census's booklet-words check."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1365",
|
|
12
|
+
"changes": [
|
|
13
|
+
"With an owner route, the approvals the Butler needs from its owner (tool approval prompts, admission cards) go to the owner's primary agent first as urgent; the card still reaches Telegram so its buttons work, silently when the primary agent has it.",
|
|
14
|
+
"Update the Ouro UI files to Ouro UI core v1.11.0 and Ouro UI v1.3.450."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
4
17
|
{
|
|
5
18
|
"version": "0.1.0-alpha.1364",
|
|
6
19
|
"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.1366</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -114,19 +114,25 @@ function machineDaemonLoggingConfigPath(homeDir) {
|
|
|
114
114
|
function machineDaemonLogsDir(homeDir) {
|
|
115
115
|
return path.join((0, ouro_version_manager_1.getOuroCliHome)(homeDir), "daemon", "logs");
|
|
116
116
|
}
|
|
117
|
-
function resolveLoggingPathTarget(explicit) {
|
|
117
|
+
function resolveLoggingPathTarget(explicit, homeDir) {
|
|
118
118
|
if (explicit && explicit.trim().length > 0) {
|
|
119
119
|
return { kind: "agent", agentName: explicit.trim() };
|
|
120
120
|
}
|
|
121
|
+
let agentName;
|
|
121
122
|
try {
|
|
122
|
-
|
|
123
|
+
agentName = (0, identity_1.getAgentName)();
|
|
123
124
|
}
|
|
124
125
|
catch {
|
|
125
126
|
return { kind: "machine" };
|
|
126
127
|
}
|
|
128
|
+
// An --agent argv naming no bundle (a typo, a stand-in) must not create one just to hold a log.
|
|
129
|
+
const bundleRoot = homeDir
|
|
130
|
+
? path.join(homeDir, "AgentBundles", `${agentName}.ouro`)
|
|
131
|
+
: (0, identity_1.getAgentRoot)(agentName);
|
|
132
|
+
return fs.existsSync(bundleRoot) ? { kind: "agent", agentName } : { kind: "machine" };
|
|
127
133
|
}
|
|
128
134
|
function configureDaemonRuntimeLogger(processName, options = {}) {
|
|
129
|
-
const pathTarget = options.machine ? { kind: "machine" } : resolveLoggingPathTarget(options.agentName);
|
|
135
|
+
const pathTarget = options.machine ? { kind: "machine" } : resolveLoggingPathTarget(options.agentName, options.homeDir);
|
|
130
136
|
const configPath = options.configPath
|
|
131
137
|
?? (pathTarget.kind === "machine"
|
|
132
138
|
? machineDaemonLoggingConfigPath(options.homeDir)
|
|
@@ -717,7 +717,7 @@ function getToolSchemas() {
|
|
|
717
717
|
return [
|
|
718
718
|
{
|
|
719
719
|
name: "shepherd_feedback",
|
|
720
|
-
description: "
|
|
720
|
+
description: "Relays the human's explicit feedback from this coding session ('you should have caught this') to the supervising agent served by this MCP connection. The caller makes one UUID request_id per request and reuses it only for that request's identical retry. The source terminal and recipient are bound automatically, so the human has nothing to reconstruct in Teams. feedback carries the human's own words; context is optional bounded background, not instructions. The result is the daemon's receipt, the exact text to quote back in this session; the supervising agent then sends its acknowledgement and any clarification questions to that human privately on Teams. The receipt says the feedback is filed, not that it was learned from or delivered on Teams. Relaying the feedback takes only this call, with no terminal input and no focus switch.",
|
|
721
721
|
ax: { id: "mcp:shepherd_feedback", group: "ouro-agent", when: "Pick this when the human gives feedback on how this coding session went, so the supervisor who watches it learns from their exact words.", effect: "write", idempotent: true, errors: [
|
|
722
722
|
{ code: "invalid-feedback-request", means: "request_id isn't a UUID, or the call has arguments other than request_id, feedback and context.", fix: "Make one UUID for this feedback and call again with only request_id, feedback and context." },
|
|
723
723
|
{ code: "feedback-size", means: "feedback is empty or over 2000 characters, or context isn't text or is over 8 KiB.", fix: "Keep the human's words under 2000 characters, trim context, and call again with the same request_id." },
|
|
@@ -734,7 +734,7 @@ function getToolSchemas() {
|
|
|
734
734
|
description: "Reconcile this human's original feedback request after a lost receipt or to inspect review/Teams delivery state. Does not create another request, repeat model work, or require the source terminal still to exist.",
|
|
735
735
|
ax: { id: "mcp:shepherd_feedback_status", group: "ouro-agent", when: "Pick this after shepherd_feedback lost its receipt or left you unsure, to learn whether that feedback was filed and delivered.", effect: "read", errors: [
|
|
736
736
|
{ code: "invalid-status-request", means: "request_id isn't a UUID, or the call has arguments other than request_id.", fix: "Call again with only request_id, set to the UUID you gave shepherd_feedback." },
|
|
737
|
-
{ code: "status-unconfirmed", means: "The daemon couldn't confirm what happened to that feedback; the line below says why.", fix: "Call shepherd_feedback_status again later with the same request_id;
|
|
737
|
+
{ code: "status-unconfirmed", means: "The daemon couldn't confirm what happened to that feedback; the line below says why.", fix: "Call shepherd_feedback_status again later with the same request_id; resending the feedback under a new ID could file it twice." },
|
|
738
738
|
] },
|
|
739
739
|
inputSchema: { type: "object", properties: {
|
|
740
740
|
request_id: { type: "string", description: "The original feedback UUID." },
|
|
@@ -1945,7 +1945,26 @@ function isNodeError(error, code) {
|
|
|
1945
1945
|
function isRecord(value) {
|
|
1946
1946
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1947
1947
|
}
|
|
1948
|
+
// Every recovery pass re-reads the same legacy records, so a bundle with
|
|
1949
|
+
// 1,530 of them wrote 1,530 identical warnings every 30 seconds. Report each
|
|
1950
|
+
// distinct record once per process; the record stays audit-only either way.
|
|
1951
|
+
const reportedLegacyRecoveryRecords = new Set();
|
|
1952
|
+
function legacyRecoveryFingerprint(value) {
|
|
1953
|
+
try {
|
|
1954
|
+
const serialized = JSON.stringify(value);
|
|
1955
|
+
return serialized === undefined ? null : sha256Utf8(serialized);
|
|
1956
|
+
}
|
|
1957
|
+
catch {
|
|
1958
|
+
return null;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1948
1961
|
function emitLegacyRecoveryBlocked(value) {
|
|
1962
|
+
const fingerprint = legacyRecoveryFingerprint(value);
|
|
1963
|
+
if (fingerprint !== null) {
|
|
1964
|
+
if (reportedLegacyRecoveryRecords.has(fingerprint))
|
|
1965
|
+
return;
|
|
1966
|
+
reportedLegacyRecoveryRecords.add(fingerprint);
|
|
1967
|
+
}
|
|
1949
1968
|
(0, runtime_1.emitNervesEvent)({
|
|
1950
1969
|
level: "warn",
|
|
1951
1970
|
component: "senses",
|
|
@@ -118,7 +118,7 @@ function validateArtifact(artifact, expectedId) {
|
|
|
118
118
|
? boundedText(effect.text, 150_000)
|
|
119
119
|
&& (effect.kind !== "text" || effect.replyToMessageId === undefined || (Number.isSafeInteger(effect.replyToMessageId) && effect.replyToMessageId > 0))
|
|
120
120
|
: effect?.kind === "card"
|
|
121
|
-
? boundedText(effect.text) && Array.isArray(effect.buttons) && effect.buttons.length > 0 && effect.buttons.length <= 20
|
|
121
|
+
? boundedText(effect.text) && (effect.silent === undefined || effect.silent === true) && Array.isArray(effect.buttons) && effect.buttons.length > 0 && effect.buttons.length <= 20
|
|
122
122
|
&& effect.buttons.every((row) => Array.isArray(row) && row.length > 0 && row.length <= 8
|
|
123
123
|
&& row.every((button) => boundedText(button?.text, 256) && boundedText(button?.callbackData, 64) && Buffer.byteLength(button.callbackData, "utf8") <= 64))
|
|
124
124
|
: effect?.kind === "edit"
|
|
@@ -392,14 +392,15 @@ async function executePart(api, artifact, part, chatId, signal) {
|
|
|
392
392
|
}
|
|
393
393
|
if (effect.kind === "card") {
|
|
394
394
|
const reply_markup = { inline_keyboard: effect.buttons.map((row) => row.map((button) => ({ text: button.text, callback_data: button.callbackData }))) };
|
|
395
|
+
const quiet = effect.silent ? { disable_notification: true } : {};
|
|
395
396
|
let result;
|
|
396
397
|
try {
|
|
397
|
-
result = await api.request("sendMessage", { chat_id: chatId, text: (0, telegram_client_1.escapeTelegramHtml)(effect.text), parse_mode: "HTML", reply_markup }, signal);
|
|
398
|
+
result = await api.request("sendMessage", { chat_id: chatId, text: (0, telegram_client_1.escapeTelegramHtml)(effect.text), parse_mode: "HTML", reply_markup, ...quiet }, signal);
|
|
398
399
|
}
|
|
399
400
|
catch (error) {
|
|
400
401
|
if (!(error instanceof telegram_client_1.TelegramApiError) || error.status !== 400)
|
|
401
402
|
throw error;
|
|
402
|
-
result = await api.request("sendMessage", { chat_id: chatId, text: effect.text, reply_markup }, signal);
|
|
403
|
+
result = await api.request("sendMessage", { chat_id: chatId, text: effect.text, reply_markup, ...quiet }, signal);
|
|
403
404
|
}
|
|
404
405
|
return canonicalMessageId(result);
|
|
405
406
|
}
|
package/dist/senses/telegram.js
CHANGED
|
@@ -831,12 +831,33 @@ function createTelegramSenseApp(options) {
|
|
|
831
831
|
const authorizeEffect = options.authorizeEffect ?? defaultEffectAuthorization;
|
|
832
832
|
let recordAcceptedEffects;
|
|
833
833
|
const configuredOwnerTarget = () => ({ kind: "approved_relationship", friendId: configuredOwnerFriendId, sessionKey: configuredOwnerSessionKey });
|
|
834
|
-
const
|
|
834
|
+
const fallbackText = (text) => `${telegram_owner_route_1.OWNER_ROUTE_FALLBACK_PREFIX}\n\n${text}`;
|
|
835
|
+
const executeOnTelegram = (0, telegram_effect_adapter_1.createTelegramAuthorizedEffectExecutor)({
|
|
835
836
|
store: getEffectJournal,
|
|
836
837
|
api,
|
|
837
838
|
authorize: authorizeEffect,
|
|
838
839
|
barrier: acceptanceAuditBarrier,
|
|
839
840
|
});
|
|
841
|
+
/**
|
|
842
|
+
* An approval card the agent wants from the owner (a tool approval's prompt, a newcomer's admission card) goes to the owner
|
|
843
|
+
* route first, as urgent. The card still goes to Telegram so its buttons work: silently when the primary agent has it,
|
|
844
|
+
* and with the fallback line when it can't be reached. A resend of a card already in the journal is left as it was.
|
|
845
|
+
*/
|
|
846
|
+
const executeAuthorizedEffect = async (input) => {
|
|
847
|
+
const route = options.ownerRoute;
|
|
848
|
+
if (!route || input.effect.kind !== "card" || input.target.kind !== "approved_relationship" || input.target.friendId !== configuredOwnerFriendId
|
|
849
|
+
|| !/^(?:approval:.+:prompt|owner-card:.+)$/u.test(input.idempotencyKey) || getEffectJournal().readByIdempotencyKey(input.idempotencyKey)) {
|
|
850
|
+
return executeOnTelegram(input);
|
|
851
|
+
}
|
|
852
|
+
const effect = input.effect;
|
|
853
|
+
const choices = effect.buttons.flat().map((button) => button.text).join(", ");
|
|
854
|
+
const outcome = await route((0, telegram_owner_route_1.ownerRouteItem)(input.idempotencyKey, `${effect.text}\n\nOptions: ${choices}. The buttons are on the card in the Butler's Telegram chat.`, true));
|
|
855
|
+
(0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_owner_route_approval", message: "offered an approval card to the owner's primary agent", meta: { agentName: options.agentName, outcome: outcome.status } });
|
|
856
|
+
return executeOnTelegram({
|
|
857
|
+
...input,
|
|
858
|
+
effect: outcome.status === "delivered" ? { ...effect, silent: true } : { ...effect, text: fallbackText(effect.text) },
|
|
859
|
+
});
|
|
860
|
+
};
|
|
840
861
|
const recordConfiguredOwnerEffect = async (artifact, causalEventId) => {
|
|
841
862
|
await recordAcceptedEffects((0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot), [artifact], undefined, causalEventId ? { [artifact.id]: causalEventId } : undefined);
|
|
842
863
|
};
|
|
@@ -1057,7 +1078,6 @@ function createTelegramSenseApp(options) {
|
|
|
1057
1078
|
};
|
|
1058
1079
|
// Keys the owner's primary agent accepted, so a retry is already sent (as with the effect journal for Telegram).
|
|
1059
1080
|
const routedKeysPath = path.join(agentRoot, "state", "telegram", "routed-owner-notices.json");
|
|
1060
|
-
const fallbackText = (text) => `${telegram_owner_route_1.OWNER_ROUTE_FALLBACK_PREFIX}\n\n${text}`;
|
|
1061
1081
|
/**
|
|
1062
1082
|
* Offers a self-started message to the owner route. Returns null when it is handled (the peer has it, or it waits in the
|
|
1063
1083
|
* held file for the peer), or the text Telegram should send: the message itself with no route, or, for an urgent message
|
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.1366",
|
|
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.1366",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1366",
|
|
4
4
|
"description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
|
|
5
5
|
"homepage": "https://ouroboros.bot/",
|
|
6
6
|
"engines": {
|