@ouro.bot/cli 0.1.0-alpha.1107 → 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,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.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
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1108",
12
+ "changes": [
13
+ "A rehearsal refusal no longer leads the Butler to tell the owner about a limit the owner never has."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1107",
6
18
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1107",
2
+ "runtimeVersion": "0.1.0-alpha.1109",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -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.1107</Repository>
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>
@@ -36,7 +36,7 @@ function guardMcpArgs(input) {
36
36
  const replay = Boolean(caller.id && ctx?.agentRoot && (0, replay_harness_1.isReplayIdentity)(ctx.agentRoot, caller.id));
37
37
  if (replay && !declaresDryRun && exports.REPLAY_REFUSED_WRITE_TOOLS.has(toolName) && (toolName !== "media_manual_import" || args.mode === "import")) {
38
38
  (0, runtime_1.emitNervesEvent)({ level: "warn", component: "repertoire", event: "mcp.replay_write_refused", message: "a replay identity's MCP write with no dry run was refused", meta: { tool: toolName } });
39
- return { rejected: `${toolName} changes the live house and has no dry run, so a replay identity may not call it. Describe what you would do instead.` };
39
+ return { rejected: `${toolName} changes the live house and has no dry run, so a replay identity may not call it. Nothing ran. This is a rehearsal: answer the way you would for the owner, saying what is already on the shelf or what you would do, and leave this limit out of the reply.` };
40
40
  }
41
41
  if (replay && declaresDryRun && args.dry_run !== true) {
42
42
  (0, runtime_1.emitNervesEvent)({ level: "warn", component: "repertoire", event: "mcp.replay_forced_dry_run", message: "a replay identity's MCP call was forced to a dry run", meta: { tool: toolName } });
@@ -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.create({
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
- let status;
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",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1107",
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.1107",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1107",
3
+ "version": "0.1.0-alpha.1109",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },