@ouro.bot/cli 0.1.0-alpha.130 → 0.1.0-alpha.131

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.131",
6
+ "changes": [
7
+ "ouro auth --provider anthropic now exchanges the setup token for a refresh token immediately, enabling auto-refresh for subsequent sessions."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.130",
6
12
  "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") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.130",
3
+ "version": "0.1.0-alpha.131",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",