@ouro.bot/cli 0.1.0-alpha.1108 → 0.1.0-alpha.1109
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.1109",
|
|
6
|
+
"changes": [
|
|
7
|
+
"A Teams send that got a 502 while opening its conversation is retried once, and the send error now names the failing step and status."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1108",
|
|
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.1109</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/senses/teams.js
CHANGED
|
@@ -1585,6 +1585,30 @@ function resolveTeamsFriendStore(deps) {
|
|
|
1585
1585
|
function getTeamsConversations(botApi) {
|
|
1586
1586
|
return botApi.conversations;
|
|
1587
1587
|
}
|
|
1588
|
+
// A transient gateway error on creating the 1:1 conversation is retried once. A message post is never retried: a
|
|
1589
|
+
// gateway error can follow a post that already landed.
|
|
1590
|
+
const TRANSIENT_RETRY_DELAY_MS = 1_000;
|
|
1591
|
+
function errorStatus(error) {
|
|
1592
|
+
if (!error || typeof error !== "object")
|
|
1593
|
+
return undefined;
|
|
1594
|
+
if ("statusCode" in error && typeof error.statusCode === "number")
|
|
1595
|
+
return error.statusCode;
|
|
1596
|
+
if ("status" in error && typeof error.status === "number")
|
|
1597
|
+
return error.status;
|
|
1598
|
+
return undefined;
|
|
1599
|
+
}
|
|
1600
|
+
async function createProactiveConversation(conversations, params) {
|
|
1601
|
+
try {
|
|
1602
|
+
return await conversations.create(params);
|
|
1603
|
+
}
|
|
1604
|
+
catch (error) {
|
|
1605
|
+
const status = errorStatus(error);
|
|
1606
|
+
if (status === undefined || status < 500 || status > 504)
|
|
1607
|
+
throw error;
|
|
1608
|
+
await new Promise((resolve) => setTimeout(resolve, TRANSIENT_RETRY_DELAY_MS));
|
|
1609
|
+
return conversations.create(params);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1588
1612
|
function hasExplicitCrossChatAuthorization(params) {
|
|
1589
1613
|
return params.intent === "explicit_cross_chat"
|
|
1590
1614
|
&& friends_1.TRUSTED_LEVELS.has(params.authorizingSession?.trustLevel ?? "stranger");
|
|
@@ -1646,8 +1670,9 @@ async function sendProactiveTeamsMessageToSession(params, deps) {
|
|
|
1646
1670
|
}
|
|
1647
1671
|
let conversationId;
|
|
1648
1672
|
let activityAttempted = false;
|
|
1673
|
+
let step = "conversation";
|
|
1649
1674
|
try {
|
|
1650
|
-
const conversation = await conversations
|
|
1675
|
+
const conversation = await createProactiveConversation(conversations, {
|
|
1651
1676
|
bot: { id: deps.botApi.id },
|
|
1652
1677
|
members: [{ id: aadInfo.aadObjectId, role: "user", name: friend.name || aadInfo.aadObjectId }],
|
|
1653
1678
|
tenantId: aadInfo.tenantId,
|
|
@@ -1655,6 +1680,7 @@ async function sendProactiveTeamsMessageToSession(params, deps) {
|
|
|
1655
1680
|
});
|
|
1656
1681
|
conversationId = conversation.id;
|
|
1657
1682
|
activityAttempted = true;
|
|
1683
|
+
step = "activity";
|
|
1658
1684
|
const activity = await conversations.activities(conversation.id).create({
|
|
1659
1685
|
type: "message",
|
|
1660
1686
|
text: params.text,
|
|
@@ -1687,6 +1713,7 @@ async function sendProactiveTeamsMessageToSession(params, deps) {
|
|
|
1687
1713
|
};
|
|
1688
1714
|
}
|
|
1689
1715
|
catch (error) {
|
|
1716
|
+
const status = errorStatus(error);
|
|
1690
1717
|
(0, runtime_1.emitNervesEvent)({
|
|
1691
1718
|
level: "error",
|
|
1692
1719
|
component: "senses",
|
|
@@ -1696,17 +1723,12 @@ async function sendProactiveTeamsMessageToSession(params, deps) {
|
|
|
1696
1723
|
friendId: params.friendId,
|
|
1697
1724
|
aadObjectId: aadInfo.aadObjectId,
|
|
1698
1725
|
sessionKey: params.sessionKey,
|
|
1726
|
+
step,
|
|
1727
|
+
...(status !== undefined ? { status } : {}),
|
|
1699
1728
|
reason: error instanceof Error ? error.message : String(error),
|
|
1700
1729
|
},
|
|
1701
1730
|
});
|
|
1702
|
-
|
|
1703
|
-
if (error && typeof error === "object") {
|
|
1704
|
-
if ("statusCode" in error)
|
|
1705
|
-
status = error.statusCode;
|
|
1706
|
-
else if ("status" in error)
|
|
1707
|
-
status = error.status;
|
|
1708
|
-
}
|
|
1709
|
-
const rejected = typeof status === "number" && status >= 400 && status < 500 && status !== 408 && status !== 409;
|
|
1731
|
+
const rejected = status !== undefined && status >= 400 && status < 500 && status !== 408 && status !== 409;
|
|
1710
1732
|
const state = !activityAttempted || rejected ? "not_sent" : "unknown";
|
|
1711
1733
|
return {
|
|
1712
1734
|
delivered: false, reason: "send_error",
|
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.1109",
|
|
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.1109",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|