@ouro.bot/cli 0.1.0-alpha.1718 → 0.1.0-alpha.1719
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 +9 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/product/active.js +30 -0
- package/dist/products/butler.js +9 -0
- package/dist/senses/telegram.js +8 -12
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1719",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The Butler's product registration now sets two things in its Telegram chat:",
|
|
8
|
+
"The owner's name, from the house config.",
|
|
9
|
+
"The credit top-up reply to \"why aren't my shows downloading?\". Telegram used to pull these in from Butler code.",
|
|
10
|
+
"On the Butler's image, behaviour is unchanged. An agent with no product now always shows its owner as \"Owner\", even when its bundle has a `house/house.json`. Telegram's unused `healthSweep` option is removed."
|
|
11
|
+
]
|
|
12
|
+
},
|
|
4
13
|
{
|
|
5
14
|
"version": "0.1.0-alpha.1718",
|
|
6
15
|
"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.1719</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,8 @@ exports.productDelegationNotifier = productDelegationNotifier;
|
|
|
16
16
|
exports.productSense = productSense;
|
|
17
17
|
exports.productSenseRepairHint = productSenseRepairHint;
|
|
18
18
|
exports.productSenseReadiness = productSenseReadiness;
|
|
19
|
+
exports.productSenseOwnerName = productSenseOwnerName;
|
|
20
|
+
exports.productSenseOwnerReply = productSenseOwnerReply;
|
|
19
21
|
const runtime_1 = require("../../nerves/runtime");
|
|
20
22
|
const container_runtime_1 = require("../daemon/container-runtime");
|
|
21
23
|
/** The seam version this harness runs. A product built for another stops the start. */
|
|
@@ -254,3 +256,31 @@ function productSenseReadiness(agentName, sense, input) {
|
|
|
254
256
|
throw error;
|
|
255
257
|
}
|
|
256
258
|
}
|
|
259
|
+
/** The name a sense shows for the admitted owner (J6): the product's, or "Owner". A throw from the product fails the turn. */
|
|
260
|
+
function productSenseOwnerName(agentName, sense) {
|
|
261
|
+
const product = productFor(agentName);
|
|
262
|
+
const own = product?.senses?.[sense]?.ownerName;
|
|
263
|
+
if (!own)
|
|
264
|
+
return "Owner";
|
|
265
|
+
try {
|
|
266
|
+
return own(agentName);
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
hookFailed(product, "senses.ownerName", agentName, error, "the product's owner name failed, so the owner's turn fails");
|
|
270
|
+
throw error;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/** The text the owner gets for a reply (J6): the product's presentation of it, or the reply unchanged. A throw fails the send. */
|
|
274
|
+
function productSenseOwnerReply(agentName, sense, reply) {
|
|
275
|
+
const product = productFor(agentName);
|
|
276
|
+
const own = product?.senses?.[sense]?.presentOwnerReply;
|
|
277
|
+
if (!own)
|
|
278
|
+
return reply.text;
|
|
279
|
+
try {
|
|
280
|
+
return own(agentName, reply);
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
hookFailed(product, "senses.presentOwnerReply", agentName, error, "the product's reply presentation failed, so the reply isn't sent");
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
}
|
package/dist/products/butler.js
CHANGED
|
@@ -44,6 +44,8 @@ const sanctuary_package_management_1 = require("../heart/daemon/sanctuary-packag
|
|
|
44
44
|
const runtime_1 = require("../nerves/runtime");
|
|
45
45
|
const tools_sanctuary_host_1 = require("../repertoire/tools-sanctuary-host");
|
|
46
46
|
const telegram_identity_key_1 = require("../senses/telegram-identity-key");
|
|
47
|
+
const sanctuary_house_1 = require("../senses/sanctuary-house");
|
|
48
|
+
const sanctuary_download_credit_presentation_1 = require("../senses/sanctuary-download-credit-presentation");
|
|
47
49
|
/** The acceptance run that proves a cron fire reaches the health sweep (Unit 16f), when one is running. */
|
|
48
50
|
function cronFingerprintScenario(agent) {
|
|
49
51
|
const marker = (0, sanctuary_acceptance_marker_1.readSanctuaryAcceptanceMarker)(agent);
|
|
@@ -170,6 +172,13 @@ exports.product = {
|
|
|
170
172
|
? { configured: true, detail: "root authority transport; gateway validated at process startup" }
|
|
171
173
|
: { configured: false, detail: "root authority migration requires available tokenless credential inventories" },
|
|
172
174
|
repairHint: () => "Agent-runnable: complete or recover the root authority migration; do not restore a resident Telegram token.",
|
|
175
|
+
// The owner's name is the household's own (house/house.json); a household that hasn't named one gets "Owner".
|
|
176
|
+
ownerName: (agentName) => {
|
|
177
|
+
const { ownerName } = (0, sanctuary_house_1.readSanctuaryHouse)((0, identity_1.getAgentRoot)(agentName));
|
|
178
|
+
return ownerName === sanctuary_house_1.DEFAULT_SANCTUARY_HOUSE.ownerName ? "Owner" : ownerName;
|
|
179
|
+
},
|
|
180
|
+
// "Why aren't my shows downloading?" gets the household's credit top-up reply, never the downloaders' internals.
|
|
181
|
+
presentOwnerReply: (agentName, { request, text }) => (0, sanctuary_download_credit_presentation_1.presentSanctuaryDownloadCreditReply)(agentName, request === "why aren't my shows downloading?", text),
|
|
173
182
|
},
|
|
174
183
|
},
|
|
175
184
|
// J8: the Butler takes delegated commands from peers the operator granted, each announced in the owner's own Telegram
|
package/dist/senses/telegram.js
CHANGED
|
@@ -64,7 +64,6 @@ const path = __importStar(require("node:path"));
|
|
|
64
64
|
const friends_1 = require("@ouro.bot/friends");
|
|
65
65
|
const delegated_command_1 = require("../a2a/delegated-command");
|
|
66
66
|
const identity_1 = require("../heart/identity");
|
|
67
|
-
const sanctuary_house_1 = require("./sanctuary-house");
|
|
68
67
|
const sanctuary_acceptance_marker_1 = require("../heart/daemon/sanctuary-acceptance-marker");
|
|
69
68
|
const runtime_credentials_1 = require("../heart/runtime-credentials");
|
|
70
69
|
const runtime_1 = require("../nerves/runtime");
|
|
@@ -74,7 +73,6 @@ const sanctuary_interactive_control_1 = require("./sanctuary-interactive-control
|
|
|
74
73
|
const telegram_approval_relay_1 = require("./telegram-approval-relay");
|
|
75
74
|
const sanctuary_runtime_1 = require("./sanctuary-runtime");
|
|
76
75
|
const sanctuary_sab_1 = require("./sanctuary-sab");
|
|
77
|
-
const sanctuary_download_credit_presentation_1 = require("./sanctuary-download-credit-presentation");
|
|
78
76
|
const shared_turn_1 = require("./shared-turn");
|
|
79
77
|
const config_1 = require("../heart/config");
|
|
80
78
|
const telegram_identity_key_1 = require("./telegram-identity-key");
|
|
@@ -425,10 +423,9 @@ function telegramBotIdFromToken(token) {
|
|
|
425
423
|
function errorCode(error) {
|
|
426
424
|
return error && typeof error === "object" && "code" in error && typeof error.code === "string" ? error.code : undefined;
|
|
427
425
|
}
|
|
428
|
-
/** The admitted owner's display name
|
|
426
|
+
/** The admitted owner's display name: the product's, or "Owner". */
|
|
429
427
|
function ownerDisplayName(agentName) {
|
|
430
|
-
|
|
431
|
-
return ownerName === sanctuary_house_1.DEFAULT_SANCTUARY_HOUSE.ownerName ? "Owner" : ownerName;
|
|
428
|
+
return (0, active_1.productSenseOwnerName)(agentName, "telegram");
|
|
432
429
|
}
|
|
433
430
|
function opaqueTelegramSubject(identityKey, botToken, authorizedUserId, authorizedChatId) {
|
|
434
431
|
const payload = [
|
|
@@ -1160,8 +1157,8 @@ function createTelegramSenseApp(options) {
|
|
|
1160
1157
|
approvalReconciliationsInFlight.add(failsafe);
|
|
1161
1158
|
}, delay);
|
|
1162
1159
|
};
|
|
1163
|
-
const deliverButlerEffect = async (text, idempotencyKey, signal, onMessageDelivered,
|
|
1164
|
-
const presentedText = (0,
|
|
1160
|
+
const deliverButlerEffect = async (text, idempotencyKey, signal, onMessageDelivered, ownerRequest = null, replyToMessageId, silent = false) => {
|
|
1161
|
+
const presentedText = (0, active_1.productSenseOwnerReply)(options.agentName, "telegram", { request: ownerRequest, text });
|
|
1165
1162
|
return executeAuthorizedEffect({
|
|
1166
1163
|
idempotencyKey,
|
|
1167
1164
|
target: configuredOwnerTarget(),
|
|
@@ -1211,7 +1208,7 @@ function createTelegramSenseApp(options) {
|
|
|
1211
1208
|
}
|
|
1212
1209
|
const pacingReason = options.proactivePacing ? (0, telegram_handoff_1.proactiveHoldReason)(proactiveLedgerPath, new Date(), options.proactivePacing) : null;
|
|
1213
1210
|
const silent = options.ownerRoute !== undefined || pacingReason === "quiet_hours";
|
|
1214
|
-
const effect = await deliverButlerEffect(text, key, input.signal, undefined,
|
|
1211
|
+
const effect = await deliverButlerEffect(text, key, input.signal, undefined, null, undefined, silent);
|
|
1215
1212
|
(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 } });
|
|
1216
1213
|
const sessionPath = (0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot);
|
|
1217
1214
|
await recordAcceptedEffects(sessionPath, [effect]);
|
|
@@ -1709,7 +1706,6 @@ function createTelegramSenseApp(options) {
|
|
|
1709
1706
|
const turnMetricsObserver = { providerInvocationCount: 0, toolInvocationCount: 0 };
|
|
1710
1707
|
const toolReceiptObserver = { toolResultDigests: [], toolGroundings: [] };
|
|
1711
1708
|
const normalizedRequest = message.text.normalize("NFKC").trim().toLocaleLowerCase("en-US");
|
|
1712
|
-
const exactDownloadCreditQuestion = normalizedRequest === "why aren't my shows downloading?";
|
|
1713
1709
|
const groundingIntentTool = groundedAcceptance
|
|
1714
1710
|
? /^(?:what['’]?s up|status)\??$/u.test(normalizedRequest) ? "unraid_get_system"
|
|
1715
1711
|
: /^how much (?:space|storage) is left\??$/u.test(normalizedRequest) ? "unraid_get_storage"
|
|
@@ -1771,7 +1767,7 @@ function createTelegramSenseApp(options) {
|
|
|
1771
1767
|
bufferedGroundedDeliveries.push(delivery.kind);
|
|
1772
1768
|
}
|
|
1773
1769
|
else {
|
|
1774
|
-
turnEffects.push(await deliverButlerEffect(delivery.text, `turn:${subject}:${message.updateId}:delivery:${deliveryOrdinal++}`, undefined, (messageId, chunk) => { deliveredMessageIds.push(messageId); deliveredChunks.push(chunk); },
|
|
1770
|
+
turnEffects.push(await deliverButlerEffect(delivery.text, `turn:${subject}:${message.updateId}:delivery:${deliveryOrdinal++}`, undefined, (messageId, chunk) => { deliveredMessageIds.push(messageId); deliveredChunks.push(chunk); }, normalizedRequest, chat.replyToMessageId()));
|
|
1775
1771
|
}
|
|
1776
1772
|
},
|
|
1777
1773
|
},
|
|
@@ -1806,7 +1802,7 @@ function createTelegramSenseApp(options) {
|
|
|
1806
1802
|
else {
|
|
1807
1803
|
const responseFallback = responseFallbackAfterDeliveries(result, turnEffects.length);
|
|
1808
1804
|
if (responseFallback) {
|
|
1809
|
-
const artifact = await deliverButlerEffect(responseFallback, `turn:${subject}:${message.updateId}:delivery:${deliveryOrdinal++}`, undefined, (messageId, chunk) => { deliveredMessageIds.push(messageId); deliveredChunks.push(chunk); },
|
|
1805
|
+
const artifact = await deliverButlerEffect(responseFallback, `turn:${subject}:${message.updateId}:delivery:${deliveryOrdinal++}`, undefined, (messageId, chunk) => { deliveredMessageIds.push(messageId); deliveredChunks.push(chunk); }, normalizedRequest);
|
|
1810
1806
|
turnEffects.push(artifact);
|
|
1811
1807
|
responseFallbackArtifactId = artifact.id;
|
|
1812
1808
|
}
|
|
@@ -1853,7 +1849,7 @@ function createTelegramSenseApp(options) {
|
|
|
1853
1849
|
telegramInboundTurn.getStore().failure = `the turn failed (${errorCategory})`;
|
|
1854
1850
|
const fallback = "I couldn't complete that turn. The failure was recorded; please try again.";
|
|
1855
1851
|
if (deliveredMessageIds.length === 0)
|
|
1856
|
-
turnEffects.push(await deliverButlerEffect(fallback, `turn:${subject}:${message.updateId}:fallback`, undefined, (messageId, chunk) => { deliveredMessageIds.push(messageId); deliveredChunks.push(chunk); },
|
|
1852
|
+
turnEffects.push(await deliverButlerEffect(fallback, `turn:${subject}:${message.updateId}:fallback`, undefined, (messageId, chunk) => { deliveredMessageIds.push(messageId); deliveredChunks.push(chunk); }, normalizedRequest));
|
|
1857
1853
|
await recordAcceptedEffects(currentSessionPath, turnEffects, { text: message.text, reference: inboundReference, attachmentIds: hydrated.attachmentIds });
|
|
1858
1854
|
}
|
|
1859
1855
|
finally {
|
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.1719",
|
|
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.1719",
|
|
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.1719",
|
|
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": {
|