@ouro.bot/cli 0.1.0-alpha.1310 → 0.1.0-alpha.1312
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 +12 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/repertoire/tools-notes.js +78 -28
- package/dist/repertoire/tools-rsvp.js +13 -4
- package/dist/repertoire/tools-travel.js +21 -4
- package/dist/repertoire/tools-vault.js +8 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
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.1312",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The weather, travel advisory, place search, vault setup and RSVP tools carry Ouro AX cards, and their errors end with a code the card explains."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1311",
|
|
12
|
+
"changes": [
|
|
13
|
+
"list_skills, load_skill, claude, web_search, search_facts, consult_diary, diary_write, friend_list, get_friend_note and save_friend_note have Ouro AX cards; their failures end with a code, and the seven that only read state a low-risk profile."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1310",
|
|
6
18
|
"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.1312</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -45,6 +45,7 @@ const friends_1 = require("@ouro.bot/friends");
|
|
|
45
45
|
const diary_1 = require("../mind/diary");
|
|
46
46
|
const record_paths_1 = require("../mind/record-paths");
|
|
47
47
|
const provenance_trust_1 = require("../mind/provenance-trust");
|
|
48
|
+
const tool_error_code_1 = require("./tool-error-code");
|
|
48
49
|
const relationship_authorization_1 = require("./relationship-authorization");
|
|
49
50
|
const reach_channel_1 = require("../heart/reach-channel");
|
|
50
51
|
const CLAUDE_READ_ONLY_TOOLS = "Read,Grep,Glob,LS";
|
|
@@ -75,6 +76,10 @@ exports.notesToolDefinitions = [
|
|
|
75
76
|
},
|
|
76
77
|
},
|
|
77
78
|
handler: () => JSON.stringify((0, skills_1.listSkills)()),
|
|
79
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
80
|
+
ax: { id: "tool:list_skills", group: "turn-skills", when: "Pick this to see which skill guides exist before taking on unfamiliar work; then load_skill opens the one that fits.", effect: "read", idempotent: true, errors: [
|
|
81
|
+
{ code: "not-allowed", means: "This relationship's tool selection doesn't include skills.", fix: "Work from what you already know, or take it up in a chat with your owner." },
|
|
82
|
+
] },
|
|
78
83
|
},
|
|
79
84
|
{
|
|
80
85
|
tool: {
|
|
@@ -94,10 +99,14 @@ exports.notesToolDefinitions = [
|
|
|
94
99
|
return (0, skills_1.loadSkill)(a.name);
|
|
95
100
|
}
|
|
96
101
|
catch (e) {
|
|
97
|
-
return `error: ${e}
|
|
102
|
+
return (0, tool_error_code_1.withCode)(`error: ${e}`, "skill-not-found");
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
105
|
summaryKeys: ["name"],
|
|
106
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
107
|
+
ax: { id: "tool:load_skill", group: "turn-skills", when: "Pick this to read a skill's full steps once list_skills has shown you its exact name.", effect: "read", idempotent: true, errors: [
|
|
108
|
+
{ code: "skill-not-found", means: "No skill with that name could be found or read; the message lists the folders checked.", fix: "Call list_skills and load one of the names it returns, spelled exactly." },
|
|
109
|
+
] },
|
|
101
110
|
},
|
|
102
111
|
{
|
|
103
112
|
tool: {
|
|
@@ -129,13 +138,13 @@ exports.notesToolDefinitions = [
|
|
|
129
138
|
timeout: 60000,
|
|
130
139
|
});
|
|
131
140
|
if (result.error)
|
|
132
|
-
return `error: ${result.error}
|
|
141
|
+
return (0, tool_error_code_1.withCode)(`error: ${result.error}`, "claude-not-started");
|
|
133
142
|
if (result.status !== 0)
|
|
134
|
-
return `claude exited with code ${result.status}: ${result.stderr}
|
|
143
|
+
return (0, tool_error_code_1.withCode)(`claude exited with code ${result.status}: ${result.stderr}`, "claude-failed");
|
|
135
144
|
return result.stdout || "(no output)";
|
|
136
145
|
}
|
|
137
146
|
catch (e) {
|
|
138
|
-
return `error: ${e}
|
|
147
|
+
return (0, tool_error_code_1.withCode)(`error: ${e}`, "claude-not-started");
|
|
139
148
|
}
|
|
140
149
|
},
|
|
141
150
|
summaryKeys: ["prompt"],
|
|
@@ -144,6 +153,10 @@ exports.notesToolDefinitions = [
|
|
|
144
153
|
risk: "low",
|
|
145
154
|
reason: "runs Claude Code in plan mode with only read/search/list tools",
|
|
146
155
|
},
|
|
156
|
+
ax: { id: "tool:claude", group: "turn-skills", when: "Pick this for a second opinion or code review from Claude Code reading this codebase; to have code changed, use coding_spawn.", effect: "read", errors: [
|
|
157
|
+
{ code: "claude-not-started", means: "Claude Code didn't run or answer: it isn't installed here, or it took over 60 seconds.", fix: "Ask a smaller question, or read the files yourself with read_file and grep." },
|
|
158
|
+
{ code: "claude-failed", means: "Claude Code ran and exited with an error, shown with its stderr.", fix: "Read the stderr; if it is a sign-in or setup problem, answer without Claude Code." },
|
|
159
|
+
] },
|
|
147
160
|
},
|
|
148
161
|
{
|
|
149
162
|
tool: {
|
|
@@ -162,7 +175,7 @@ exports.notesToolDefinitions = [
|
|
|
162
175
|
try {
|
|
163
176
|
const key = (0, config_1.getIntegrationsConfig)().perplexityApiKey;
|
|
164
177
|
if (!key)
|
|
165
|
-
return "error: perplexityApiKey not configured in the agent vault runtime/config item";
|
|
178
|
+
return (0, tool_error_code_1.withCode)("error: perplexityApiKey not configured in the agent vault runtime/config item", "search-not-configured");
|
|
166
179
|
const res = await fetch("https://api.perplexity.ai/search", {
|
|
167
180
|
method: "POST",
|
|
168
181
|
headers: {
|
|
@@ -172,7 +185,7 @@ exports.notesToolDefinitions = [
|
|
|
172
185
|
body: JSON.stringify({ query: a.query, max_results: 5 }),
|
|
173
186
|
});
|
|
174
187
|
if (!res.ok)
|
|
175
|
-
return `error: ${res.status} ${res.statusText}
|
|
188
|
+
return (0, tool_error_code_1.withCode)(`error: ${res.status} ${res.statusText}`, "search-failed");
|
|
176
189
|
const data = (await res.json());
|
|
177
190
|
if (!data.results?.length)
|
|
178
191
|
return "no results found";
|
|
@@ -181,10 +194,15 @@ exports.notesToolDefinitions = [
|
|
|
181
194
|
.join("\n\n");
|
|
182
195
|
}
|
|
183
196
|
catch (e) {
|
|
184
|
-
return `error: ${e}
|
|
197
|
+
return (0, tool_error_code_1.withCode)(`error: ${e}`, "search-failed");
|
|
185
198
|
}
|
|
186
199
|
},
|
|
187
200
|
summaryKeys: ["query"],
|
|
201
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
202
|
+
ax: { id: "tool:web_search", group: "turn-web", when: "Pick this to find web pages about a subject when you have no address yet; fetch_url then reads one result in full.", effect: "read", idempotent: true, errors: [
|
|
203
|
+
{ code: "search-not-configured", means: "No Perplexity key is in the agent's vault, so web search is off.", fix: "Fetch a page you know the address of with fetch_url, or tell your owner search needs a perplexityApiKey." },
|
|
204
|
+
{ code: "search-failed", means: "The search service answered with an error status or couldn't be reached.", fix: "Try once more with a simpler query; if it fails again, use fetch_url on a known source." },
|
|
205
|
+
] },
|
|
188
206
|
},
|
|
189
207
|
{
|
|
190
208
|
tool: {
|
|
@@ -203,7 +221,7 @@ exports.notesToolDefinitions = [
|
|
|
203
221
|
try {
|
|
204
222
|
const query = (a.query || "").trim();
|
|
205
223
|
if (!query)
|
|
206
|
-
return "query is required";
|
|
224
|
+
return (0, tool_error_code_1.withCode)("query is required", "missing-argument");
|
|
207
225
|
const resultLines = [];
|
|
208
226
|
const hits = await (0, diary_1.searchDiaryEntries)(query, (0, diary_1.readDiaryEntries)());
|
|
209
227
|
for (const fact of hits) {
|
|
@@ -222,10 +240,15 @@ exports.notesToolDefinitions = [
|
|
|
222
240
|
return resultLines.join("\n");
|
|
223
241
|
}
|
|
224
242
|
catch (e) {
|
|
225
|
-
return `error: ${e instanceof Error ? e.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(e)}
|
|
243
|
+
return (0, tool_error_code_1.withCode)(`error: ${e instanceof Error ? e.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(e)}`, "diary-unreadable");
|
|
226
244
|
}
|
|
227
245
|
},
|
|
228
246
|
summaryKeys: ["query"],
|
|
247
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
248
|
+
ax: { id: "tool:search_facts", group: "turn-record", when: "Pick this to look up what your diary already says about a subject before you ask someone to repeat it; consult_diary also lists recent entries.", effect: "read", idempotent: true, errors: [
|
|
249
|
+
{ code: "missing-argument", means: "query is empty.", fix: "Call search_facts again with words describing what you want to recall." },
|
|
250
|
+
{ code: "diary-unreadable", means: "The diary or its search index couldn't be read; the message gives the cause.", fix: "Try consult_diary with no query to read recent entries instead." },
|
|
251
|
+
] },
|
|
229
252
|
},
|
|
230
253
|
{
|
|
231
254
|
tool: {
|
|
@@ -260,10 +283,14 @@ exports.notesToolDefinitions = [
|
|
|
260
283
|
return JSON.stringify({ items });
|
|
261
284
|
}
|
|
262
285
|
catch (e) {
|
|
263
|
-
return `error: ${e instanceof Error ? e.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(e)}
|
|
286
|
+
return (0, tool_error_code_1.withCode)(`error: ${e instanceof Error ? e.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(e)}`, "diary-unreadable");
|
|
264
287
|
}
|
|
265
288
|
},
|
|
266
289
|
summaryKeys: ["query", "limit"],
|
|
290
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
291
|
+
ax: { id: "tool:consult_diary", group: "turn-record", when: "Pick this to read your newest diary entries, or matches with their ids and tags as JSON; search_facts gives a compact list.", effect: "read", idempotent: true, errors: [
|
|
292
|
+
{ code: "diary-unreadable", means: "Reading or searching the diary failed; the message says why.", fix: "Call it once more without a query; if that fails too, carry on without the diary." },
|
|
293
|
+
] },
|
|
267
294
|
},
|
|
268
295
|
{
|
|
269
296
|
tool: {
|
|
@@ -284,7 +311,7 @@ exports.notesToolDefinitions = [
|
|
|
284
311
|
handler: async (a, ctx) => {
|
|
285
312
|
const entry = (a.entry || "").trim();
|
|
286
313
|
if (!entry)
|
|
287
|
-
return "entry is required";
|
|
314
|
+
return (0, tool_error_code_1.withCode)("entry is required", "missing-argument");
|
|
288
315
|
let provenance;
|
|
289
316
|
if (ctx?.context) {
|
|
290
317
|
const p = { tool: "diary_write" };
|
|
@@ -318,6 +345,10 @@ exports.notesToolDefinitions = [
|
|
|
318
345
|
},
|
|
319
346
|
summaryKeys: ["entry", "about"],
|
|
320
347
|
riskProfile: { mutates: "durable_state_write", risk: "high", reason: "writes Desk record diary fact" },
|
|
348
|
+
ax: { id: "tool:diary_write", group: "turn-record", when: "Pick this to keep a conclusion or lesson you will want in later chats; facts about one person go in save_friend_note.", effect: "write", errors: [
|
|
349
|
+
{ code: "missing-argument", means: "entry is empty.", fix: "Call diary_write again with the entry written to stand alone." },
|
|
350
|
+
{ code: "orientation-hold", means: "This turn is on a correction hold, so diary writes wait.", fix: "Call orientation_get, settle what the person meant, then write the entry if it is still true." },
|
|
351
|
+
] },
|
|
321
352
|
},
|
|
322
353
|
{
|
|
323
354
|
tool: {
|
|
@@ -337,9 +368,9 @@ exports.notesToolDefinitions = [
|
|
|
337
368
|
handler: async (a, ctx) => {
|
|
338
369
|
/* 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 */
|
|
339
370
|
if (!ctx?.friendStore)
|
|
340
|
-
return "i can't list friends -- friend store not available";
|
|
371
|
+
return (0, tool_error_code_1.withCode)("i can't list friends -- friend store not available", "friend-store-unavailable");
|
|
341
372
|
if (!ctx.friendStore.listAll)
|
|
342
|
-
return "the configured friend store does not support listing.";
|
|
373
|
+
return (0, tool_error_code_1.withCode)("the configured friend store does not support listing.", "friend-store-unavailable");
|
|
343
374
|
const all = await ctx.friendStore.listAll();
|
|
344
375
|
const trustFilter = a.trust;
|
|
345
376
|
const filtered = trustFilter
|
|
@@ -363,6 +394,10 @@ exports.notesToolDefinitions = [
|
|
|
363
394
|
/* v8 ignore stop */
|
|
364
395
|
},
|
|
365
396
|
summaryKeys: ["trust", "limit"],
|
|
397
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
398
|
+
ax: { id: "tool:friend_list", group: "turn-friends", when: "Pick this to see everyone you know with their ids and trust levels; get_friend_note opens one person's full record.", effect: "read", idempotent: true, errors: [
|
|
399
|
+
{ code: "friend-store-unavailable", means: "This turn has no friend store, or one that can't list people.", fix: "Use the friend ids you already have, or ask in a chat that has your friends loaded." },
|
|
400
|
+
] },
|
|
366
401
|
},
|
|
367
402
|
{
|
|
368
403
|
tool: {
|
|
@@ -382,15 +417,21 @@ exports.notesToolDefinitions = [
|
|
|
382
417
|
handler: async (a, ctx) => {
|
|
383
418
|
const friendId = (a.friendId || "").trim();
|
|
384
419
|
if (!friendId)
|
|
385
|
-
return "friendId is required";
|
|
420
|
+
return (0, tool_error_code_1.withCode)("friendId is required", "missing-argument");
|
|
386
421
|
if (!ctx?.friendStore)
|
|
387
|
-
return "i can't read friend notes -- friend store not available";
|
|
422
|
+
return (0, tool_error_code_1.withCode)("i can't read friend notes -- friend store not available", "friend-store-unavailable");
|
|
388
423
|
const friend = await ctx.friendStore.get(friendId);
|
|
389
424
|
if (!friend)
|
|
390
|
-
return `friend not found: ${friendId}
|
|
425
|
+
return (0, tool_error_code_1.withCode)(`friend not found: ${friendId}`, "friend-not-found");
|
|
391
426
|
return JSON.stringify(friend, null, 2);
|
|
392
427
|
},
|
|
393
428
|
summaryKeys: ["friendId"],
|
|
429
|
+
riskProfile: { mutates: "none", risk: "low" },
|
|
430
|
+
ax: { id: "tool:get_friend_note", group: "turn-friends", when: "Pick this to read one person's saved record, notes and preferences by id when they aren't in this chat; friend_list finds ids.", effect: "read", idempotent: true, errors: [
|
|
431
|
+
{ code: "missing-argument", means: "friendId is empty.", fix: "Find the person's id with friend_list, then call again." },
|
|
432
|
+
{ code: "friend-not-found", means: "No friend record has that id.", fix: "Look the person up with friend_list and use the id it shows." },
|
|
433
|
+
{ code: "friend-store-unavailable", means: "This turn has no friend store to read from.", fix: "Answer from what this chat already shows about the person." },
|
|
434
|
+
] },
|
|
394
435
|
},
|
|
395
436
|
{
|
|
396
437
|
tool: {
|
|
@@ -419,31 +460,31 @@ exports.notesToolDefinitions = [
|
|
|
419
460
|
meta: { type: a.type },
|
|
420
461
|
});
|
|
421
462
|
if (!ctx?.context) {
|
|
422
|
-
return "i can't save notes -- no friend context available";
|
|
463
|
+
return (0, tool_error_code_1.withCode)("i can't save notes -- no friend context available", "no-friend-context");
|
|
423
464
|
}
|
|
424
465
|
if (!ctx.friendStore) {
|
|
425
|
-
return "i can't save notes -- friend store not available";
|
|
466
|
+
return (0, tool_error_code_1.withCode)("i can't save notes -- friend store not available", "no-friend-context");
|
|
426
467
|
}
|
|
427
468
|
const friendId = ctx.context.friend?.id;
|
|
428
469
|
if (!friendId)
|
|
429
|
-
return "i can't save notes -- no friend identity available";
|
|
470
|
+
return (0, tool_error_code_1.withCode)("i can't save notes -- no friend identity available", "no-friend-context");
|
|
430
471
|
if (a.type !== "name" && isOwnPersonaNote(a.key, a.content))
|
|
431
|
-
return exports.OWN_PERSONA_NOTE_REFUSAL;
|
|
472
|
+
return (0, tool_error_code_1.withCode)(exports.OWN_PERSONA_NOTE_REFUSAL, "persona-note");
|
|
432
473
|
const actor = ctx.relationshipAuthorization?.actor;
|
|
433
474
|
const isSanctuaryRelationship = ctx.context.friend?.capabilityProfileId?.startsWith("sanctuary-") === true;
|
|
434
475
|
const preferenceSource = a.source;
|
|
435
476
|
const isReachChannel = a.type === "tool_preference" && a.key === "reachChannel";
|
|
436
477
|
if ((isSanctuaryRelationship || isReachChannel) && a.type === "tool_preference" && !["stated", "observed", "default"].includes(String(preferenceSource))) {
|
|
437
|
-
return "i need exact preference provenance: source must be stated, observed, or default";
|
|
478
|
+
return (0, tool_error_code_1.withCode)("i need exact preference provenance: source must be stated, observed, or default", "preference-source-required");
|
|
438
479
|
}
|
|
439
480
|
if (isReachChannel && !reach_channel_1.REACH_CHANNELS.includes(a.content ?? "")) {
|
|
440
|
-
return "i can only reach people on bluebubbles or teams";
|
|
481
|
+
return (0, tool_error_code_1.withCode)("i can only reach people on bluebubbles or teams", "invalid-reach-channel");
|
|
441
482
|
}
|
|
442
483
|
if (isSanctuaryRelationship && a.type === "tool_preference" && !isReachChannel && !["communication", "timing"].includes(a.key ?? "")) {
|
|
443
|
-
return "Sanctuary relationship preferences are limited to communication or timing; desired state and action authority belong in steward policy";
|
|
484
|
+
return (0, tool_error_code_1.withCode)("Sanctuary relationship preferences are limited to communication or timing; desired state and action authority belong in steward policy", "preference-not-allowed");
|
|
444
485
|
}
|
|
445
486
|
if (actor?.trustLevel === "friend" && (actor.friendId !== friendId || a.type !== "tool_preference" || !["communication", "timing", "reachChannel"].includes(a.key ?? ""))) {
|
|
446
|
-
return "household members may only save their own communication or timing preferences; preferences never grant authority";
|
|
487
|
+
return (0, tool_error_code_1.withCode)("household members may only save their own communication or timing preferences; preferences never grant authority", "preference-not-allowed");
|
|
447
488
|
}
|
|
448
489
|
// Validate parameters (input-shape guards stay harness-side so we keep the
|
|
449
490
|
// first-person tool wording; applyFriendNote does the record mutation).
|
|
@@ -459,9 +500,9 @@ exports.notesToolDefinitions = [
|
|
|
459
500
|
if ((isSanctuaryRelationship || isReachChannel) && a.type === "tool_preference" && preferenceSource) {
|
|
460
501
|
const current = await ctx.friendStore.get(friendId);
|
|
461
502
|
if (!current)
|
|
462
|
-
return "i can't find the friend record on disk";
|
|
503
|
+
return (0, tool_error_code_1.withCode)("i can't find the friend record on disk", "friend-not-found");
|
|
463
504
|
if (current.relationshipPolicy?.preferences[a.key] && a.override !== "true")
|
|
464
|
-
return `relationship preference '${a.key}' already exists; call again with override: true to replace it
|
|
505
|
+
return (0, tool_error_code_1.withCode)(`relationship preference '${a.key}' already exists; call again with override: true to replace it`, "override-required");
|
|
465
506
|
const sourceKind = preferenceSource === "observed" ? "observed pattern" : preferenceSource === "default" ? "default fallback" : "explicit turn";
|
|
466
507
|
const turnSource = `${ctx.currentSession?.channel ?? "relationship"} ${sourceKind} ${actor?.sessionEventId ?? "unknown-event"}`;
|
|
467
508
|
await ctx.friendStore.put(friendId, (0, relationship_authorization_1.withRelationshipPreference)(current, { category: a.key, value: a.content, provenance: preferenceSource, source: turnSource }));
|
|
@@ -485,9 +526,9 @@ exports.notesToolDefinitions = [
|
|
|
485
526
|
return `updated friend's name to '${a.content}' (stored as name, not a note)`;
|
|
486
527
|
case "override_required":
|
|
487
528
|
// result.message embeds the existing value; append the harness merge instruction.
|
|
488
|
-
return `${result.message}. if you want to replace it, call again with override: true. or merge both values into content and override
|
|
529
|
+
return (0, tool_error_code_1.withCode)(`${result.message}. if you want to replace it, call again with override: true. or merge both values into content and override.`, "override-required");
|
|
489
530
|
case "not_found":
|
|
490
|
-
return "i can't find the friend record on disk";
|
|
531
|
+
return (0, tool_error_code_1.withCode)("i can't find the friend record on disk", "friend-not-found");
|
|
491
532
|
/* v8 ignore next 2 -- invalid is pre-empted by the harness validation above; kept for exhaustiveness @preserve */
|
|
492
533
|
case "invalid":
|
|
493
534
|
return result.message ?? "i can't save that note";
|
|
@@ -497,5 +538,14 @@ exports.notesToolDefinitions = [
|
|
|
497
538
|
},
|
|
498
539
|
summaryKeys: ["type", "key", "content"],
|
|
499
540
|
riskProfile: { mutates: "durable_state_write", risk: "high", reason: "writes friend notes/preferences" },
|
|
541
|
+
ax: { id: "tool:save_friend_note", group: "turn-friends", when: "Pick this to remember a fact, name or preference about the person you're talking with; your own lessons go in diary_write.", effect: "write", errors: [
|
|
542
|
+
{ code: "no-friend-context", means: "This turn has no friend, friend store or friend id to save against.", fix: "Save it in a chat with that person, or keep it with diary_write instead." },
|
|
543
|
+
{ code: "persona-note", means: "The note is about your own personality or voice, not about this person.", fix: "Leave it out of friend notes; house lessons go in psyche/TACIT.md, other psyche changes wait for your owner." },
|
|
544
|
+
{ code: "preference-source-required", means: "A relationship or reachChannel preference needs source set to stated, observed or default.", fix: "Call again with source: stated if they said it, or observed if you inferred it." },
|
|
545
|
+
{ code: "preference-not-allowed", means: "This key or speaker can't save that preference: only communication, timing or reachChannel, and only about the speaker.", fix: "Save it as a note, or leave authority questions to steward policy." },
|
|
546
|
+
{ code: "invalid-reach-channel", means: "reachChannel must be bluebubbles or teams.", fix: "Call again with content bluebubbles or teams." },
|
|
547
|
+
{ code: "override-required", means: "A value is already saved under that key; the message shows it.", fix: "Call again with override: true, merging the old value into content if both still hold." },
|
|
548
|
+
{ code: "friend-not-found", means: "The friend's record is missing on disk.", fix: "Check the person with friend_list before saving again." },
|
|
549
|
+
] },
|
|
500
550
|
},
|
|
501
551
|
];
|
|
@@ -38,23 +38,24 @@ const fs = __importStar(require("node:fs"));
|
|
|
38
38
|
const runtime_1 = require("../nerves/runtime");
|
|
39
39
|
const query_1 = require("../rsvp/query");
|
|
40
40
|
const snapshot_1 = require("../rsvp/snapshot");
|
|
41
|
+
const tools_base_1 = require("./tools-base");
|
|
41
42
|
function readSnapshot(snapshotPath) {
|
|
42
43
|
if (!snapshotPath || snapshotPath.trim().length === 0) {
|
|
43
|
-
return { ok: false, reason: "missing", message: "RSVP snapshot not found." };
|
|
44
|
+
return { ok: false, reason: "missing", message: (0, tools_base_1.withCode)("RSVP snapshot not found.", "snapshot-not-found") };
|
|
44
45
|
}
|
|
45
46
|
try {
|
|
46
47
|
const raw = fs.readFileSync(snapshotPath, "utf-8");
|
|
47
48
|
const parsed = (0, snapshot_1.parseRsvpSnapshot)(JSON.parse(raw));
|
|
48
49
|
if (!parsed.ok) {
|
|
49
|
-
return { ok: false, reason: "invalid", message: "RSVP snapshot could not be read or failed integrity validation." };
|
|
50
|
+
return { ok: false, reason: "invalid", message: (0, tools_base_1.withCode)("RSVP snapshot could not be read or failed integrity validation.", "snapshot-invalid") };
|
|
50
51
|
}
|
|
51
52
|
return { ok: true, snapshot: parsed.snapshot };
|
|
52
53
|
}
|
|
53
54
|
catch (error) {
|
|
54
55
|
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
55
|
-
return { ok: false, reason: "missing", message: "RSVP snapshot not found." };
|
|
56
|
+
return { ok: false, reason: "missing", message: (0, tools_base_1.withCode)("RSVP snapshot not found.", "snapshot-not-found") };
|
|
56
57
|
}
|
|
57
|
-
return { ok: false, reason: "invalid", message: "RSVP snapshot could not be read or failed integrity validation." };
|
|
58
|
+
return { ok: false, reason: "invalid", message: (0, tools_base_1.withCode)("RSVP snapshot could not be read or failed integrity validation.", "snapshot-invalid") };
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
function emitToolRead(toolName, result) {
|
|
@@ -107,6 +108,10 @@ exports.rsvpToolDefinitions = [
|
|
|
107
108
|
},
|
|
108
109
|
summaryKeys: ["snapshot_path", "query", "status"],
|
|
109
110
|
riskProfile: { mutates: "none", risk: "low", reason: "reads a local native RSVP snapshot" },
|
|
111
|
+
ax: { id: "tool:rsvp_query", group: "turn-rsvp", when: "Pick this to list which guests are pending, declined or coming, or to look one guest up; rsvp_summary gives only totals.", effect: "read", idempotent: true, errors: [
|
|
112
|
+
{ code: "snapshot-not-found", means: "snapshot_path is empty or no file is there.", fix: "Pass the absolute path of the agent's native RSVP snapshot JSON, then query again." },
|
|
113
|
+
{ code: "snapshot-invalid", means: "The file can't be read, isn't JSON, or fails the snapshot's integrity check, so no answer is given from it.", fix: "Don't answer from this file; tell the person, and suggest ouro rsvp doctor to check the snapshots." },
|
|
114
|
+
] },
|
|
110
115
|
},
|
|
111
116
|
{
|
|
112
117
|
tool: {
|
|
@@ -135,5 +140,9 @@ exports.rsvpToolDefinitions = [
|
|
|
135
140
|
},
|
|
136
141
|
summaryKeys: ["snapshot_path"],
|
|
137
142
|
riskProfile: { mutates: "none", risk: "low", reason: "reads a local native RSVP snapshot" },
|
|
143
|
+
ax: { id: "tool:rsvp_summary", group: "turn-rsvp", when: "Pick this for headcounts by reply and when the guest list was fetched, before reporting numbers; rsvp_query names guests.", effect: "read", idempotent: true, errors: [
|
|
144
|
+
{ code: "snapshot-not-found", means: "snapshot_path is empty or no file is there.", fix: "Pass the absolute path of the agent's native RSVP snapshot JSON, then summarize again." },
|
|
145
|
+
{ code: "snapshot-invalid", means: "The file can't be read, isn't JSON, or fails the snapshot's integrity check, so its counts can't be trusted.", fix: "Don't report counts from this file; tell the person, and suggest ouro rsvp doctor to check the snapshots." },
|
|
146
|
+
] },
|
|
138
147
|
},
|
|
139
148
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.travelToolDefinitions = void 0;
|
|
4
|
+
const tools_base_1 = require("./tools-base");
|
|
4
5
|
const travel_api_client_1 = require("./travel-api-client");
|
|
5
6
|
const runtime_1 = require("../nerves/runtime");
|
|
6
7
|
exports.travelToolDefinitions = [
|
|
@@ -36,14 +37,20 @@ exports.travelToolDefinitions = [
|
|
|
36
37
|
const data = await (0, travel_api_client_1.getWeather)(parseFloat(args.lat), parseFloat(args.lon));
|
|
37
38
|
return JSON.stringify(data, null, 2);
|
|
38
39
|
}
|
|
39
|
-
return "Please provide either a city name or lat/lon coordinates.";
|
|
40
|
+
return (0, tools_base_1.withCode)("Please provide either a city name or lat/lon coordinates.", "missing-location");
|
|
40
41
|
}
|
|
41
42
|
catch (err) {
|
|
42
43
|
/* v8 ignore next -- defensive: callers throw Error instances @preserve */
|
|
43
|
-
return `Weather lookup error: ${err instanceof Error ? err.message : String(err)}
|
|
44
|
+
return (0, tools_base_1.withCode)(`Weather lookup error: ${err instanceof Error ? err.message : String(err)}`, "weather-lookup-failed");
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
47
|
summaryKeys: ["city", "lat", "lon"],
|
|
48
|
+
riskProfile: { mutates: "none", risk: "low", reason: "reads public weather data" },
|
|
49
|
+
ax: { id: "tool:weather_lookup", group: "turn-travel", when: "Pick this for conditions at one place right now and today's high and low, such as what to wear; it has no later forecast.", effect: "read", errors: [
|
|
50
|
+
{ code: "guardrail-blocked", means: "The person asking isn't a trusted friend, so the weather lookup didn't run.", fix: "Tell them a trusted friend of the agent has to ask; don't call it again in this conversation." },
|
|
51
|
+
{ code: "missing-location", means: "Neither city nor both lat and lon were given, so nothing was looked up.", fix: "Call again with city, or with lat and lon together (geocode_search finds them)." },
|
|
52
|
+
{ code: "weather-lookup-failed", means: "The weather service failed or found no such city; the text before the code says which.", fix: "Check the city's spelling or pass lat and lon from geocode_search, then call again." },
|
|
53
|
+
] },
|
|
47
54
|
},
|
|
48
55
|
{
|
|
49
56
|
tool: {
|
|
@@ -76,10 +83,15 @@ exports.travelToolDefinitions = [
|
|
|
76
83
|
}
|
|
77
84
|
catch (err) {
|
|
78
85
|
/* v8 ignore next -- defensive: callers throw Error instances @preserve */
|
|
79
|
-
return `Travel advisory error: ${err instanceof Error ? err.message : String(err)}
|
|
86
|
+
return (0, tools_base_1.withCode)(`Travel advisory error: ${err instanceof Error ? err.message : String(err)}`, "advisory-lookup-failed");
|
|
80
87
|
}
|
|
81
88
|
},
|
|
82
89
|
summaryKeys: ["country_code"],
|
|
90
|
+
riskProfile: { mutates: "none", risk: "low", reason: "reads a public travel advisory" },
|
|
91
|
+
ax: { id: "tool:travel_advisory", group: "turn-travel", when: "Pick this to check how risky a country is to visit before suggesting or booking a trip there.", effect: "read", errors: [
|
|
92
|
+
{ code: "advisory-lookup-failed", means: "The advisory service failed, or has no advisory for that code; the text before the code says which.", fix: "If no advisory was found, pass a two-letter ISO code such as FR or JP, not a name; if the service failed, say it's unavailable." },
|
|
93
|
+
{ code: "guardrail-blocked", means: "The person asking isn't a trusted friend, so no advisory was looked up.", fix: "Tell them a trusted friend of the agent has to ask; don't retry the advisory in this conversation." },
|
|
94
|
+
] },
|
|
83
95
|
},
|
|
84
96
|
{
|
|
85
97
|
tool: {
|
|
@@ -117,9 +129,14 @@ exports.travelToolDefinitions = [
|
|
|
117
129
|
}
|
|
118
130
|
catch (err) {
|
|
119
131
|
/* v8 ignore next -- defensive: callers throw Error instances @preserve */
|
|
120
|
-
return `Geocode error: ${err instanceof Error ? err.message : String(err)}
|
|
132
|
+
return (0, tools_base_1.withCode)(`Geocode error: ${err instanceof Error ? err.message : String(err)}`, "geocode-failed");
|
|
121
133
|
}
|
|
122
134
|
},
|
|
123
135
|
summaryKeys: ["query"],
|
|
136
|
+
riskProfile: { mutates: "none", risk: "low", reason: "reads public map data" },
|
|
137
|
+
ax: { id: "tool:geocode_search", group: "turn-travel", when: "Pick this to turn a place or address into coordinates, or to find places near a point, before weather_lookup or advice on getting around.", effect: "read", errors: [
|
|
138
|
+
{ code: "geocode-failed", means: "The map service failed to answer; the text before the code says how.", fix: "Wait a moment and call again, or shorten the query to a place name and city." },
|
|
139
|
+
{ code: "guardrail-blocked", means: "The person asking isn't a trusted friend, so no place was searched.", fix: "Tell them a trusted friend of the agent has to ask; don't search again in this conversation." },
|
|
140
|
+
] },
|
|
124
141
|
},
|
|
125
142
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vaultToolDefinitions = void 0;
|
|
4
|
+
const tools_base_1 = require("./tools-base");
|
|
4
5
|
const identity_1 = require("../heart/identity");
|
|
5
6
|
const runtime_1 = require("../nerves/runtime");
|
|
6
7
|
exports.vaultToolDefinitions = [
|
|
@@ -9,7 +10,7 @@ exports.vaultToolDefinitions = [
|
|
|
9
10
|
type: "function",
|
|
10
11
|
function: {
|
|
11
12
|
name: "vault_setup",
|
|
12
|
-
description: "
|
|
13
|
+
description: "Explain how a person sets up or unlocks this agent's credential vault. Returns the terminal commands to run; changes nothing.",
|
|
13
14
|
parameters: {
|
|
14
15
|
type: "object",
|
|
15
16
|
properties: {},
|
|
@@ -24,7 +25,7 @@ exports.vaultToolDefinitions = [
|
|
|
24
25
|
message: "vault_setup invoked",
|
|
25
26
|
meta: { tool: "vault_setup", agentName },
|
|
26
27
|
});
|
|
27
|
-
return [
|
|
28
|
+
return (0, tools_base_1.withCode)([
|
|
28
29
|
"Vault setup is human-required.",
|
|
29
30
|
"",
|
|
30
31
|
"Why I cannot do it here:",
|
|
@@ -33,8 +34,12 @@ exports.vaultToolDefinitions = [
|
|
|
33
34
|
"Do this in a terminal:",
|
|
34
35
|
` ouro vault create --agent ${agentName}`,
|
|
35
36
|
` ouro vault unlock --agent ${agentName}`,
|
|
36
|
-
].join("\n");
|
|
37
|
+
].join("\n"), "human-required");
|
|
37
38
|
},
|
|
38
39
|
summaryKeys: [],
|
|
40
|
+
ax: { id: "tool:vault_setup", group: "turn-vault", when: "Pick this when someone asks you to create or unlock your own vault; the reply gives them the terminal steps.", effect: "person-only", idempotent: true, errors: [
|
|
41
|
+
{ code: "human-required", means: "Creating or unlocking a vault needs a secret typed by a person, so this tool never does it itself.", fix: "Ask the person to run ouro vault create only if the agent has no vault yet, else ouro vault unlock; never ask for the secret." },
|
|
42
|
+
{ code: "guardrail-blocked", means: "Only the agent's family may set up its vault, and the person asking isn't family.", fix: "Don't pass on the vault commands; tell them a family member has to ask." },
|
|
43
|
+
] },
|
|
39
44
|
},
|
|
40
45
|
];
|
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.1312",
|
|
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.1312",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|