@ouro.bot/cli 0.1.0-alpha.218 → 0.1.0-alpha.219

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,10 +1,16 @@
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.219",
6
+ "changes": [
7
+ "fix: proactive message delivery — three bugs fixed. (1) surface tool now resolves friend names to UUIDs by scanning friends directory. (2) send_message tool also resolves friend names to UUIDs. (3) deliverCrossChatMessage no longer immediately queues generic_outreach — it now attempts delivery when a deliverer is available, with the deliverer's own trust checks still gating actual sends. Previously, any proactive send from inner dialog was silently queued without attempting delivery."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.218",
6
12
  "changes": [
7
- "fix: surface tool now resolves friend names to UUIDs — agents pass friend names (e.g. 'arimendelow') but sessions are stored under UUID directories. Added name-to-UUID resolution by scanning the friends directory when the friendId doesn't match a session directory."
13
+ "fix: surface tool now resolves friend names to UUIDs — agents pass friend names but sessions are stored under UUID directories. Added name-to-UUID resolution by scanning the friends directory when the friendId doesn't match a session directory."
8
14
  ]
9
15
  },
10
16
  {
@@ -38,31 +38,16 @@ async function deliverCrossChatMessage(request, deps) {
38
38
  authorizingTrustLevel: request.authorizingSession?.trustLevel ?? null,
39
39
  },
40
40
  });
41
- if (request.intent === "generic_outreach") {
42
- const result = queueForLater(request, deps, "generic outreach stays queued until the target session is next active");
43
- (0, runtime_1.emitNervesEvent)({
44
- component: "engine",
45
- event: "engine.cross_chat_delivery_end",
46
- message: "queued generic outreach for later delivery",
47
- meta: {
48
- friendId: request.friendId,
49
- channel: request.channel,
50
- key: request.key,
51
- status: result.status,
52
- },
53
- });
54
- return result;
55
- }
56
- if (!isExplicitlyAuthorized(request)) {
41
+ if (!isExplicitlyAuthorized(request) && request.intent !== "generic_outreach") {
57
42
  const result = {
58
43
  status: "blocked",
59
- detail: "explicit cross-chat delivery requires a trusted asking session",
44
+ detail: "cross-chat delivery requires a trusted asking session or generic outreach intent",
60
45
  };
61
46
  (0, runtime_1.emitNervesEvent)({
62
47
  level: "warn",
63
48
  component: "engine",
64
49
  event: "engine.cross_chat_delivery_end",
65
- message: "blocked explicit cross-chat delivery",
50
+ message: "blocked cross-chat delivery",
66
51
  meta: {
67
52
  friendId: request.friendId,
68
53
  channel: request.channel,
@@ -435,12 +435,34 @@ exports.sessionToolDefinitions = [
435
435
  },
436
436
  },
437
437
  handler: async (args, ctx) => {
438
- const friendId = args.friendId;
438
+ let friendId = args.friendId;
439
439
  const channel = args.channel;
440
440
  const key = args.key || "session";
441
441
  const content = args.content;
442
442
  const now = Date.now();
443
443
  const agentName = (0, identity_1.getAgentName)();
444
+ // Resolve friend name → UUID if needed
445
+ /* v8 ignore start -- name resolution: reads real filesystem, tested via live integration @preserve */
446
+ if (friendId !== "self") {
447
+ try {
448
+ const agentRoot = (0, identity_1.getAgentRoot)();
449
+ const sessionsDir = path.join(agentRoot, "state", "sessions");
450
+ const friendsDir = path.join(agentRoot, "friends");
451
+ if (!fs.existsSync(path.join(sessionsDir, friendId))) {
452
+ const friendFiles = fs.readdirSync(friendsDir).filter((f) => f.endsWith(".json"));
453
+ for (const file of friendFiles) {
454
+ const raw = fs.readFileSync(path.join(friendsDir, file), "utf-8");
455
+ const record = JSON.parse(raw);
456
+ if (record.name?.toLowerCase() === friendId.toLowerCase() && record.id) {
457
+ friendId = record.id;
458
+ break;
459
+ }
460
+ }
461
+ }
462
+ }
463
+ catch { /* continue with original friendId */ }
464
+ }
465
+ /* v8 ignore stop */
444
466
  // Self-routing: messages to "self" always go to inner dialog pending dir,
445
467
  // regardless of the channel or key the agent specified.
446
468
  const isSelf = friendId === "self";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.218",
3
+ "version": "0.1.0-alpha.219",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",