gearbox-code 0.2.0 → 0.2.1
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/dist/cli.mjs +36 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -143489,6 +143489,21 @@ function Panel({
|
|
|
143489
143489
|
r2.status
|
|
143490
143490
|
]
|
|
143491
143491
|
}, undefined, true, undefined, this),
|
|
143492
|
+
r2.detail ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
143493
|
+
color: color.faint,
|
|
143494
|
+
children: [
|
|
143495
|
+
" · ",
|
|
143496
|
+
r2.detail
|
|
143497
|
+
]
|
|
143498
|
+
}, undefined, true, undefined, this) : null,
|
|
143499
|
+
r2.type === "subscription" && !(r2.detail && r2.detail.includes("@")) ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
143500
|
+
color: color.accentDim,
|
|
143501
|
+
children: [
|
|
143502
|
+
" · /account login ",
|
|
143503
|
+
r2.alias,
|
|
143504
|
+
" to identify"
|
|
143505
|
+
]
|
|
143506
|
+
}, undefined, true, undefined, this) : null,
|
|
143492
143507
|
r2.active ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
143493
143508
|
color: color.ok,
|
|
143494
143509
|
children: [
|
|
@@ -147768,7 +147783,7 @@ function App2({ selector: initialSelector, runner, fullscreen = false, resumeId
|
|
|
147768
147783
|
status,
|
|
147769
147784
|
active: activeRow,
|
|
147770
147785
|
alias: accountSlug(a),
|
|
147771
|
-
detail: st?.signedIn ? st.detail : undefined,
|
|
147786
|
+
detail: (st?.signedIn ? st.detail : undefined) ?? a.identity?.label,
|
|
147772
147787
|
duplicateOf: st?.duplicateOf,
|
|
147773
147788
|
health: a.health?.state
|
|
147774
147789
|
};
|
|
@@ -147781,6 +147796,22 @@ function App2({ selector: initialSelector, runner, fullscreen = false, resumeId
|
|
|
147781
147796
|
statusPad: Math.max(6, ...rows2.map((r2) => r2.status.length))
|
|
147782
147797
|
};
|
|
147783
147798
|
};
|
|
147799
|
+
const refreshCliStatuses = import_react26.useCallback(async () => {
|
|
147800
|
+
const accounts = listAccounts().filter((a) => a.exec === "cli");
|
|
147801
|
+
const statuses = { ...accountStatusCacheRef.current };
|
|
147802
|
+
await Promise.all(accounts.map(async (a) => {
|
|
147803
|
+
const bin = a.auth.binary;
|
|
147804
|
+
const profile = a.auth.loginProfile;
|
|
147805
|
+
try {
|
|
147806
|
+
const st = await cliAuthStatus(bin, profile);
|
|
147807
|
+
statuses[a.id] = { signedIn: st.loggedIn, detail: st.detail, identity: st.identity };
|
|
147808
|
+
if (st.loggedIn && st.identityLabel) {
|
|
147809
|
+
putAccount({ ...a, identity: { key: st.identity ?? a.id, label: st.identityLabel, checkedAt: Date.now() } });
|
|
147810
|
+
}
|
|
147811
|
+
} catch {}
|
|
147812
|
+
}));
|
|
147813
|
+
accountStatusCacheRef.current = statuses;
|
|
147814
|
+
}, []);
|
|
147784
147815
|
const askModeRef = import_react26.useRef(false);
|
|
147785
147816
|
const runCliBackend = import_react26.useCallback(async (args) => {
|
|
147786
147817
|
const { binary, profile, modelId, accountId, efforts, label, pinned, prompt, messages, onEvent, signal } = args;
|
|
@@ -148919,6 +148950,10 @@ Example: /mcp add github npx -y @modelcontextprotocol/server-github`);
|
|
|
148919
148950
|
case "account": {
|
|
148920
148951
|
if (!arg.trim() && fullscreen) {
|
|
148921
148952
|
setPanel({ kind: "accounts", title: "accounts · ⏎ to switch", index: 0 });
|
|
148953
|
+
refreshCliStatuses().then(() => {
|
|
148954
|
+
if (panelRef.current?.kind === "accounts")
|
|
148955
|
+
setPanel({ ...panelRef.current });
|
|
148956
|
+
});
|
|
148922
148957
|
return;
|
|
148923
148958
|
}
|
|
148924
148959
|
echo(text2);
|
package/package.json
CHANGED