@ouro.bot/cli 0.1.0-alpha.130 → 0.1.0-alpha.132
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/dist/heart/daemon/auth-flow.js +25 -0
- package/dist/senses/bluebubbles.js +31 -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.132",
|
|
6
|
+
"changes": [
|
|
7
|
+
"BlueBubbles no longer shows redundant \"shared work: errored\" alongside failover messages. Terminal errors are buffered and only displayed when failover doesn't handle them."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.131",
|
|
12
|
+
"changes": [
|
|
13
|
+
"ouro auth --provider anthropic now exchanges the setup token for a refresh token immediately, enabling auto-refresh for subsequent sessions."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.130",
|
|
6
18
|
"changes": [
|
|
@@ -320,6 +320,25 @@ async function collectRuntimeAuthCredentials(input, deps) {
|
|
|
320
320
|
}
|
|
321
321
|
const prompt = ensurePromptInput(input.promptInput, input.provider);
|
|
322
322
|
const setupToken = validateAnthropicToken(await prompt("Paste the setup token from `claude setup-token`: "));
|
|
323
|
+
// Exchange the setup token for an access+refresh token pair so auto-refresh works.
|
|
324
|
+
// The setup token IS the initial access token — we use it as a refresh token to
|
|
325
|
+
// get back a proper token pair from the OAuth endpoint.
|
|
326
|
+
/* v8 ignore start -- token exchange: requires live Anthropic OAuth endpoint @preserve */
|
|
327
|
+
try {
|
|
328
|
+
const { refreshAnthropicToken } = await Promise.resolve().then(() => __importStar(require("../providers/anthropic-token")));
|
|
329
|
+
const tokenState = await refreshAnthropicToken(setupToken);
|
|
330
|
+
if (tokenState) {
|
|
331
|
+
return {
|
|
332
|
+
setupToken: tokenState.accessToken,
|
|
333
|
+
refreshToken: tokenState.refreshToken,
|
|
334
|
+
expiresAt: tokenState.expiresAt,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
// Exchange failed — use the raw setup token as-is (it'll work until expiry)
|
|
340
|
+
}
|
|
341
|
+
/* v8 ignore stop */
|
|
323
342
|
return { setupToken };
|
|
324
343
|
}
|
|
325
344
|
if (input.provider === "minimax") {
|
|
@@ -387,6 +406,12 @@ async function resolveHatchCredentials(input) {
|
|
|
387
406
|
function applyCredentials(secrets, provider, credentials) {
|
|
388
407
|
if (provider === "anthropic") {
|
|
389
408
|
secrets.providers.anthropic.setupToken = credentials.setupToken.trim();
|
|
409
|
+
/* v8 ignore start -- token refresh fields: populated when OAuth exchange succeeds @preserve */
|
|
410
|
+
if (credentials.refreshToken)
|
|
411
|
+
secrets.providers.anthropic.refreshToken = credentials.refreshToken;
|
|
412
|
+
if (credentials.expiresAt)
|
|
413
|
+
secrets.providers.anthropic.expiresAt = credentials.expiresAt;
|
|
414
|
+
/* v8 ignore stop */
|
|
390
415
|
return;
|
|
391
416
|
}
|
|
392
417
|
if (provider === "github-copilot") {
|
|
@@ -624,6 +624,22 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
624
624
|
? false
|
|
625
625
|
: await checkHasExistingGroupWithFamily(store, context.friend);
|
|
626
626
|
// ── Call shared pipeline ──────────────────────────────────────────
|
|
627
|
+
// Buffer terminal errors so failover can suppress them.
|
|
628
|
+
// If failover produces a message, the buffered error is skipped.
|
|
629
|
+
// If failover doesn't fire, the buffered error is replayed.
|
|
630
|
+
let bufferedTerminalError = null;
|
|
631
|
+
/* v8 ignore start -- failover-aware error buffering @preserve */
|
|
632
|
+
const failoverAwareCallbacks = {
|
|
633
|
+
...callbacks,
|
|
634
|
+
onError(error, severity) {
|
|
635
|
+
if (severity === "terminal") {
|
|
636
|
+
bufferedTerminalError = error;
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
callbacks.onError(error, severity);
|
|
640
|
+
},
|
|
641
|
+
};
|
|
642
|
+
/* v8 ignore stop */
|
|
627
643
|
try {
|
|
628
644
|
const result = await (0, pipeline_1.handleInboundTurn)({
|
|
629
645
|
channel: "bluebubbles",
|
|
@@ -674,7 +690,7 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
674
690
|
accumulateFriendTokens: resolvedDeps.accumulateFriendTokens,
|
|
675
691
|
signal: controller.signal,
|
|
676
692
|
runAgentOptions: { mcpManager },
|
|
677
|
-
callbacks,
|
|
693
|
+
callbacks: failoverAwareCallbacks,
|
|
678
694
|
failoverState: (() => {
|
|
679
695
|
if (!bbFailoverStates.has(event.chat.sessionKey)) {
|
|
680
696
|
bbFailoverStates.set(event.chat.sessionKey, { pending: null });
|
|
@@ -682,10 +698,15 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
682
698
|
return bbFailoverStates.get(event.chat.sessionKey);
|
|
683
699
|
})(),
|
|
684
700
|
});
|
|
685
|
-
/* v8 ignore start -- failover display
|
|
701
|
+
/* v8 ignore start -- failover display + error replay @preserve */
|
|
686
702
|
if (result.failoverMessage) {
|
|
703
|
+
// Failover handled it — show the failover message, skip the buffered error
|
|
687
704
|
await client.sendText({ chat: event.chat, text: result.failoverMessage });
|
|
688
705
|
}
|
|
706
|
+
else if (bufferedTerminalError) {
|
|
707
|
+
// No failover — replay the buffered terminal error
|
|
708
|
+
callbacks.onError(bufferedTerminalError, "terminal");
|
|
709
|
+
}
|
|
689
710
|
/* v8 ignore stop */
|
|
690
711
|
// ── Handle gate result ────────────────────────────────────────
|
|
691
712
|
if (!result.gateResult.allowed) {
|
|
@@ -727,6 +748,14 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
727
748
|
};
|
|
728
749
|
}
|
|
729
750
|
finally {
|
|
751
|
+
// If a terminal error was buffered and never replayed (e.g., handleInboundTurn threw),
|
|
752
|
+
// replay it now so the user still sees the error.
|
|
753
|
+
/* v8 ignore start -- error replay on throw: tested via BB error test @preserve */
|
|
754
|
+
if (bufferedTerminalError) {
|
|
755
|
+
callbacks.onError(bufferedTerminalError, "terminal");
|
|
756
|
+
bufferedTerminalError = null;
|
|
757
|
+
}
|
|
758
|
+
/* v8 ignore stop */
|
|
730
759
|
await callbacks.finish();
|
|
731
760
|
}
|
|
732
761
|
});
|