@ouro.bot/cli 0.1.0-alpha.976 → 0.1.0-alpha.977
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.977",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The replay gate now reads the Butler's settle answer as his reply. A chef-question run that answered correctly through settle after a narration line was failed for not naming the show, which rolled back alpha.976."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.976",
|
|
6
12
|
"changes": [
|
|
@@ -78,7 +78,11 @@ export function extractTimeline(session) {
|
|
|
78
78
|
for (const event of events) {
|
|
79
79
|
if (event.role !== "assistant") continue
|
|
80
80
|
if (typeof event.content === "string" && event.content.length > 0) timeline.push({ kind: "reply", text: event.content })
|
|
81
|
-
for (const call of event.toolCalls ?? [])
|
|
81
|
+
for (const call of event.toolCalls ?? []) {
|
|
82
|
+
timeline.push({ kind: "call", name: call.function?.name ?? "", args: call.function?.arguments ?? "", result: results.get(call.id) ?? "" })
|
|
83
|
+
const answer = settleAnswer(call)
|
|
84
|
+
if (answer) timeline.push({ kind: "reply", text: answer })
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
return timeline
|
|
84
88
|
}
|
|
@@ -148,10 +152,19 @@ export function offersToStartStoppedContainer(text) {
|
|
|
148
152
|
return new RegExp(`\\b(?:want me to|should i|shall i|do you want me to|would you like me to|i can|i could|i'll|let me)\\b[^.!?\\n]*\\b${START_VERB}\\b`, "i").test(t)
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
/**
|
|
155
|
+
/** The answer a settle call delivered, or "" for any other call. The Butler's final reply goes out through settle, not as message text. */
|
|
156
|
+
export function settleAnswer(call) {
|
|
157
|
+
if (call?.function?.name !== "settle") return ""
|
|
158
|
+
try { const answer = JSON.parse(call.function.arguments ?? "").answer; return typeof answer === "string" ? answer : "" } catch { return "" }
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** What one assistant event said, in order: its own text, then any settle answers it delivered. */
|
|
162
|
+
const spoken = (event) => event?.role !== "assistant" ? [] : [typeof event.content === "string" ? event.content : "", ...(event.toolCalls ?? []).map(settleAnswer)].filter((text) => text.length > 0)
|
|
163
|
+
|
|
164
|
+
/** Everything the assistant said across a session, in order (a reply may be spread over several messages, and the last is often a settle answer). */
|
|
152
165
|
export function extractReplies(session) {
|
|
153
166
|
const events = Array.isArray(session?.events) ? session.events : []
|
|
154
|
-
return events.
|
|
167
|
+
return events.flatMap(spoken).join("\n")
|
|
155
168
|
}
|
|
156
169
|
|
|
157
170
|
export const STALL_MIN_AGE_HOURS = 6
|
|
@@ -640,15 +653,16 @@ export function ownerPolicyUntouched(before, after) {
|
|
|
640
653
|
const sessionEvents = (session) => (Array.isArray(session?.events) ? session.events : [])
|
|
641
654
|
/** The last thing the assistant said in a session, or "" when it has said nothing. */
|
|
642
655
|
export function lastReply(session) {
|
|
643
|
-
|
|
644
|
-
return replies.at(-1)?.content ?? ""
|
|
656
|
+
return sessionEvents(session).flatMap(spoken).at(-1) ?? ""
|
|
645
657
|
}
|
|
646
658
|
|
|
647
|
-
/** A turn has finished when the session has grown past what it held before the message and ends on a plain reply (no tool calls pending). */
|
|
659
|
+
/** A turn has finished when the session has grown past what it held before the message and ends on a plain reply (no tool calls pending), or on the delivery of a settle answer. */
|
|
648
660
|
export function turnSettled(session, eventsBefore) {
|
|
649
661
|
const events = sessionEvents(session)
|
|
650
662
|
const last = events.at(-1)
|
|
651
|
-
|
|
663
|
+
if (events.length <= eventsBefore) return false
|
|
664
|
+
if (last?.role === "tool") return events.some((event) => event.role === "assistant" && (event.toolCalls ?? []).some((call) => call.id === last.toolCallId && call.function?.name === "settle"))
|
|
665
|
+
return last?.role === "assistant" && typeof last.content === "string" && last.content.length > 0 && !(Array.isArray(last.toolCalls) && last.toolCalls.length > 0)
|
|
652
666
|
}
|
|
653
667
|
|
|
654
668
|
/** After a cut send, wait (bounded) until the turn has settled and the session has stopped growing between two reads. */
|
|
@@ -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.977</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/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.977",
|
|
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.977",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@azure/identity": "^4.13.0",
|