opencode-usage 0.5.14 → 0.5.15

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.
@@ -14,7 +14,7 @@
14
14
  if (d) document.documentElement.classList.add("dark");
15
15
  })();
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-BkXCdfeo.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-00dEyfmq.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-DP6urYMR.css">
19
19
  </head>
20
20
  <body>
@@ -14,7 +14,7 @@
14
14
  if (d) document.documentElement.classList.add("dark");
15
15
  })();
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-BkXCdfeo.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-00dEyfmq.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-DP6urYMR.css">
19
19
  </head>
20
20
  <body>
package/dist/index.js CHANGED
@@ -30921,6 +30921,35 @@ async function queryUsage(opts) {
30921
30921
  worker.postMessage(opts);
30922
30922
  });
30923
30923
  }
30924
+ function pingAllAccounts() {
30925
+ for (const { provider, source } of PING_PROVIDERS) {
30926
+ try {
30927
+ const data = readConfig(source);
30928
+ let aliases;
30929
+ if (provider === "antigravity") {
30930
+ const accounts = Array.isArray(data.accounts) ? data.accounts : [];
30931
+ aliases = accounts.map((a) => typeof a.email === "string" ? a.email : "").filter(Boolean);
30932
+ } else if (provider === "anthropic") {
30933
+ const usage = data.usage && typeof data.usage === "object" ? data.usage : {};
30934
+ aliases = Object.keys(usage);
30935
+ } else {
30936
+ const accounts = data.accounts && typeof data.accounts === "object" ? data.accounts : {};
30937
+ aliases = Object.keys(accounts);
30938
+ }
30939
+ for (const alias of aliases) {
30940
+ try {
30941
+ runCommand("accounts.ping", { provider, alias });
30942
+ } catch (err) {
30943
+ console.log(`[startup-ping] ${provider}/${alias}: failed to queue \u2014 ${err instanceof Error ? err.message : String(err)}`);
30944
+ }
30945
+ }
30946
+ if (aliases.length > 0) {
30947
+ console.log(`[startup-ping] queued ${aliases.length} ping(s) for ${provider}`);
30948
+ }
30949
+ } catch {
30950
+ }
30951
+ }
30952
+ }
30924
30953
  async function runCommanderServer(args) {
30925
30954
  if (!isBun7) {
30926
30955
  console.error("Commander mode requires Bun runtime.");
@@ -31129,6 +31158,7 @@ async function runCommanderServer(args) {
31129
31158
  console.log(`Commander ready at ${serverUrl}`);
31130
31159
  proactiveRefreshCodexTokens().catch(() => {
31131
31160
  });
31161
+ pingAllAccounts();
31132
31162
  if (isBun7 && !process.env.NO_OPEN) {
31133
31163
  const cmd = process.platform === "win32" ? ["cmd", "/c", "start", serverUrl] : process.platform === "darwin" ? ["open", serverUrl] : ["xdg-open", serverUrl];
31134
31164
  Bun.spawn(cmd, { stdio: ["ignore", "ignore", "ignore"] });
@@ -31164,6 +31194,11 @@ var UI_DIST = await (async () => {
31164
31194
  })();
31165
31195
  var usageWorkerPath = join10(__dirname2, "services", "usage-worker.ts");
31166
31196
  var canUseWorker = await Bun.file(usageWorkerPath).exists();
31197
+ var PING_PROVIDERS = [
31198
+ { provider: "anthropic", source: "anthropic-multi-account-state" },
31199
+ { provider: "codex", source: "codex-multi-account-accounts" },
31200
+ { provider: "antigravity", source: "antigravity-accounts" }
31201
+ ];
31167
31202
  // src/index.ts
31168
31203
  function clearScreen() {
31169
31204
  process.stdout.write("\x1B[2J\x1B[H");
@@ -31274,4 +31309,4 @@ async function main2() {
31274
31309
  var WATCH_INTERVAL_MS = 5 * 60 * 1000;
31275
31310
  main2().catch(console.error);
31276
31311
 
31277
- //# debugId=B50D751F40066AFC64756E2164756E21
31312
+ //# debugId=D70ECC3BE99AA5F764756E2164756E21