@ouro.bot/cli 0.1.0-alpha.1309 → 0.1.0-alpha.1310
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 +6 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/repertoire/tools-chat.js +29 -10
- package/dist/repertoire/tools-telegram-contacts.js +6 -2
- package/dist/repertoire/tools-voice.js +9 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
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.1310",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The chat, voice-call and Telegram contact tools 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.1309",
|
|
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.1310</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -4,6 +4,7 @@ exports.chatToolDefinitions = exports.CHAT_ACTION_TOOL_CHANNELS = void 0;
|
|
|
4
4
|
exports.chatActionsForTurn = chatActionsForTurn;
|
|
5
5
|
exports.offTurnRefusal = offTurnRefusal;
|
|
6
6
|
const runtime_1 = require("../nerves/runtime");
|
|
7
|
+
const tools_base_1 = require("./tools-base");
|
|
7
8
|
// Every chat app lets you react to a message, reply to a specific one and send a file. These tools are the same on
|
|
8
9
|
// every sense; each sense binds `ctx.chatActions` to its own app, and a missing action means the app can't do it.
|
|
9
10
|
const MESSAGING_APPS = new Set(["bluebubbles", "telegram"]);
|
|
@@ -27,7 +28,7 @@ function chatActionsForTurn(actions, inboundMessageId) {
|
|
|
27
28
|
...(react ? {
|
|
28
29
|
react: async (emoji, messageId) => {
|
|
29
30
|
const id = messageId ?? inboundMessageId;
|
|
30
|
-
return id ? react(emoji, id) : "there is no message to react to here; pass message_id.";
|
|
31
|
+
return id ? react(emoji, id) : (0, tools_base_1.withCode)("there is no message to react to here; pass message_id.", "no-message");
|
|
31
32
|
},
|
|
32
33
|
} : {}),
|
|
33
34
|
...(setReplyTarget ? {
|
|
@@ -35,14 +36,14 @@ function chatActionsForTurn(actions, inboundMessageId) {
|
|
|
35
36
|
if (request.target !== "thread")
|
|
36
37
|
return setReplyTarget(request);
|
|
37
38
|
const id = request.messageId ?? inboundMessageId;
|
|
38
|
-
return id ? setReplyTarget({ target: "thread", messageId: id }) : "there is no message to reply to here; pass message_id.";
|
|
39
|
+
return id ? setReplyTarget({ target: "thread", messageId: id }) : (0, tools_base_1.withCode)("there is no message to reply to here; pass message_id.", "no-message");
|
|
39
40
|
},
|
|
40
41
|
} : {}),
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
/** Chat actions act in the chat the turn came from, so a turn that may not send can't take them, even when called directly. */
|
|
44
45
|
function offTurnRefusal(ctx) {
|
|
45
|
-
return ctx?.noSend || ctx?.habitSession || ctx?.autonomousTurnKind ? "I can't act in a chat on this turn." : undefined;
|
|
46
|
+
return ctx?.noSend || ctx?.habitSession || ctx?.autonomousTurnKind ? (0, tools_base_1.withCode)("I can't act in a chat on this turn.", "off-turn") : undefined;
|
|
46
47
|
}
|
|
47
48
|
function argText(value) {
|
|
48
49
|
return typeof value === "string" ? value.trim() : "";
|
|
@@ -77,17 +78,24 @@ exports.chatToolDefinitions = [
|
|
|
77
78
|
return ended("react", false, refusal);
|
|
78
79
|
const emoji = argText(args.emoji);
|
|
79
80
|
if (!emoji)
|
|
80
|
-
return ended("react", false, "emoji is required.");
|
|
81
|
+
return ended("react", false, (0, tools_base_1.withCode)("emoji is required.", "missing-emoji"));
|
|
81
82
|
const actions = ctx?.chatActions;
|
|
82
83
|
if (!actions?.react)
|
|
83
|
-
return ended("react", false, "this chat doesn't take reactions from me.");
|
|
84
|
+
return ended("react", false, (0, tools_base_1.withCode)("this chat doesn't take reactions from me.", "no-reactions"));
|
|
84
85
|
try {
|
|
85
86
|
return ended("react", true, await actions.react(emoji, argText(args.message_id) || undefined));
|
|
86
87
|
}
|
|
87
88
|
catch (error) {
|
|
88
|
-
return ended("react", false, `the reaction didn't go through: ${error instanceof Error ? error.message : String(error)}
|
|
89
|
+
return ended("react", false, (0, tools_base_1.withCode)(`the reaction didn't go through: ${error instanceof Error ? error.message : String(error)}`, "reaction-failed"));
|
|
89
90
|
}
|
|
90
91
|
},
|
|
92
|
+
ax: { id: "tool:react", group: "turn-chat", when: "Pick this to acknowledge or answer someone with a single emoji tap, alone or beside a text reply, when words would be too much.", effect: "write", errors: [
|
|
93
|
+
{ code: "missing-emoji", means: "emoji was empty, so there was nothing to react with.", fix: "Call again with emoji set to one emoji, for example 👍." },
|
|
94
|
+
{ code: "no-reactions", means: "This chat app doesn't let me add reactions.", fix: "Answer in words instead; a short text reply does the same job here." },
|
|
95
|
+
{ code: "reaction-failed", means: "The chat app refused or dropped the reaction; the reason follows the colon.", fix: "Check message_id is a real id from this chat, then try once more or reply in words." },
|
|
96
|
+
{ code: "no-message", means: "No message_id was given and this turn has no starting message to react to.", fix: "Call again with message_id set to one of the ids shown in this chat's context." },
|
|
97
|
+
{ code: "off-turn", means: "This turn may not send (an autonomous, habit or no-send turn), so nothing happened in the chat.", fix: "Leave the chat alone this turn; act in it on a turn that someone in that chat started." },
|
|
98
|
+
] },
|
|
91
99
|
summaryKeys: ["emoji", "message_id"],
|
|
92
100
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "adds a reaction in the current chat" },
|
|
93
101
|
},
|
|
@@ -114,7 +122,7 @@ exports.chatToolDefinitions = [
|
|
|
114
122
|
const target = argText(args.target);
|
|
115
123
|
const actions = ctx?.chatActions;
|
|
116
124
|
if (!actions?.setReplyTarget)
|
|
117
|
-
return ended("set_reply_target", false, "this chat doesn't let me choose where a reply lands.");
|
|
125
|
+
return ended("set_reply_target", false, (0, tools_base_1.withCode)("this chat doesn't let me choose where a reply lands.", "no-reply-choice"));
|
|
118
126
|
let request;
|
|
119
127
|
if (target === "current_lane" || target === "top_level") {
|
|
120
128
|
request = { target };
|
|
@@ -124,10 +132,16 @@ exports.chatToolDefinitions = [
|
|
|
124
132
|
request = messageId ? { target, messageId } : { target };
|
|
125
133
|
}
|
|
126
134
|
else {
|
|
127
|
-
return ended("set_reply_target", false, "target must be one of: current_lane, top_level, thread.");
|
|
135
|
+
return ended("set_reply_target", false, (0, tools_base_1.withCode)("target must be one of: current_lane, top_level, thread.", "invalid-target"));
|
|
128
136
|
}
|
|
129
137
|
return ended("set_reply_target", true, actions.setReplyTarget(request));
|
|
130
138
|
},
|
|
139
|
+
ax: { id: "tool:set_reply_target", group: "turn-chat", when: "Pick this before you settle, to thread the reply under one message, post it top-level, or go back to this chat's usual lane.", effect: "write", idempotent: true, errors: [
|
|
140
|
+
{ code: "no-reply-choice", means: "This chat app gives me no choice of where a reply lands.", fix: "Just send the reply; it lands where this chat always puts it." },
|
|
141
|
+
{ code: "invalid-target", means: "target wasn't current_lane, top_level or thread.", fix: "Call again with target set to current_lane, top_level or thread." },
|
|
142
|
+
{ code: "no-message", means: "No message_id was given and this turn has no starting message to reply to.", fix: "Call again with message_id set to one of the ids shown in this chat's context." },
|
|
143
|
+
{ code: "off-turn", means: "This turn may not send (an autonomous, habit or no-send turn), so nothing happened in the chat.", fix: "Leave the chat alone this turn; act in it on a turn that someone in that chat started." },
|
|
144
|
+
] },
|
|
131
145
|
summaryKeys: ["target", "message_id"],
|
|
132
146
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "changes where the reply in the current chat lands" },
|
|
133
147
|
},
|
|
@@ -154,12 +168,17 @@ exports.chatToolDefinitions = [
|
|
|
154
168
|
throw new Error(refusal);
|
|
155
169
|
const filePath = argText(args.path);
|
|
156
170
|
if (!filePath.startsWith("/"))
|
|
157
|
-
throw new Error("path must be an absolute path to a file.");
|
|
171
|
+
throw new Error((0, tools_base_1.withCode)("path must be an absolute path to a file.", "relative-path"));
|
|
158
172
|
const actions = ctx?.chatActions;
|
|
159
173
|
if (!actions?.sendFile)
|
|
160
|
-
throw new Error("this chat doesn't take files from me.");
|
|
174
|
+
throw new Error((0, tools_base_1.withCode)("this chat doesn't take files from me.", "no-files"));
|
|
161
175
|
return actions.sendFile(filePath, typeof args.caption === "string" ? args.caption : "");
|
|
162
176
|
},
|
|
177
|
+
ax: { id: "tool:send_file", group: "turn-chat", when: "Pick this to hand someone an actual photo, PDF or document stored on disk; for a link or a few lines of text, just reply.", effect: "write", errors: [
|
|
178
|
+
{ code: "relative-path", means: "path didn't start with /, so I can't tell which file you mean.", fix: "Call again with the file's absolute path, such as /Users/me/menu.pdf." },
|
|
179
|
+
{ code: "no-files", means: "This chat app doesn't take files from me.", fix: "Describe the file in your reply, or tell them where it is on disk." },
|
|
180
|
+
{ code: "off-turn", means: "This turn may not send (an autonomous, habit or no-send turn), so nothing happened in the chat.", fix: "Leave the chat alone this turn; act in it on a turn that someone in that chat started." },
|
|
181
|
+
] },
|
|
163
182
|
summaryKeys: ["path"],
|
|
164
183
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "sends a local file into the current chat" },
|
|
165
184
|
},
|
|
@@ -16,7 +16,7 @@ exports.telegramContactToolDefinition = {
|
|
|
16
16
|
const actor = ctx?.relationshipAuthorization?.actor;
|
|
17
17
|
const manager = ctx?.telegramContactManager;
|
|
18
18
|
if (!actor || actor.trustLevel !== "family" || !manager)
|
|
19
|
-
return JSON.stringify({ ok: false, error: "Telegram contact management requires the live owner relationship" });
|
|
19
|
+
return JSON.stringify({ ok: false, error: "Telegram contact management requires the live owner relationship", code: "owner-only" });
|
|
20
20
|
const action = String(args.action ?? "");
|
|
21
21
|
if (action === "list")
|
|
22
22
|
return JSON.stringify({ ok: true, ...(await manager.list({ actorFriendId: actor.friendId })) });
|
|
@@ -24,8 +24,12 @@ exports.telegramContactToolDefinition = {
|
|
|
24
24
|
return JSON.stringify({ ok: true, ...(await manager.revoke({ actorFriendId: actor.friendId, friendId: args.friendId })) });
|
|
25
25
|
if (action === "unblock" && typeof args.admissionId === "string" && args.admissionId.trim())
|
|
26
26
|
return JSON.stringify({ ok: true, ...(await manager.unblock({ actorFriendId: actor.friendId, admissionId: args.admissionId })) });
|
|
27
|
-
return JSON.stringify({ ok: false, error: "Telegram contact management arguments are invalid" });
|
|
27
|
+
return JSON.stringify({ ok: false, error: "Telegram contact management arguments are invalid", code: "invalid-contact-request" });
|
|
28
28
|
},
|
|
29
|
+
ax: { id: "tool:telegram_contact_manage", group: "friends", when: "Pick this when your owner asks who may message you on Telegram, wants an approved person cut off, or lets a held-back request through.", effect: "write", destructive: true, errors: [
|
|
30
|
+
{ code: "owner-only", means: "This turn has no live owner relationship in my Telegram chat: either the person isn't the owner, or this isn't that chat.", fix: "Tell them the owner can make this change from their Telegram chat with me." },
|
|
31
|
+
{ code: "invalid-contact-request", means: "revoke came without friendId, or unblock without admissionId, or the id was blank.", fix: "Call with action list first, then pass the exact friendId or admissionId it shows." },
|
|
32
|
+
] },
|
|
29
33
|
riskProfile: (args) => String(args.action) === "list" ? { mutates: "none", risk: "low" } : { mutates: "durable_state_write", risk: "high", reason: "changes one exact household Telegram admission" },
|
|
30
34
|
approvalPolicy: () => ({ kind: "not_required" }),
|
|
31
35
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.voiceToolDefinitions = void 0;
|
|
4
|
+
const tools_base_1 = require("./tools-base");
|
|
4
5
|
const runtime_1 = require("../nerves/runtime");
|
|
5
6
|
exports.voiceToolDefinitions = [{
|
|
6
7
|
tool: {
|
|
@@ -23,6 +24,9 @@ exports.voiceToolDefinitions = [{
|
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
},
|
|
27
|
+
ax: { id: "tool:voice_end_call", group: "turn-voice", when: "Pick this once goodbyes are said or the caller asks to hang up; settling alone leaves the phone line open.", effect: "write", idempotent: true, errors: [
|
|
28
|
+
{ code: "no-active-call", means: "This turn isn't part of a live voice call, so there was no call to end.", fix: "Nothing to hang up; end the conversation with a normal reply." },
|
|
29
|
+
] },
|
|
26
30
|
handler: async (args, ctx) => {
|
|
27
31
|
const reason = typeof args.reason === "string" && args.reason.trim().length > 0
|
|
28
32
|
? args.reason.trim()
|
|
@@ -40,7 +44,7 @@ exports.voiceToolDefinitions = [{
|
|
|
40
44
|
message: "voice end-call tool had no active call",
|
|
41
45
|
meta: { hasActiveCall: "false" },
|
|
42
46
|
});
|
|
43
|
-
return "no active voice call to end";
|
|
47
|
+
return (0, tools_base_1.withCode)("no active voice call to end", "no-active-call");
|
|
44
48
|
}
|
|
45
49
|
await ctx.voiceCall.requestEnd(reason);
|
|
46
50
|
(0, runtime_1.emitNervesEvent)({
|
|
@@ -128,7 +132,7 @@ exports.voiceToolDefinitions = [{
|
|
|
128
132
|
message: "voice play-audio tool had no active audio-capable call",
|
|
129
133
|
meta: { hasActiveCallAudio: "false", source },
|
|
130
134
|
});
|
|
131
|
-
return "no active voice call audio path";
|
|
135
|
+
return (0, tools_base_1.withCode)("no active voice call audio path", "no-call-audio");
|
|
132
136
|
}
|
|
133
137
|
const result = await ctx.voiceCall.playAudio(request);
|
|
134
138
|
(0, runtime_1.emitNervesEvent)({
|
|
@@ -141,5 +145,8 @@ exports.voiceToolDefinitions = [{
|
|
|
141
145
|
return result.toolResult.trim();
|
|
142
146
|
return `(played audio: ${result.label}, ${Math.round(result.durationMs)}ms)`;
|
|
143
147
|
},
|
|
148
|
+
ax: { id: "tool:voice_play_audio", group: "turn-voice", when: "Pick this when a caller asks to hear a test beep or a recorded sound over the phone; your spoken answers need no tool.", effect: "write", errors: [
|
|
149
|
+
{ code: "no-call-audio", means: "No live call on this turn can carry played audio, so nothing was played.", fix: "Tell the caller in words that you can't play sound on this call." },
|
|
150
|
+
] },
|
|
144
151
|
riskProfile: { mutates: "external_side_effect", risk: "high", reason: "plays audio into a live voice call" },
|
|
145
152
|
}];
|
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.1310",
|
|
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.1310",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|