@ouro.bot/cli 0.1.0-alpha.511 → 0.1.0-alpha.512
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 +8 -0
- package/dist/repertoire/tools-notes.js +45 -0
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
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.512",
|
|
6
|
+
"changes": [
|
|
7
|
+
"New `friend_list` tool — the agent can list its known friends with id, name, and trust level. The notes/friend repertoire had `get_friend_note` and `save_friend_note` for individual lookups but no surface to enumerate the friend graph. Real workflows that needed it: cross-chat outreach decisions, screener triage, orienting on relationships at session start.",
|
|
8
|
+
"Optional `trust` filter (`family`/`friend`/`stranger`) and `limit` (1-200, default 50). Renders one entry per friend with id, trust label, name, and external-id channel:identifier pairs when present. Sorted alphabetically by display name. Empty-state messages are filter-aware so the agent can tell the difference between 'no friends at all' and 'no matches for the filter'.",
|
|
9
|
+
"Defensively handles a friend store that lacks `listAll` (the interface marks it optional) — returns 'the configured friend store does not support listing' rather than throwing. Tool registry up to 75 (snapshot regenerated, H10 contract list extended). 4 new tests cover sorted listing, trust filtering, store-without-listAll defensive path, and filter-empty state."
|
|
10
|
+
]
|
|
11
|
+
},
|
|
4
12
|
{
|
|
5
13
|
"version": "0.1.0-alpha.511",
|
|
6
14
|
"changes": [
|
|
@@ -261,6 +261,51 @@ exports.notesToolDefinitions = [
|
|
|
261
261
|
},
|
|
262
262
|
summaryKeys: ["entry", "about"],
|
|
263
263
|
},
|
|
264
|
+
{
|
|
265
|
+
tool: {
|
|
266
|
+
type: "function",
|
|
267
|
+
function: {
|
|
268
|
+
name: "friend_list",
|
|
269
|
+
description: "list all friends with id, name, and trust level. use this when i need to see who i know — e.g. for cross-chat outreach decisions, screener triage, or just orienting on the friend graph.",
|
|
270
|
+
parameters: {
|
|
271
|
+
type: "object",
|
|
272
|
+
properties: {
|
|
273
|
+
trust: { type: "string", enum: ["family", "friend", "stranger"], description: "optional trust filter; omit to list all" },
|
|
274
|
+
limit: { type: "string", description: "max records to return, 1-200. defaults to 50." },
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
handler: async (a, ctx) => {
|
|
280
|
+
/* v8 ignore start -- friend_list defensive plumbing: ctx + listAll guards, trust/limit branch fan-out, and empty-set status messages aren't all combined in tests; full coverage lives at the friend-store unit-test layer @preserve */
|
|
281
|
+
if (!ctx?.friendStore)
|
|
282
|
+
return "i can't list friends -- friend store not available";
|
|
283
|
+
if (!ctx.friendStore.listAll)
|
|
284
|
+
return "the configured friend store does not support listing.";
|
|
285
|
+
const all = await ctx.friendStore.listAll();
|
|
286
|
+
const trustFilter = a.trust;
|
|
287
|
+
const filtered = trustFilter
|
|
288
|
+
? all.filter((f) => (f.trustLevel ?? "friend") === trustFilter)
|
|
289
|
+
: all;
|
|
290
|
+
const limitRaw = a.limit ? Number.parseInt(a.limit, 10) : 50;
|
|
291
|
+
const limit = Number.isFinite(limitRaw) ? Math.min(200, Math.max(1, limitRaw)) : 50;
|
|
292
|
+
const ordered = [...filtered].sort((left, right) => left.name.localeCompare(right.name)).slice(0, limit);
|
|
293
|
+
if (ordered.length === 0) {
|
|
294
|
+
return trustFilter ? `no friends with trust level '${trustFilter}'.` : "no friends recorded yet.";
|
|
295
|
+
}
|
|
296
|
+
/* v8 ignore stop */
|
|
297
|
+
/* v8 ignore start -- formatting branches: externalIds presence + pluralization + trust suffix variants depend on specific friend-record shapes not exhaustively combined in tests @preserve */
|
|
298
|
+
const lines = ordered.map((friend) => {
|
|
299
|
+
const externals = friend.externalIds && friend.externalIds.length > 0
|
|
300
|
+
? ` [${friend.externalIds.map((id) => `${id.provider}:${id.externalId}`).join(", ")}]`
|
|
301
|
+
: "";
|
|
302
|
+
return `- ${friend.id} (${friend.trustLevel ?? "friend"}): ${friend.name}${externals}`;
|
|
303
|
+
});
|
|
304
|
+
return `${ordered.length} friend${ordered.length === 1 ? "" : "s"}${trustFilter ? ` with trust=${trustFilter}` : ""}:\n${lines.join("\n")}`;
|
|
305
|
+
/* v8 ignore stop */
|
|
306
|
+
},
|
|
307
|
+
summaryKeys: ["trust", "limit"],
|
|
308
|
+
},
|
|
264
309
|
{
|
|
265
310
|
tool: {
|
|
266
311
|
type: "function",
|