@ouro.bot/cli 0.1.0-alpha.1563 → 0.1.0-alpha.1564
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/heart/identity.js +20 -0
- package/dist/senses/pipeline.js +37 -1
- package/dist/senses/reply-gate.js +237 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1564",
|
|
6
|
+
"changes": [
|
|
7
|
+
"An agent can now stay quiet in a group chat without paying for a model turn. Add `\"replyGate\": { \"deployment\": \"<Microsoft-Decision deployment>\" }` to agent.json and, before each group-chat turn, one call to Microsoft-Decision-1.1 on the azure provider's Foundry resource scores how valuable a reply would be; below `replyAtValue` (default 1.5) the turn ends as `observe` with no model call. It runs in iMessage groups, not Teams (where a bot hears only messages that @mention it), and never when a queued message is waiting for the turn. A message that names the agent, or any gate error or delay over 4 seconds, runs the turn as before. See \"Reply gate in group chats\" in docs/auth-and-providers.md."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1563",
|
|
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.1564</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
package/dist/heart/identity.js
CHANGED
|
@@ -55,6 +55,7 @@ exports.getAgentDaemonLoggingConfigPath = getAgentDaemonLoggingConfigPath;
|
|
|
55
55
|
exports.getAgentMessagesRoot = getAgentMessagesRoot;
|
|
56
56
|
exports.getAgentMailroomRoot = getAgentMailroomRoot;
|
|
57
57
|
exports.getAgentToolsRoot = getAgentToolsRoot;
|
|
58
|
+
exports.validateReplyGate = validateReplyGate;
|
|
58
59
|
exports.loadAgentConfig = loadAgentConfig;
|
|
59
60
|
exports.setAgentName = setAgentName;
|
|
60
61
|
exports.setAgentConfigOverride = setAgentConfigOverride;
|
|
@@ -569,6 +570,24 @@ function validateProviderFallback(raw, configFile) {
|
|
|
569
570
|
}
|
|
570
571
|
return entries.map((entry) => ({ provider: entry.provider, model: entry.model }));
|
|
571
572
|
}
|
|
573
|
+
function validateReplyGate(raw, configFile) {
|
|
574
|
+
const record = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
|
|
575
|
+
const deployment = typeof record?.deployment === "string" ? record.deployment.trim() : "";
|
|
576
|
+
const replyAtValue = record?.replyAtValue;
|
|
577
|
+
const replyAtValid = replyAtValue === undefined
|
|
578
|
+
|| (typeof replyAtValue === "number" && Number.isFinite(replyAtValue) && replyAtValue >= 0 && replyAtValue <= 3);
|
|
579
|
+
if (!deployment || !replyAtValid) {
|
|
580
|
+
(0, runtime_1.emitNervesEvent)({
|
|
581
|
+
level: "error",
|
|
582
|
+
event: "config_identity.error",
|
|
583
|
+
component: "config/identity",
|
|
584
|
+
message: "agent config has invalid replyGate",
|
|
585
|
+
meta: { path: configFile, replyGate: raw },
|
|
586
|
+
});
|
|
587
|
+
throw new Error(`agent.json at ${configFile} replyGate must be { "deployment": "<Microsoft-Decision deployment>", "replyAtValue": <0 to 3, optional> }.`);
|
|
588
|
+
}
|
|
589
|
+
return replyAtValue === undefined ? { deployment } : { deployment, replyAtValue: replyAtValue };
|
|
590
|
+
}
|
|
572
591
|
/**
|
|
573
592
|
* Load and parse `<agentRoot>/agent.json`.
|
|
574
593
|
* Reads the explicit owner's file fresh, or preserves the legacy ambient override when no owner is supplied.
|
|
@@ -673,6 +692,7 @@ function loadAgentConfig(owner) {
|
|
|
673
692
|
agentFacing,
|
|
674
693
|
...(parsed.providerFallback !== undefined ? { providerFallback: validateProviderFallback(parsed.providerFallback, configFile) } : {}),
|
|
675
694
|
...(parsed.desks !== undefined ? { desks: validateDesks(parsed.desks, configFile) } : {}),
|
|
695
|
+
...(parsed.replyGate !== undefined ? { replyGate: validateReplyGate(parsed.replyGate, configFile) } : {}),
|
|
676
696
|
senses: normalizeSenses(parsed.senses, configFile),
|
|
677
697
|
phrases: parsed.phrases,
|
|
678
698
|
};
|
package/dist/senses/pipeline.js
CHANGED
|
@@ -80,6 +80,7 @@ const cares_1 = require("../arc/cares");
|
|
|
80
80
|
const turn_execution_lease_1 = require("../heart/turn-execution-lease");
|
|
81
81
|
const turn_watch_1 = require("./turn-watch");
|
|
82
82
|
const friend_link_codes_1 = require("../mind/friend-link-codes");
|
|
83
|
+
const reply_gate_1 = require("./reply-gate");
|
|
83
84
|
const VOICE_PENDING_MAX_AGE_MS = 15 * 60 * 1_000;
|
|
84
85
|
const TELEGRAM_GENERIC_OUTREACH_PENDING_MAX_AGE_MS = 15 * 60 * 1_000;
|
|
85
86
|
function pendingExpirationReason(channel, message, now, agentName) {
|
|
@@ -508,6 +509,25 @@ function prepareInboundRunLedger(input) {
|
|
|
508
509
|
* the reply is not held for the network. A later edit is not in this commit;
|
|
509
510
|
* the next turn commits it whole.
|
|
510
511
|
*/
|
|
512
|
+
async function askGroupReplyGate(messages, signal) {
|
|
513
|
+
let agentName;
|
|
514
|
+
let config;
|
|
515
|
+
try {
|
|
516
|
+
agentName = (0, identity_1.getAgentName)();
|
|
517
|
+
config = (0, reply_gate_1.readReplyGateConfig)(agentName);
|
|
518
|
+
}
|
|
519
|
+
catch (error) {
|
|
520
|
+
(0, runtime_1.emitNervesEvent)({
|
|
521
|
+
level: "warn",
|
|
522
|
+
component: "senses",
|
|
523
|
+
event: "senses.reply_gate_config_error",
|
|
524
|
+
message: "could not read replyGate from agent.json, so the turn runs without the gate",
|
|
525
|
+
meta: { error: error instanceof Error ? error.message : String(error) },
|
|
526
|
+
});
|
|
527
|
+
return { reply: true, reason: "failed" };
|
|
528
|
+
}
|
|
529
|
+
return (0, reply_gate_1.askReplyGate)({ agentName, config, messages, signal });
|
|
530
|
+
}
|
|
511
531
|
function startPostTurnSync(agentRoot, config) {
|
|
512
532
|
let result;
|
|
513
533
|
try {
|
|
@@ -1139,7 +1159,23 @@ async function handleInboundTurnExclusive(input) {
|
|
|
1139
1159
|
}));
|
|
1140
1160
|
let result;
|
|
1141
1161
|
try {
|
|
1142
|
-
|
|
1162
|
+
// Step 5a: Reply gate (opt-in, group chats only). A decision model says whether a reply is worth a model turn.
|
|
1163
|
+
// Never when something is queued for this turn (pending messages, deferred returns, wake sections): only the
|
|
1164
|
+
// model turn delivers those, and a quiet turn would settle them unseen. Never in Teams, where a bot in a group
|
|
1165
|
+
// hears only messages that @mention it, so every Teams group turn is someone talking to the agent.
|
|
1166
|
+
const replyGate = input.isGroupChat === true
|
|
1167
|
+
&& input.channel !== "teams"
|
|
1168
|
+
&& pending.length === 0
|
|
1169
|
+
&& extraPrefixSections.length === 0
|
|
1170
|
+
? await askGroupReplyGate(sessionMessages, input.signal)
|
|
1171
|
+
: undefined;
|
|
1172
|
+
if (replyGate && !replyGate.reply) {
|
|
1173
|
+
(0, reply_gate_1.appendGatedObserve)(sessionMessages, replyGate.value);
|
|
1174
|
+
result = { outcome: "observed" };
|
|
1175
|
+
}
|
|
1176
|
+
else {
|
|
1177
|
+
result = await input.runAgent(sessionMessages, turnCallbacks, input.channel, input.signal, runAgentOptions);
|
|
1178
|
+
}
|
|
1143
1179
|
}
|
|
1144
1180
|
catch (error) {
|
|
1145
1181
|
if (runLedger)
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The reply gate: before a group-chat turn, a small decision model says whether a reply is worth sending.
|
|
3
|
+
//
|
|
4
|
+
// In a group chat most messages are people talking to each other, so most turns end with `observe`. Each of
|
|
5
|
+
// those still costs a full LLM turn (instructions, tools, memory) just to decide to stay quiet. With
|
|
6
|
+
// `replyGate` in agent.json, one call to Microsoft-Decision-1.1 on Foundry scores how valuable a reply would be
|
|
7
|
+
// first, and the full turn runs only when the score reaches `replyAtValue`. The idea and its first eval come from
|
|
8
|
+
// https://github.com/ourostack/chime-in (archived; it now lives in Microsoft's CIT playground).
|
|
9
|
+
//
|
|
10
|
+
// The gate only ever saves turns: when it is off, unsure, slow or failing, the turn runs as it would without it.
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.REPLY_GATE_RECENT_MESSAGES = exports.REPLY_GATE_TIMEOUT_MS = exports.DEFAULT_REPLY_AT_VALUE = exports.HOW_VALUABLE = void 0;
|
|
46
|
+
exports.recentConversation = recentConversation;
|
|
47
|
+
exports.namesAgent = namesAgent;
|
|
48
|
+
exports.readReplyGateConfig = readReplyGateConfig;
|
|
49
|
+
exports.decisionModelUrl = decisionModelUrl;
|
|
50
|
+
exports.askReplyGate = askReplyGate;
|
|
51
|
+
exports.appendGatedObserve = appendGatedObserve;
|
|
52
|
+
const runtime_1 = require("../nerves/runtime");
|
|
53
|
+
const config_1 = require("../heart/config");
|
|
54
|
+
const azure_1 = require("../heart/providers/azure");
|
|
55
|
+
const path = __importStar(require("path"));
|
|
56
|
+
const identity_1 = require("../heart/identity");
|
|
57
|
+
const auth_flow_1 = require("../heart/auth/auth-flow");
|
|
58
|
+
/** The gate's one question: how valuable would a reply be right now? Scored 0 (the first level) to 3 (the last). */
|
|
59
|
+
exports.HOW_VALUABLE = [
|
|
60
|
+
"None: nothing to add; the chat is social, already answered, for someone else, "
|
|
61
|
+
+ "or the agent knows nothing useful about it",
|
|
62
|
+
"Low: mildly helpful, people would not miss it",
|
|
63
|
+
"Medium: saves someone real time or effort",
|
|
64
|
+
"High: people need this now and would be worse off without it",
|
|
65
|
+
];
|
|
66
|
+
/** chime-in's threshold: 12 of 12 right calls on its labeled chats (its README, 2026-11-24). */
|
|
67
|
+
exports.DEFAULT_REPLY_AT_VALUE = 1.5;
|
|
68
|
+
/** chime-in's median gate call took 330 ms; past this the turn runs rather than keep people waiting. */
|
|
69
|
+
exports.REPLY_GATE_TIMEOUT_MS = 4000;
|
|
70
|
+
/** How much of the conversation the decision model reads. */
|
|
71
|
+
exports.REPLY_GATE_RECENT_MESSAGES = 20;
|
|
72
|
+
function textOf(content) {
|
|
73
|
+
if (!Array.isArray(content))
|
|
74
|
+
return content ?? "";
|
|
75
|
+
return content
|
|
76
|
+
.map((part) => (part && typeof part === "object" && "text" in part && typeof part.text === "string" ? part.text : ""))
|
|
77
|
+
.filter((text) => text.length > 0)
|
|
78
|
+
.join("\n");
|
|
79
|
+
}
|
|
80
|
+
/** The agent's own words live in its settle and speak calls, not in assistant content. */
|
|
81
|
+
function agentWords(message) {
|
|
82
|
+
const said = [];
|
|
83
|
+
const content = textOf(message.content);
|
|
84
|
+
if (content.trim())
|
|
85
|
+
said.push(content);
|
|
86
|
+
for (const call of message.tool_calls ?? []) {
|
|
87
|
+
if (call.type !== "function" || (call.function.name !== "settle" && call.function.name !== "speak"))
|
|
88
|
+
continue;
|
|
89
|
+
try {
|
|
90
|
+
const args = JSON.parse(call.function.arguments);
|
|
91
|
+
const words = call.function.name === "settle" ? args.answer : args.message;
|
|
92
|
+
if (typeof words === "string" && words.trim())
|
|
93
|
+
said.push(words);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Arguments a provider streamed badly are not words anyone saw.
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return said.join("\n");
|
|
100
|
+
}
|
|
101
|
+
function recentConversation(agentName, messages) {
|
|
102
|
+
const lines = [];
|
|
103
|
+
for (const message of messages) {
|
|
104
|
+
if (message.role === "user") {
|
|
105
|
+
const text = textOf(message.content).trim();
|
|
106
|
+
if (text)
|
|
107
|
+
lines.push({ from: "group member", text });
|
|
108
|
+
}
|
|
109
|
+
else if (message.role === "assistant") {
|
|
110
|
+
const text = agentWords(message).trim();
|
|
111
|
+
if (text)
|
|
112
|
+
lines.push({ from: agentName, text });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return lines.slice(-exports.REPLY_GATE_RECENT_MESSAGES);
|
|
116
|
+
}
|
|
117
|
+
/** Someone who names the agent is talking to it: that turn always runs. */
|
|
118
|
+
function namesAgent(agentName, text) {
|
|
119
|
+
const escaped = agentName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
120
|
+
return new RegExp(`(^|[^\\p{L}\\p{N}])@?${escaped}($|[^\\p{L}\\p{N}])`, "iu").test(text);
|
|
121
|
+
}
|
|
122
|
+
/** The agent's `replyGate`, read fresh so a change to agent.json applies to the next message. */
|
|
123
|
+
function readReplyGateConfig(agentName) {
|
|
124
|
+
const { config, configPath } = (0, auth_flow_1.readAgentConfigForAgent)(agentName, path.dirname((0, identity_1.getAgentRoot)(agentName)));
|
|
125
|
+
return config.replyGate === undefined ? undefined : (0, identity_1.validateReplyGate)(config.replyGate, configPath);
|
|
126
|
+
}
|
|
127
|
+
/** Foundry serves the decision model at the resource's root, beside the OpenAI routes the azure provider uses. */
|
|
128
|
+
function decisionModelUrl(endpoint) {
|
|
129
|
+
return `${endpoint.replace(/\/openai.*$/, "").replace(/\/+$/, "")}/providers/microsoft/v1/systemone`;
|
|
130
|
+
}
|
|
131
|
+
async function askReplyGate(input) {
|
|
132
|
+
const config = input.config;
|
|
133
|
+
if (!config)
|
|
134
|
+
return { reply: true, reason: "off" };
|
|
135
|
+
const conversation = recentConversation(input.agentName, input.messages);
|
|
136
|
+
const latest = conversation.at(-1);
|
|
137
|
+
// A message with no words (a photo, a sticker) gives the decision model nothing to read, so the turn decides.
|
|
138
|
+
if (!latest || latest.from === input.agentName)
|
|
139
|
+
return { reply: true, reason: "no-text" };
|
|
140
|
+
if (namesAgent(input.agentName, latest.text)) {
|
|
141
|
+
(0, runtime_1.emitNervesEvent)({
|
|
142
|
+
component: "senses",
|
|
143
|
+
event: "senses.reply_gate_named",
|
|
144
|
+
message: "reply gate let the turn run: the latest message names the agent",
|
|
145
|
+
meta: { agentName: input.agentName },
|
|
146
|
+
});
|
|
147
|
+
return { reply: true, reason: "named" };
|
|
148
|
+
}
|
|
149
|
+
const replyAt = config.replyAtValue ?? exports.DEFAULT_REPLY_AT_VALUE;
|
|
150
|
+
const started = Date.now();
|
|
151
|
+
(0, runtime_1.emitNervesEvent)({
|
|
152
|
+
component: "senses",
|
|
153
|
+
event: "senses.reply_gate_start",
|
|
154
|
+
message: "asking the decision model whether a group reply is worth sending",
|
|
155
|
+
meta: { deployment: config.deployment, messages: conversation.length },
|
|
156
|
+
});
|
|
157
|
+
try {
|
|
158
|
+
const azure = input.azureConfig ?? (0, config_1.getAzureConfig)();
|
|
159
|
+
if (!azure.endpoint) {
|
|
160
|
+
throw new Error("the azure provider has no endpoint in the agent vault; run `ouro auth --agent <agent> --provider azure`");
|
|
161
|
+
}
|
|
162
|
+
const auth = azure.apiKey
|
|
163
|
+
? { "api-key": azure.apiKey }
|
|
164
|
+
: { Authorization: `Bearer ${await (input.getToken ?? (0, azure_1.createAzureTokenProvider)(azure.managedIdentityClientId || undefined))()}` };
|
|
165
|
+
const timeout = AbortSignal.timeout(exports.REPLY_GATE_TIMEOUT_MS);
|
|
166
|
+
const response = await (input.fetchImpl ?? fetch)(decisionModelUrl(azure.endpoint), {
|
|
167
|
+
method: "POST",
|
|
168
|
+
headers: { "Content-Type": "application/json", ...auth },
|
|
169
|
+
signal: input.signal ? AbortSignal.any([input.signal, timeout]) : timeout,
|
|
170
|
+
body: JSON.stringify({
|
|
171
|
+
model: config.deployment,
|
|
172
|
+
state: {
|
|
173
|
+
agent: `${input.agentName}, a quiet member of this group chat`,
|
|
174
|
+
agent_knows: "nothing beyond the conversation",
|
|
175
|
+
conversation,
|
|
176
|
+
},
|
|
177
|
+
questions: {
|
|
178
|
+
how_valuable: {
|
|
179
|
+
type: "score",
|
|
180
|
+
instructions: "The agent is a quiet member of this conversation. If it replied to the latest "
|
|
181
|
+
+ "messages now, how valuable would that reply be?",
|
|
182
|
+
criteria: exports.HOW_VALUABLE,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
}),
|
|
186
|
+
});
|
|
187
|
+
if (!response.ok) {
|
|
188
|
+
throw new Error(`HTTP ${response.status} from the decision model: ${(await response.text()).slice(0, 200)}`);
|
|
189
|
+
}
|
|
190
|
+
const body = await response.json();
|
|
191
|
+
const value = body.answers?.how_valuable?.score;
|
|
192
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
193
|
+
throw new Error("the decision model's answer has no how_valuable score");
|
|
194
|
+
}
|
|
195
|
+
const reply = value >= replyAt;
|
|
196
|
+
(0, runtime_1.emitNervesEvent)({
|
|
197
|
+
component: "senses",
|
|
198
|
+
event: "senses.reply_gate_end",
|
|
199
|
+
message: reply ? "reply gate: a reply is worth sending" : "reply gate: staying quiet without a model turn",
|
|
200
|
+
meta: { value, replyAt, reply, ms: Date.now() - started },
|
|
201
|
+
});
|
|
202
|
+
return reply ? { reply: true, reason: "worth-it", value } : { reply: false, reason: "not-worth-it", value };
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
(0, runtime_1.emitNervesEvent)({
|
|
206
|
+
level: "warn",
|
|
207
|
+
component: "senses",
|
|
208
|
+
event: "senses.reply_gate_error",
|
|
209
|
+
message: "reply gate failed, so the turn runs as it would without it",
|
|
210
|
+
meta: { deployment: config.deployment, error: error instanceof Error ? error.message : String(error), ms: Date.now() - started },
|
|
211
|
+
});
|
|
212
|
+
return { reply: true, reason: "failed" };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* What a quiet turn leaves in the session: the same observe call and result an LLM turn that chose silence
|
|
217
|
+
* writes (core.ts, "observe sole call"), so the next turn reads the conversation the same way either way.
|
|
218
|
+
*/
|
|
219
|
+
function appendGatedObserve(messages, value) {
|
|
220
|
+
const id = `reply_gate_${Date.now().toString(36)}`;
|
|
221
|
+
messages.push({
|
|
222
|
+
role: "assistant",
|
|
223
|
+
content: null,
|
|
224
|
+
tool_calls: [{
|
|
225
|
+
id,
|
|
226
|
+
type: "function",
|
|
227
|
+
function: { name: "observe", arguments: JSON.stringify({ reason: `reply gate: a reply was worth ${value.toFixed(1)} of 3` }) },
|
|
228
|
+
}],
|
|
229
|
+
});
|
|
230
|
+
messages.push({ role: "tool", tool_call_id: id, content: "(silenced)" });
|
|
231
|
+
(0, runtime_1.emitNervesEvent)({
|
|
232
|
+
component: "senses",
|
|
233
|
+
event: "senses.reply_gate_observed",
|
|
234
|
+
message: "recorded the gated turn as observe",
|
|
235
|
+
meta: { value },
|
|
236
|
+
});
|
|
237
|
+
}
|
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.1564",
|
|
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.1564",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1564",
|
|
4
4
|
"description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
|
|
5
5
|
"homepage": "https://ouroboros.bot/",
|
|
6
6
|
"engines": {
|