@ouro.bot/cli 0.1.0-alpha.70 → 0.1.0-alpha.71

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,14 @@
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.71",
6
+ "changes": [
7
+ "Fix: `ouro auth switch` now works with both `ouro auth switch --agent X --provider Y` and `ouro auth --switch --agent X --provider Y` syntax.",
8
+ "Fix: `ouro auth verify` now makes a real API call for github-copilot (GET copilot_internal/user) instead of only checking token format.",
9
+ "Fix: `ouro auth --verify` flag form also accepted alongside positional `verify` subcommand."
10
+ ]
11
+ },
4
12
  {
5
13
  "version": "0.1.0-alpha.70",
6
14
  "changes": [
@@ -443,7 +443,7 @@ function hasStoredCredentials(provider, providerSecrets) {
443
443
  }
444
444
  /* v8 ignore stop */
445
445
  /* v8 ignore start -- verifyProviderCredentials: per-provider branches tested via auth verify tests @preserve */
446
- function verifyProviderCredentials(provider, providers) {
446
+ async function verifyProviderCredentials(provider, providers, fetchImpl = fetch) {
447
447
  const p = providers[provider];
448
448
  if (!p)
449
449
  return "not configured";
@@ -461,7 +461,17 @@ function verifyProviderCredentials(provider, providers) {
461
461
  }
462
462
  if (provider === "github-copilot") {
463
463
  const token = p.githubToken || "";
464
- return token ? "ok" : "failed (no token)";
464
+ if (!token)
465
+ return "failed (no token)";
466
+ try {
467
+ const response = await fetchImpl("https://api.github.com/copilot_internal/user", {
468
+ headers: { Authorization: `Bearer ${token}` },
469
+ });
470
+ return response.ok ? "ok" : `failed (HTTP ${response.status})`;
471
+ }
472
+ catch (error) {
473
+ return `failed (${error.message})`;
474
+ }
465
475
  }
466
476
  if (provider === "minimax") {
467
477
  const apiKey = p.apiKey || "";
@@ -593,7 +603,9 @@ function parseTaskCommand(args) {
593
603
  }
594
604
  function parseAuthCommand(args) {
595
605
  const first = args[0];
596
- if (first === "verify" || first === "switch") {
606
+ // Support both positional (`auth switch`) and flag (`auth --switch`) forms
607
+ if (first === "verify" || first === "switch" || first === "--verify" || first === "--switch") {
608
+ const subcommand = first.replace(/^--/, "");
597
609
  const { agent, rest } = extractAgentFlag(args.slice(1));
598
610
  let provider;
599
611
  /* v8 ignore start -- provider flag parsing: branches tested via CLI parsing tests @preserve */
@@ -611,7 +623,7 @@ function parseAuthCommand(args) {
611
623
  /* v8 ignore next -- defensive: agent always provided in tests @preserve */
612
624
  if (!agent)
613
625
  throw new Error(`Usage\n${usage()}`);
614
- if (first === "switch") {
626
+ if (subcommand === "switch") {
615
627
  if (!provider)
616
628
  throw new Error(`auth switch requires --provider.\n${usage()}`);
617
629
  return { kind: "auth.switch", agent, provider };
@@ -1697,15 +1709,16 @@ async function runOuroCli(args, deps = createDefaultOuroCliDeps()) {
1697
1709
  if (command.kind === "auth.verify") {
1698
1710
  const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent);
1699
1711
  const providers = secrets.providers;
1712
+ const fetchFn = deps.fetchImpl ?? fetch;
1700
1713
  if (command.provider) {
1701
- const status = verifyProviderCredentials(command.provider, providers);
1714
+ const status = await verifyProviderCredentials(command.provider, providers, fetchFn);
1702
1715
  const message = `${command.provider}: ${status}`;
1703
1716
  deps.writeStdout(message);
1704
1717
  return message;
1705
1718
  }
1706
1719
  const lines = [];
1707
1720
  for (const p of Object.keys(providers)) {
1708
- const status = verifyProviderCredentials(p, providers);
1721
+ const status = await verifyProviderCredentials(p, providers, fetchFn);
1709
1722
  lines.push(`${p}: ${status}`);
1710
1723
  }
1711
1724
  const message = lines.join("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.70",
3
+ "version": "0.1.0-alpha.71",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",