@ouro.bot/cli 0.1.0-alpha.1316 → 0.1.0-alpha.1317
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.1317",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The A2A peer tools and bridge_manage now carry Ouro AX cards, and their refusals end with a code the card names."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1316",
|
|
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.1317</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -47,6 +47,7 @@ const transport_1 = require("../a2a/transport");
|
|
|
47
47
|
const relay_contacts_1 = require("../a2a/relay-contacts");
|
|
48
48
|
const delegation_stores_1 = require("../a2a/delegation-stores");
|
|
49
49
|
const mission_result_wire_1 = require("../a2a/mission-result-wire");
|
|
50
|
+
const tools_base_1 = require("./tools-base");
|
|
50
51
|
const outboundTaskTokens = new Map();
|
|
51
52
|
function tokenKey(ctx, friendId, taskId) {
|
|
52
53
|
return `${ctx?.agentRoot ?? "ambient"}\n${friendId}\n${taskId}`;
|
|
@@ -86,9 +87,9 @@ function storeFor(ctx) {
|
|
|
86
87
|
}
|
|
87
88
|
function requireTrustedRequester(ctx) {
|
|
88
89
|
if (!ctx?.context?.friend?.id)
|
|
89
|
-
return "no friend context — cannot use A2A tools.";
|
|
90
|
+
return (0, tools_base_1.withCode)("no friend context — cannot use A2A tools.", "no-friend-context");
|
|
90
91
|
if (!(0, friends_1.isTrustedLevel)(ctx.context.friend.trustLevel))
|
|
91
|
-
return "A2A tools require friend or family trust.";
|
|
92
|
+
return (0, tools_base_1.withCode)("A2A tools require friend or family trust.", "untrusted-requester");
|
|
92
93
|
return null;
|
|
93
94
|
}
|
|
94
95
|
function isA2APeer(friend) {
|
|
@@ -300,7 +301,7 @@ exports.a2aToolDefinitions = [
|
|
|
300
301
|
message: "connect_to refused (non-owner management sense)",
|
|
301
302
|
meta: { tool: "connect_to", senseType, reason: authorization.reason },
|
|
302
303
|
});
|
|
303
|
-
return `connect_to is available only from your own local management sense (the CLI you launched). This sense (${senseType}) is not permitted to link agents
|
|
304
|
+
return (0, tools_base_1.withCode)(`connect_to is available only from your own local management sense (the CLI you launched). This sense (${senseType}) is not permitted to link agents.`, "not-local-sense");
|
|
304
305
|
}
|
|
305
306
|
const agentName = agentNameFromRoot(ctx?.agentRoot);
|
|
306
307
|
// ONE store for both halves — the DID-keyed onboarding write and the
|
|
@@ -340,9 +341,15 @@ exports.a2aToolDefinitions = [
|
|
|
340
341
|
return `connected ${result.record.name} (${did ?? result.record.id}) at family trust.`;
|
|
341
342
|
}
|
|
342
343
|
catch (error) {
|
|
343
|
-
return `connect_to error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error failures @preserve */ String(error)}
|
|
344
|
+
return (0, tools_base_1.withCode)(`connect_to error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error failures @preserve */ String(error)}`, "connect-failed");
|
|
344
345
|
}
|
|
345
346
|
},
|
|
347
|
+
ax: { id: "tool:connect_to", group: "a2a", when: "Pick this when your owner, at their own terminal, hands you another agent's card link to add as a trusted peer you can then message.", effect: "write", errors: [
|
|
348
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
349
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
350
|
+
{ code: "not-local-sense", means: "Linking agents works only from the owner's own CLI session, and this turn came from another sense.", fix: "Ask your owner to make the link in a CLI session with you, where connect_to is allowed." },
|
|
351
|
+
{ code: "connect-failed", means: "Fetching the card, checking its DID or saving the peer failed; the reason follows the colon.", fix: "Check card_url opens the agent's /.well-known/agent-card.json, then try once more." },
|
|
352
|
+
] },
|
|
346
353
|
summaryKeys: ["card_url", "name"],
|
|
347
354
|
riskProfile: { mutates: "durable_state_write", risk: "high", reason: "links a new agent peer into the friend model at family trust" },
|
|
348
355
|
},
|
|
@@ -371,7 +378,7 @@ exports.a2aToolDefinitions = [
|
|
|
371
378
|
const store = storeFor(ctx);
|
|
372
379
|
const listAll = store.listAll;
|
|
373
380
|
if (!listAll)
|
|
374
|
-
return "friend store does not support listing.";
|
|
381
|
+
return (0, tools_base_1.withCode)("friend store does not support listing.", "no-peer-listing");
|
|
375
382
|
const peers = (await listAll.call(store)).filter(isA2APeer);
|
|
376
383
|
return JSON.stringify(peers.map((peer) => ({
|
|
377
384
|
id: peer.id,
|
|
@@ -381,6 +388,12 @@ exports.a2aToolDefinitions = [
|
|
|
381
388
|
cardUrl: peer.agentMeta?.a2a?.cardUrl,
|
|
382
389
|
})), null, 2);
|
|
383
390
|
},
|
|
391
|
+
ax: { id: "tool:a2a_list_peers", group: "a2a", when: "Pick this first when you need another agent's friend_id, or to see which agents you are linked with and how far each is trusted.", effect: "read", idempotent: true, errors: [
|
|
392
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
393
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
394
|
+
{ code: "no-peer-listing", means: "This friend store can't list its records, so no peers can be shown.", fix: "Use a friend_id you already know, or ask your owner which agents are linked." },
|
|
395
|
+
] },
|
|
396
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
384
397
|
summaryKeys: [],
|
|
385
398
|
},
|
|
386
399
|
{
|
|
@@ -412,9 +425,9 @@ exports.a2aToolDefinitions = [
|
|
|
412
425
|
return guard;
|
|
413
426
|
const peer = await storeFor(ctx).get(args.friend_id);
|
|
414
427
|
if (!peer || !isA2APeer(peer))
|
|
415
|
-
return `A2A peer not found: ${args.friend_id}
|
|
428
|
+
return (0, tools_base_1.withCode)(`A2A peer not found: ${args.friend_id}`, "peer-not-found");
|
|
416
429
|
if (!(0, friends_1.isTrustedLevel)(peer.trustLevel))
|
|
417
|
-
return "target A2A peer must be friend or family trust before outbound messages.";
|
|
430
|
+
return (0, tools_base_1.withCode)("target A2A peer must be friend or family trust before outbound messages.", "untrusted-peer");
|
|
418
431
|
// ROUTING (explicit, no impl judgment): a DID-keyed peer → seal+sign via
|
|
419
432
|
// sendShare over the direct rung (E2E, verified-DID inbound). A legacy peer
|
|
420
433
|
// with no pinned DID → the existing text send, byte-for-byte unchanged.
|
|
@@ -434,7 +447,7 @@ exports.a2aToolDefinitions = [
|
|
|
434
447
|
return deliveryText(peer.name, did, delivery);
|
|
435
448
|
}
|
|
436
449
|
catch (error) {
|
|
437
|
-
return `A2A sealed send error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error transport failures @preserve */ String(error)}
|
|
450
|
+
return (0, tools_base_1.withCode)(`A2A sealed send error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error transport failures @preserve */ String(error)}`, "send-failed");
|
|
438
451
|
}
|
|
439
452
|
}
|
|
440
453
|
try {
|
|
@@ -451,9 +464,16 @@ exports.a2aToolDefinitions = [
|
|
|
451
464
|
return JSON.stringify(redactTaskToken(task), null, 2);
|
|
452
465
|
}
|
|
453
466
|
catch (error) {
|
|
454
|
-
return `A2A send error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error transport failures */ String(error)}
|
|
467
|
+
return (0, tools_base_1.withCode)(`A2A send error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error transport failures */ String(error)}`, "send-failed");
|
|
455
468
|
}
|
|
456
469
|
},
|
|
470
|
+
ax: { id: "tool:a2a_send_message", group: "a2a", when: "Pick this to say something to another agent or ask it a one-off favour; for tracked work on a shared mission, coordinate records the request.", effect: "write", errors: [
|
|
471
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
472
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
473
|
+
{ code: "peer-not-found", means: "friend_id names no onboarded A2A agent peer.", fix: "Call a2a_list_peers and pass one of the ids it shows." },
|
|
474
|
+
{ code: "untrusted-peer", means: "That agent peer is below friend trust, so I won't talk to it.", fix: "Ask your owner to raise the peer's trust, or pick a trusted peer from a2a_list_peers." },
|
|
475
|
+
{ code: "send-failed", means: "The message didn't reach the peer; the transport's reason follows the colon.", fix: "Try once more later; if it fails again, tell your owner that peer can't be reached." },
|
|
476
|
+
] },
|
|
457
477
|
summaryKeys: ["friend_id", "session_key"],
|
|
458
478
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "sends a message to a remote agent peer" },
|
|
459
479
|
},
|
|
@@ -486,9 +506,9 @@ exports.a2aToolDefinitions = [
|
|
|
486
506
|
return guard;
|
|
487
507
|
const peer = await storeFor(ctx).get(args.friend_id);
|
|
488
508
|
if (!peer || !isA2APeer(peer))
|
|
489
|
-
return `A2A peer not found: ${args.friend_id}
|
|
509
|
+
return (0, tools_base_1.withCode)(`A2A peer not found: ${args.friend_id}`, "peer-not-found");
|
|
490
510
|
if (!(0, friends_1.isTrustedLevel)(peer.trustLevel))
|
|
491
|
-
return "target A2A peer must be friend or family trust before task lookup.";
|
|
511
|
+
return (0, tools_base_1.withCode)("target A2A peer must be friend or family trust before task lookup.", "untrusted-peer");
|
|
492
512
|
try {
|
|
493
513
|
const endpoint = await resolveA2AEndpoint(peer);
|
|
494
514
|
const task = await (0, client_1.getA2ATask)({
|
|
@@ -503,9 +523,17 @@ exports.a2aToolDefinitions = [
|
|
|
503
523
|
return JSON.stringify(redactTaskToken(task), null, 2);
|
|
504
524
|
}
|
|
505
525
|
catch (error) {
|
|
506
|
-
return `A2A task error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error transport failures */ String(error)}
|
|
526
|
+
return (0, tools_base_1.withCode)(`A2A task error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error transport failures */ String(error)}`, "task-fetch-failed");
|
|
507
527
|
}
|
|
508
528
|
},
|
|
529
|
+
ax: { id: "tool:a2a_get_task", group: "a2a", when: "Pick this after a2a_send_message gave you a task id, to see whether the other agent has finished it and what it answered.", effect: "read", idempotent: true, errors: [
|
|
530
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
531
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
532
|
+
{ code: "peer-not-found", means: "friend_id names no onboarded A2A agent peer.", fix: "Call a2a_list_peers and pass one of the ids it shows." },
|
|
533
|
+
{ code: "untrusted-peer", means: "That agent peer is below friend trust, so I won't talk to it.", fix: "Ask your owner to raise the peer's trust, or pick a trusted peer from a2a_list_peers." },
|
|
534
|
+
{ code: "task-fetch-failed", means: "The peer didn't return the task; its reason follows the colon.", fix: "Check task_id came from that same peer's reply; pass access_token if an outside agent gave you one." },
|
|
535
|
+
] },
|
|
536
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
509
537
|
summaryKeys: ["friend_id", "task_id"],
|
|
510
538
|
},
|
|
511
539
|
{
|
|
@@ -539,12 +567,12 @@ exports.a2aToolDefinitions = [
|
|
|
539
567
|
return guard;
|
|
540
568
|
const peer = await storeFor(ctx).get(args.friend_id);
|
|
541
569
|
if (!peer || !isA2APeer(peer))
|
|
542
|
-
return `A2A peer not found: ${args.friend_id}
|
|
570
|
+
return (0, tools_base_1.withCode)(`A2A peer not found: ${args.friend_id}`, "peer-not-found");
|
|
543
571
|
if (!(0, friends_1.isTrustedLevel)(peer.trustLevel))
|
|
544
|
-
return "target A2A peer must be friend or family trust before delegating.";
|
|
572
|
+
return (0, tools_base_1.withCode)("target A2A peer must be friend or family trust before delegating.", "untrusted-peer");
|
|
545
573
|
const did = peerDid(peer);
|
|
546
574
|
if (!did)
|
|
547
|
-
return "coordinate requires a DID-keyed peer (connect_to it first to pin its did:key).";
|
|
575
|
+
return (0, tools_base_1.withCode)("coordinate requires a DID-keyed peer (connect_to it first to pin its did:key).", "peer-not-did-keyed");
|
|
548
576
|
/* v8 ignore next -- in-turn coordinate always carries a bundle agentRoot; the ambient-name fallback is defensive (same pattern as connect_to) @preserve */
|
|
549
577
|
const agentName = agentNameFromRoot(ctx?.agentRoot) ?? "ouro-agent";
|
|
550
578
|
const store = storeFor(ctx);
|
|
@@ -587,9 +615,17 @@ exports.a2aToolDefinitions = [
|
|
|
587
615
|
return `coordinated: delegated "${args.task_summary}" to ${peer.name} on mission ${args.mission_key} (requestId ${requestId}).${queued}`;
|
|
588
616
|
}
|
|
589
617
|
catch (error) {
|
|
590
|
-
return `coordinate error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error failures @preserve */ String(error)}
|
|
618
|
+
return (0, tools_base_1.withCode)(`coordinate error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error failures @preserve */ String(error)}`, "coordinate-failed");
|
|
591
619
|
}
|
|
592
620
|
},
|
|
621
|
+
ax: { id: "tool:coordinate", group: "a2a", when: "Pick this to hand a piece of work on a named shared mission to another agent and track it until it answers with send_result.", effect: "write", errors: [
|
|
622
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
623
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
624
|
+
{ code: "peer-not-found", means: "friend_id names no onboarded A2A agent peer.", fix: "Call a2a_list_peers and pass one of the ids it shows." },
|
|
625
|
+
{ code: "untrusted-peer", means: "That agent peer is below friend trust, so I won't talk to it.", fix: "Ask your owner to raise the peer's trust, or pick a trusted peer from a2a_list_peers." },
|
|
626
|
+
{ code: "peer-not-did-keyed", means: "The peer has no pinned did:key, so the request can't be sealed to it.", fix: "Ask your owner to link the peer again with connect_to, which pins its DID." },
|
|
627
|
+
{ code: "coordinate-failed", means: "Recording or sealing the delegation failed; the reason follows the colon.", fix: "Read the reason, fix what it names, and call coordinate again with the same mission_key." },
|
|
628
|
+
] },
|
|
593
629
|
summaryKeys: ["friend_id", "mission_key"],
|
|
594
630
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "delegates a task to a remote agent peer" },
|
|
595
631
|
},
|
|
@@ -633,6 +669,11 @@ exports.a2aToolDefinitions = [
|
|
|
633
669
|
}
|
|
634
670
|
return JSON.stringify(rows, null, 2);
|
|
635
671
|
},
|
|
672
|
+
ax: { id: "tool:list_delegations", group: "a2a", when: "Pick this to check for jobs peers handed you before you start on them, and to find the requestId to answer with.", effect: "read", idempotent: true, errors: [
|
|
673
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
674
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
675
|
+
] },
|
|
676
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
636
677
|
summaryKeys: [],
|
|
637
678
|
},
|
|
638
679
|
{
|
|
@@ -670,24 +711,24 @@ exports.a2aToolDefinitions = [
|
|
|
670
711
|
const missions = missionStore.listAll ? await missionStore.listAll() : [];
|
|
671
712
|
const found = findImportedDelegation(missions, args.request_id);
|
|
672
713
|
if (!found)
|
|
673
|
-
return `no imported delegation found for requestId ${args.request_id} (check list_delegations)
|
|
714
|
+
return (0, tools_base_1.withCode)(`no imported delegation found for requestId ${args.request_id} (check list_delegations).`, "delegation-not-found");
|
|
674
715
|
// The delegator (the recipient of the result) must be a trusted, reachable,
|
|
675
716
|
// DID-keyed peer in our store.
|
|
676
717
|
const delegator = await (0, friends_1.findFriendByDid)(store, found.fromAgentId);
|
|
677
718
|
if (!delegator || !isA2APeer(delegator))
|
|
678
|
-
return `delegating peer not found for ${found.fromAgentId}
|
|
719
|
+
return (0, tools_base_1.withCode)(`delegating peer not found for ${found.fromAgentId}.`, "delegator-not-found");
|
|
679
720
|
if (!(0, friends_1.isTrustedLevel)(delegator.trustLevel))
|
|
680
|
-
return "delegating peer must be friend or family trust to return a result.";
|
|
721
|
+
return (0, tools_base_1.withCode)("delegating peer must be friend or family trust to return a result.", "untrusted-peer");
|
|
681
722
|
const delegatorDid = peerDid(delegator);
|
|
682
723
|
/* v8 ignore next -- unreachable: findFriendByDid matched this record BY its DID (via resolveAgentIdentity, which omits empty DIDs), so a2a.did is always present here. Defensive. @preserve */
|
|
683
724
|
if (!delegatorDid)
|
|
684
725
|
return "delegating peer is not DID-keyed (cannot seal the result).";
|
|
685
726
|
const parsedDelegator = (0, a2a_client_1.parseDidKey)(delegatorDid);
|
|
686
727
|
if (!parsedDelegator)
|
|
687
|
-
return `cannot seal: delegating peer DID is unparseable (${delegatorDid})
|
|
728
|
+
return (0, tools_base_1.withCode)(`cannot seal: delegating peer DID is unparseable (${delegatorDid}).`, "delegator-unreachable");
|
|
688
729
|
const endpointUrl = delegator.agentMeta?.a2a?.endpointUrl;
|
|
689
730
|
if (!endpointUrl)
|
|
690
|
-
return "delegating peer has no reachable A2A endpoint to return the result to.";
|
|
731
|
+
return (0, tools_base_1.withCode)("delegating peer has no reachable A2A endpoint to return the result to.", "delegator-unreachable");
|
|
691
732
|
/* v8 ignore next -- in-turn send_result always carries a bundle agentRoot; the ambient-name fallback is defensive (same pattern as connect_to) @preserve */
|
|
692
733
|
const agentName = agentNameFromRoot(ctx?.agentRoot) ?? "ouro-agent";
|
|
693
734
|
try {
|
|
@@ -733,9 +774,18 @@ exports.a2aToolDefinitions = [
|
|
|
733
774
|
: `${deliveryText(delegator.name, delegatorDid, delivery, "result")} (requestId ${args.request_id})`;
|
|
734
775
|
}
|
|
735
776
|
catch (error) {
|
|
736
|
-
return `send_result error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error failures @preserve */ String(error)}
|
|
777
|
+
return (0, tools_base_1.withCode)(`send_result error: ${error instanceof Error ? error.message : /* v8 ignore next -- defensive non-Error failures @preserve */ String(error)}`, "send-result-failed");
|
|
737
778
|
}
|
|
738
779
|
},
|
|
780
|
+
ax: { id: "tool:send_result", group: "a2a", when: "Pick this once you have finished work another agent delegated to you, to deliver the outcome back against its requestId.", effect: "write", errors: [
|
|
781
|
+
{ code: "no-friend-context", means: "This turn has no friend behind it, so A2A tools can't tell who is asking.", fix: "Use A2A tools only on a turn that a known friend or family member started." },
|
|
782
|
+
{ code: "untrusted-requester", means: "The person on this turn is below friend trust, and A2A tools need friend or family.", fix: "Tell them you can't reach other agents for them; your owner can raise their trust." },
|
|
783
|
+
{ code: "delegation-not-found", means: "No delegation sent to you has that request_id.", fix: "Call list_delegations and pass the requestId it shows." },
|
|
784
|
+
{ code: "delegator-not-found", means: "The agent that sent the delegation isn't a linked peer any more.", fix: "Ask your owner to link that agent again with connect_to, then send the result." },
|
|
785
|
+
{ code: "untrusted-peer", means: "The delegating agent is below friend trust, so I won't send it the result.", fix: "Ask your owner whether to raise its trust before you send." },
|
|
786
|
+
{ code: "delegator-unreachable", means: "The delegating agent's DID can't be read or it has no A2A endpoint, so the result can't be delivered.", fix: "Ask your owner to link that agent again with connect_to, which refreshes its DID and endpoint." },
|
|
787
|
+
{ code: "send-result-failed", means: "Sealing or delivering the result failed; the reason follows the colon.", fix: "Try send_result once more; if it fails again, tell your owner the result is ready but undelivered." },
|
|
788
|
+
] },
|
|
739
789
|
summaryKeys: ["request_id"],
|
|
740
790
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "returns a result to a remote agent peer" },
|
|
741
791
|
},
|
|
@@ -5,6 +5,7 @@ const config_1 = require("../heart/config");
|
|
|
5
5
|
const manager_1 = require("../heart/bridges/manager");
|
|
6
6
|
const runtime_1 = require("../nerves/runtime");
|
|
7
7
|
const session_transcript_1 = require("../heart/session-transcript");
|
|
8
|
+
const tools_base_1 = require("./tools-base");
|
|
8
9
|
const NO_SESSION_FOUND_MESSAGE = "no session found for that friend/channel/key combination.";
|
|
9
10
|
const EMPTY_SESSION_MESSAGE = "session exists but has no non-system messages.";
|
|
10
11
|
async function summarizeSessionTailSafely(options) {
|
|
@@ -72,11 +73,11 @@ exports.bridgeToolDefinitions = [
|
|
|
72
73
|
const action = (args.action || "").trim();
|
|
73
74
|
if (action === "begin") {
|
|
74
75
|
if (!ctx?.currentSession) {
|
|
75
|
-
return "bridge_manage begin requires an active session context.";
|
|
76
|
+
return (0, tools_base_1.withCode)("bridge_manage begin requires an active session context.", "no-active-session");
|
|
76
77
|
}
|
|
77
78
|
const objective = (args.objective || "").trim();
|
|
78
79
|
if (!objective)
|
|
79
|
-
return "objective is required for bridge begin.";
|
|
80
|
+
return (0, tools_base_1.withCode)("objective is required for bridge begin.", "missing-objective");
|
|
80
81
|
return (0, manager_1.formatBridgeStatus)(manager.beginBridge({
|
|
81
82
|
objective,
|
|
82
83
|
summary: (args.summary || objective).trim(),
|
|
@@ -85,14 +86,14 @@ exports.bridgeToolDefinitions = [
|
|
|
85
86
|
}
|
|
86
87
|
const bridgeId = (args.bridgeId || "").trim();
|
|
87
88
|
if (!bridgeId) {
|
|
88
|
-
return "bridgeId is required for this bridge action.";
|
|
89
|
+
return (0, tools_base_1.withCode)("bridgeId is required for this bridge action.", "missing-bridge-id");
|
|
89
90
|
}
|
|
90
91
|
if (action === "attach") {
|
|
91
92
|
const friendId = (args.friendId || "").trim();
|
|
92
93
|
const channel = (args.channel || "").trim();
|
|
93
94
|
const key = (args.key || "session").trim();
|
|
94
95
|
if (!friendId || !channel) {
|
|
95
|
-
return "friendId and channel are required for bridge attach.";
|
|
96
|
+
return (0, tools_base_1.withCode)("friendId and channel are required for bridge attach.", "missing-attach-target");
|
|
96
97
|
}
|
|
97
98
|
const sessionPath = (0, config_1.resolveSessionPath)(friendId, channel, key);
|
|
98
99
|
const sessionTail = await summarizeSessionTailSafely({
|
|
@@ -105,7 +106,7 @@ exports.bridgeToolDefinitions = [
|
|
|
105
106
|
summarize: ctx?.summarize,
|
|
106
107
|
});
|
|
107
108
|
if (sessionTail.kind === "missing") {
|
|
108
|
-
return NO_SESSION_FOUND_MESSAGE;
|
|
109
|
+
return (0, tools_base_1.withCode)(NO_SESSION_FOUND_MESSAGE, "session-not-found");
|
|
109
110
|
}
|
|
110
111
|
return (0, manager_1.formatBridgeStatus)(manager.attachSession(bridgeId, {
|
|
111
112
|
friendId,
|
|
@@ -118,7 +119,7 @@ exports.bridgeToolDefinitions = [
|
|
|
118
119
|
if (action === "status") {
|
|
119
120
|
const bridge = manager.getBridge(bridgeId);
|
|
120
121
|
if (!bridge)
|
|
121
|
-
return `bridge not found: ${bridgeId}
|
|
122
|
+
return (0, tools_base_1.withCode)(`bridge not found: ${bridgeId}`, "bridge-not-found");
|
|
122
123
|
return (0, manager_1.formatBridgeStatus)(bridge);
|
|
123
124
|
}
|
|
124
125
|
if (action === "promote_task") {
|
|
@@ -136,6 +137,14 @@ exports.bridgeToolDefinitions = [
|
|
|
136
137
|
}
|
|
137
138
|
return `unknown bridge action: ${action}`;
|
|
138
139
|
},
|
|
140
|
+
ax: { id: "tool:bridge_manage", group: "turn-sessions", when: "Pick this when one piece of work spans conversations already under way, such as two friends' chats, so each can share its status and progress.", effect: "write", errors: [
|
|
141
|
+
{ code: "no-active-session", means: "begin needs the conversation you're in, and this turn has none.", fix: "Start the bridge from a turn inside one of the conversations it should join." },
|
|
142
|
+
{ code: "missing-objective", means: "begin came without an objective.", fix: "Call begin again with objective set to the shared goal in one line." },
|
|
143
|
+
{ code: "missing-bridge-id", means: "Every action but begin needs bridgeId.", fix: "Pass the bridge id that begin returned." },
|
|
144
|
+
{ code: "missing-attach-target", means: "attach needs both friendId and channel.", fix: "Call attach again with the friend's id and the channel of their session, plus key if it isn't 'session'." },
|
|
145
|
+
{ code: "session-not-found", means: "No saved session matches that friendId, channel and key.", fix: "Check the friend, channel and key with query_session, then attach again." },
|
|
146
|
+
{ code: "bridge-not-found", means: "No bridge has that bridgeId.", fix: "Check the id from begin's reply, or begin a new bridge." },
|
|
147
|
+
] },
|
|
139
148
|
summaryKeys: ["action", "bridgeId", "objective", "friendId", "channel", "key"],
|
|
140
149
|
riskProfile: (args) => args.action === "status"
|
|
141
150
|
? { mutates: "none", risk: "low", reason: "bridge status is read-only" }
|
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.1317",
|
|
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.1317",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|