@ouro.bot/cli 0.1.0-alpha.1385 → 0.1.0-alpha.1387
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 +12 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/a2a/delegated-command.js +5 -2
- package/dist/repertoire/mcp-tools.js +4 -0
- package/dist/senses/telegram.js +22 -20
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
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.1387",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Declared consequential MCP tools now wait for the person's approval before they run (#1694)."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1386",
|
|
12
|
+
"changes": [
|
|
13
|
+
"A delegated command counts as noticed only once Telegram accepted its audit notice, and its refusal no longer says the owner's chat is down when the chat is only handed to someone else."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1385",
|
|
6
18
|
"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.1387</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -68,7 +68,10 @@ function delegatedCommandWasNoticed(agentRoot, commandId, principalFriendId, del
|
|
|
68
68
|
throw error;
|
|
69
69
|
}
|
|
70
70
|
const artifact = JSON.parse(raw);
|
|
71
|
-
|
|
71
|
+
// The journal entry is written before the send, so only parts Telegram accepted count as the owner having been told.
|
|
72
|
+
const delivered = Array.isArray(artifact.parts) && artifact.parts.length > 0
|
|
73
|
+
&& artifact.parts.every((part) => typeof part === "object" && part !== null && ["accepted", "session_recorded"].includes(part.state));
|
|
74
|
+
return delivered && artifact.idempotencyKey === idempotencyKey && artifact.authorClass === "butler" && artifact.target?.friendId === principalFriendId;
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
74
77
|
* What a refused sender is told. Every refusal says that nothing ran and names the next step; the reason code stays
|
|
@@ -97,7 +100,7 @@ function delegationRefusalGuidance(reason, hints) {
|
|
|
97
100
|
case "principal_unresolved":
|
|
98
101
|
return { message: "the agent cannot tell whose command this is (its owner record is missing or ambiguous)", next: "Ask the operator to check the owner's friend record on the agent's host.", retry: false };
|
|
99
102
|
case "notice_failed":
|
|
100
|
-
return { message: "the agent could not tell its owner about this command first, so it did not run it", next: "Retry in a minute. If it keeps failing, the owner'
|
|
103
|
+
return { message: "the agent could not tell its owner about this command first, so it did not run it", next: "Retry in a minute. If it keeps failing, the owner can't be told in their own chat right now (it may be handed to someone else, or unreachable): tell the operator.", retry: true };
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
/** Invisible and bidirectional-control characters a sender could slip inside the banner to keep it from matching. */
|
|
@@ -120,6 +120,10 @@ function mcpToolsAsDefinitions(view) {
|
|
|
120
120
|
risk: "high",
|
|
121
121
|
reason: "MCP tools may mutate external systems",
|
|
122
122
|
},
|
|
123
|
+
// A declared consequential tool waits for the person's approval, like the harness's own consequential tools.
|
|
124
|
+
...(declared?.ax.effect === "consequential"
|
|
125
|
+
? { approvalPolicy: () => ({ kind: "required", policyId: "mcp.declared.consequential.v1", actionClass: `mcp.${entry.server}.${tool.name}`, requiresSoleCall: true }) }
|
|
126
|
+
: {}),
|
|
123
127
|
handler: async (args, ctx) => {
|
|
124
128
|
if (ctx?.agentName !== binding.agentName || ctx.agentRoot !== binding.agentRoot) {
|
|
125
129
|
(0, runtime_1.emitNervesEvent)({
|
package/dist/senses/telegram.js
CHANGED
|
@@ -1077,6 +1077,26 @@ function createTelegramSenseApp(options) {
|
|
|
1077
1077
|
(0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_notice_held_for_pacing", message: "held a house notice for quiet hours or the daily message cap", meta: { agentName: options.agentName, reason: pacingReason } });
|
|
1078
1078
|
return true;
|
|
1079
1079
|
};
|
|
1080
|
+
// A delegated command's audit notice (see `TelegramSenseApp.sendDelegatedAuditNotice`): sent now, or it throws.
|
|
1081
|
+
const sendDelegatedAuditNotice = async (input) => {
|
|
1082
|
+
const noticeId = requiredText(input.noticeId, "delegated audit notice id");
|
|
1083
|
+
if (!noticeId.startsWith("delegated:") || Buffer.byteLength(noticeId) > 512)
|
|
1084
|
+
throw new Error("Telegram delegated audit notice id is invalid");
|
|
1085
|
+
const key = `owner-notice:${noticeId}`;
|
|
1086
|
+
await runWithAcceptanceAuditOwner(async () => {
|
|
1087
|
+
const text = requiredText(input.text, "delegated audit notice");
|
|
1088
|
+
if (ownerChatIsHandedOff()) {
|
|
1089
|
+
(0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.telegram_delegated_notice_refused", message: "refused a delegated command's audit notice while the owner's chat is handed to someone else", meta: { agentName: options.agentName, reason: "handed_off" } });
|
|
1090
|
+
throw new Error("the owner's Telegram chat is handed to someone else, so a delegated command's notice can't be sent");
|
|
1091
|
+
}
|
|
1092
|
+
const pacingReason = options.proactivePacing ? (0, telegram_handoff_1.proactiveHoldReason)(proactiveLedgerPath, new Date(), options.proactivePacing) : null;
|
|
1093
|
+
const silent = options.ownerRoute !== undefined || pacingReason === "quiet_hours";
|
|
1094
|
+
const effect = await deliverButlerEffect(text, key, input.signal, undefined, false, undefined, silent);
|
|
1095
|
+
(0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_delegated_notice_sent", message: "sent a delegated command's audit notice to the owner's Telegram chat", meta: { agentName: options.agentName, silent } });
|
|
1096
|
+
const sessionPath = (0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot);
|
|
1097
|
+
await recordAcceptedEffects(sessionPath, [effect]);
|
|
1098
|
+
});
|
|
1099
|
+
};
|
|
1080
1100
|
// Keys the owner's primary agent accepted, so a retry is already sent (as with the effect journal for Telegram).
|
|
1081
1101
|
const routedKeysPath = path.join(agentRoot, "state", "telegram", "routed-owner-notices.json");
|
|
1082
1102
|
/**
|
|
@@ -2071,7 +2091,7 @@ function createTelegramSenseApp(options) {
|
|
|
2071
2091
|
if (Buffer.byteLength(noticeId) > 512)
|
|
2072
2092
|
throw new Error("Telegram owner notice id is invalid");
|
|
2073
2093
|
if (noticeId.startsWith("delegated:"))
|
|
2074
|
-
return
|
|
2094
|
+
return sendDelegatedAuditNotice({ ...input, noticeId });
|
|
2075
2095
|
await runWithAcceptanceAuditOwner(async () => {
|
|
2076
2096
|
const text = requiredText(input.text, "owner notice");
|
|
2077
2097
|
const telegramText = await routeSelfStarted(text, `owner-notice:${noticeId}`, undefined, input.signal);
|
|
@@ -2086,25 +2106,7 @@ function createTelegramSenseApp(options) {
|
|
|
2086
2106
|
await recordAcceptedEffects(sessionPath, [effect]);
|
|
2087
2107
|
});
|
|
2088
2108
|
},
|
|
2089
|
-
|
|
2090
|
-
const noticeId = requiredText(input.noticeId, "delegated audit notice id");
|
|
2091
|
-
if (!noticeId.startsWith("delegated:") || Buffer.byteLength(noticeId) > 512)
|
|
2092
|
-
throw new Error("Telegram delegated audit notice id is invalid");
|
|
2093
|
-
const key = `owner-notice:${noticeId}`;
|
|
2094
|
-
await runWithAcceptanceAuditOwner(async () => {
|
|
2095
|
-
const text = requiredText(input.text, "delegated audit notice");
|
|
2096
|
-
if (ownerChatIsHandedOff()) {
|
|
2097
|
-
(0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.telegram_delegated_notice_refused", message: "refused a delegated command's audit notice while the owner's chat is handed to someone else", meta: { agentName: options.agentName, reason: "handed_off" } });
|
|
2098
|
-
throw new Error("the owner's Telegram chat is handed to someone else, so a delegated command's notice can't be sent");
|
|
2099
|
-
}
|
|
2100
|
-
const pacingReason = options.proactivePacing ? (0, telegram_handoff_1.proactiveHoldReason)(proactiveLedgerPath, new Date(), options.proactivePacing) : null;
|
|
2101
|
-
const silent = options.ownerRoute !== undefined || pacingReason === "quiet_hours";
|
|
2102
|
-
const effect = await deliverButlerEffect(text, key, input.signal, undefined, false, undefined, silent);
|
|
2103
|
-
(0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_delegated_notice_sent", message: "sent a delegated command's audit notice to the owner's Telegram chat", meta: { agentName: options.agentName, silent } });
|
|
2104
|
-
const sessionPath = (0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot);
|
|
2105
|
-
await recordAcceptedEffects(sessionPath, [effect]);
|
|
2106
|
-
});
|
|
2107
|
-
},
|
|
2109
|
+
sendDelegatedAuditNotice,
|
|
2108
2110
|
stop() {
|
|
2109
2111
|
if (stopPromise)
|
|
2110
2112
|
return stopPromise;
|
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.1387",
|
|
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.1387",
|
|
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.1387",
|
|
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": {
|