@ouro.bot/cli 0.1.0-alpha.1121 → 0.1.0-alpha.1123
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/senses/repeat-while.js +36 -0
- package/dist/senses/teams.js +7 -6
- package/dist/senses/telegram.js +4 -17
- 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.1123",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Lint, the changelog gate and the mailbox-ui checks now run beside the coverage shards instead of after them, and the coverage tests run on 16 shards, so a pull request's checks finish about a minute and a half sooner."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1122",
|
|
12
|
+
"changes": [
|
|
13
|
+
"Telegram shows the agent typing on every connection, not only through the Butler's authority service; Telegram and Teams refresh their working signal through one shared loop."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1121",
|
|
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.1123</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.repeatEvery = repeatEvery;
|
|
4
|
+
exports.whileRepeating = whileRepeating;
|
|
5
|
+
const runtime_1 = require("../nerves/runtime");
|
|
6
|
+
// A chat app's "still working" signal (a typing bubble, a status line) fades unless it is refreshed. Every sense
|
|
7
|
+
// refreshes it the same way: now, then on an interval, until the work is done. A failed refresh is ignored on
|
|
8
|
+
// purpose, because a missing typing bubble must never take down the reply it was decorating.
|
|
9
|
+
function refreshFailed(error) {
|
|
10
|
+
(0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.presence_refresh_failed", message: "a typing refresh failed", meta: { error: String(error) } });
|
|
11
|
+
}
|
|
12
|
+
/** Calls `tick` every `intervalMs` (and once now, if asked) until the returned stop runs. */
|
|
13
|
+
function repeatEvery(tick, intervalMs, options = {}) {
|
|
14
|
+
const safeTick = () => {
|
|
15
|
+
try {
|
|
16
|
+
void Promise.resolve(tick()).catch(refreshFailed);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
refreshFailed(error);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
if (options.now)
|
|
23
|
+
safeTick();
|
|
24
|
+
const timer = setInterval(safeTick, intervalMs);
|
|
25
|
+
return () => clearInterval(timer);
|
|
26
|
+
}
|
|
27
|
+
/** Runs `run` with `tick` refreshed now and every `intervalMs`, and stops refreshing when it settles. */
|
|
28
|
+
async function whileRepeating(tick, intervalMs, run) {
|
|
29
|
+
const stop = repeatEvery(tick, intervalMs, { now: true });
|
|
30
|
+
try {
|
|
31
|
+
return await run();
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
stop();
|
|
35
|
+
}
|
|
36
|
+
}
|
package/dist/senses/teams.js
CHANGED
|
@@ -92,6 +92,7 @@ const teamsFailoverStates = new Map();
|
|
|
92
92
|
const pending_1 = require("../mind/pending");
|
|
93
93
|
const continuity_1 = require("./continuity");
|
|
94
94
|
const teams_image_1 = require("./teams-image");
|
|
95
|
+
const repeat_while_1 = require("./repeat-while");
|
|
95
96
|
const feedback_reply_1 = require("./shepherd/feedback-reply");
|
|
96
97
|
// AIGeneratedContent entity and feedbackLoopEnabled channelData for all outbound
|
|
97
98
|
// Teams messages. Required by Teams AI UX best practices.
|
|
@@ -240,20 +241,20 @@ function createTeamsCallbacks(stream, controller, sendMessage, options) {
|
|
|
240
241
|
let lastPhrase = "";
|
|
241
242
|
let flushTimer = null;
|
|
242
243
|
const flushInterval = options?.flushIntervalMs ?? exports.DEFAULT_FLUSH_INTERVAL_MS;
|
|
243
|
-
let
|
|
244
|
+
let stopKeepalive = null;
|
|
244
245
|
let toolsRunning = 0;
|
|
245
246
|
let toolStatus = "";
|
|
246
247
|
const keepaliveInterval = options?.typingKeepaliveMs ?? exports.TYPING_KEEPALIVE_MS;
|
|
247
248
|
function startTypingKeepalive() {
|
|
248
|
-
if (
|
|
249
|
+
if (stopKeepalive)
|
|
249
250
|
return;
|
|
250
|
-
|
|
251
|
+
stopKeepalive = (0, repeat_while_1.repeatEvery)(() => safeUpdate(toolStatus || "working..."), keepaliveInterval);
|
|
251
252
|
}
|
|
252
253
|
function stopTypingKeepalive() {
|
|
253
254
|
toolsRunning = 0;
|
|
254
|
-
if (
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
if (stopKeepalive) {
|
|
256
|
+
stopKeepalive();
|
|
257
|
+
stopKeepalive = null;
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
260
|
// The SDK merges every chunk's entities into the final message, and Teams rejects a final
|
package/dist/senses/telegram.js
CHANGED
|
@@ -107,6 +107,7 @@ const telegram_admission_1 = require("./telegram-admission");
|
|
|
107
107
|
const telegram_effect_adapter_1 = require("./telegram-effect-adapter");
|
|
108
108
|
const telegram_chat_actions_1 = require("./telegram-chat-actions");
|
|
109
109
|
const atomic_file_1 = require("../heart/atomic-file");
|
|
110
|
+
const repeat_while_1 = require("./repeat-while");
|
|
110
111
|
const EMPTY_SHARED_TURN_DIAGNOSTIC = "(agent responded but response was empty)";
|
|
111
112
|
function hasUserVisibleTurnResponse(response) {
|
|
112
113
|
const text = response.trim();
|
|
@@ -624,12 +625,8 @@ function createTelegramSenseApp(options) {
|
|
|
624
625
|
const transportPrivateValues = [botToken ?? "", authorizedUserId, authorizedChatId];
|
|
625
626
|
const transportError = (error) => redactTelegramPrivateValues(error, transportPrivateValues);
|
|
626
627
|
const api = authorityTransport?.api ?? options.api ?? (0, telegram_client_1.createTelegramBotApi)({ token: botToken });
|
|
627
|
-
// Only the root authority transport admits sendChatAction, so presence is offered
|
|
628
|
-
// exactly where it is actually supported rather than attempted everywhere.
|
|
629
628
|
const proactiveRepetitionGuard = createProactiveRepetitionGuard();
|
|
630
|
-
const sendTypingIndicator =
|
|
631
|
-
? async (chatId) => { await api.request("sendChatAction", { chat_id: chatId, action: "typing" }); }
|
|
632
|
-
: undefined;
|
|
629
|
+
const sendTypingIndicator = async (chatId) => { await api.request("sendChatAction", { chat_id: chatId, action: "typing" }); };
|
|
633
630
|
const offsetStore = options.offsetStore ?? new telegram_client_1.FileTelegramOffsetStore(path.join(agentRoot, "state", "senses", "telegram", "offset.json"));
|
|
634
631
|
const inboxStore = options.inboxStore ?? new telegram_client_1.FileTelegramUpdateInboxStore(path.join(agentRoot, "state", "senses", "telegram", "inbox.json"));
|
|
635
632
|
const admissionStore = options.admission
|
|
@@ -1677,9 +1674,7 @@ function createTelegramSenseApp(options) {
|
|
|
1677
1674
|
// Presence is deliberately separate from delivery: a transport that cannot do
|
|
1678
1675
|
// it degrades to silence instead of failing, and message-delivery assertions
|
|
1679
1676
|
// stay about messages.
|
|
1680
|
-
await (sendTypingIndicator
|
|
1681
|
-
? withTelegramTypingIndicator(() => sendTypingIndicator(message.chatId), () => onMessageBody(message))
|
|
1682
|
-
: onMessageBody(message));
|
|
1677
|
+
await withTelegramTypingIndicator(() => sendTypingIndicator(message.chatId), () => onMessageBody(message));
|
|
1683
1678
|
});
|
|
1684
1679
|
const onUnknownMessage = admissionController && options.admission ? async (message) => {
|
|
1685
1680
|
const approved = await options.admission.resolveApprovedFriend(message);
|
|
@@ -2362,15 +2357,7 @@ function createProactiveRepetitionGuard(options) {
|
|
|
2362
2357
|
* take down the reply it was decorating.
|
|
2363
2358
|
*/
|
|
2364
2359
|
async function withTelegramTypingIndicator(send, run, intervalMs = 4_000) {
|
|
2365
|
-
|
|
2366
|
-
tick();
|
|
2367
|
-
const timer = setInterval(tick, intervalMs);
|
|
2368
|
-
try {
|
|
2369
|
-
return await run();
|
|
2370
|
-
}
|
|
2371
|
-
finally {
|
|
2372
|
-
clearInterval(timer);
|
|
2373
|
-
}
|
|
2360
|
+
return (0, repeat_while_1.whileRepeating)(send, intervalMs, run);
|
|
2374
2361
|
}
|
|
2375
2362
|
async function sendTelegramAwaitFollowUp(agentName, request) {
|
|
2376
2363
|
const app = await startTelegramSenseApp(agentName);
|
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.1123",
|
|
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.1123",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|