@cortexkit/opencode-openai-auth 1.1.0 → 1.2.0
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/bin.js +8 -8
- package/dist/{codex-request-BXDXToyt.d.ts → codex-request-CjXETpTA.d.ts} +56 -24
- package/dist/index-03em8hv1.js +69 -0
- package/dist/index-6n4pnfkg.js +2 -0
- package/dist/{index-f2fmb596.js → index-bc89akak.js} +1 -1
- package/dist/{index-7c6sxtd6.js → index-ehjj89rx.js} +2 -2
- package/dist/index-f21addzm.js +90 -0
- package/dist/{index-k6cydkgt.js → index-ffg0sgg5.js} +2 -2
- package/dist/{index-zpm95mt5.js → index-ftkhhr6d.js} +1 -1
- package/dist/{index-4c8yw54k.js → index-htvcmtcx.js} +2 -2
- package/dist/{index-j8v2xwq6.js → index-qp5hdpw8.js} +1 -1
- package/dist/{index-msx2m78k.js → index-qxbchh2d.js} +2 -2
- package/dist/{index-m5qmvr6c.js → index-r2s51ac1.js} +2 -2
- package/dist/index-rwbrhkse.js +65 -0
- package/dist/{index-csky2xpg.js → index-xwvze96g.js} +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/{model-YRg7Uowo.d.ts → model-CQcw10oW.d.ts} +1 -1
- package/dist/{port-file-CxEpgSHY.d.ts → port-file-BDJnzgHH.d.ts} +1 -1
- package/dist/{protocol-CDV1Pc6h.d.ts → protocol-C-kagE6O.d.ts} +1 -1
- package/dist/rpc/port-file.d.ts +1 -1
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.d.ts +1 -1
- package/dist/rpc/protocol.js +1 -1
- package/dist/rpc/rpc-client.d.ts +3 -3
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/rpc/rpc-dir.js +1 -1
- package/dist/{sidebar-state-DjTWUbmf.d.ts → sidebar-state-BfQ4mpZO.d.ts} +98 -5
- package/dist/sidebar-state.d.ts +2 -2
- package/dist/sidebar-state.js +1 -1
- package/dist/token-util-cf0nyh7n.js +1 -0
- package/dist/{token-rz4t3ay6.js → token-z6qq7a1d.js} +1 -1
- package/dist/tui-preferences.js +1 -1
- package/dist/tui.d.ts +2 -2
- package/dist/v2/server.d.ts +109 -2
- package/dist/v2/server.js +3 -3
- package/package.json +3 -3
- package/src/tui-compiled/raw/shared/0332701351b3eeec-format.js +135 -18
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +17 -0
- package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +38 -1
- package/src/tui-compiled/raw/shared/d5a8f1061ee2f114-index.js +1 -1
- package/src/tui-compiled/raw/sidebar-state.js +63 -1
- package/src/tui-compiled/raw/tui.tsx +82 -30
- package/src/tui-compiled/runtime/shared/0332701351b3eeec-format.js +135 -18
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +17 -0
- package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +38 -1
- package/src/tui-compiled/runtime/shared/d5a8f1061ee2f114-index.js +1 -1
- package/src/tui-compiled/runtime/sidebar-state.js +63 -1
- package/src/tui-compiled/runtime/tui.js +245 -208
- package/dist/index-0yh85bwb.js +0 -69
- package/dist/index-7eb3dw37.js +0 -90
- package/dist/index-8re8rprk.js +0 -2
- package/dist/index-edbdscy7.js +0 -65
- package/dist/map-Buq-GW7l.d.ts +0 -56
- package/dist/token-util-tpy2c7h6.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatQuota,
|
|
3
|
+
isQuotaStale,
|
|
3
4
|
projectQuota,
|
|
4
5
|
quotaWindowName
|
|
5
6
|
} from "./shared/d5a8f1061ee2f114-index.js";
|
|
@@ -266,7 +267,7 @@ export function resolveSessionSidebarRouting(state, sessionId, now = Date.now())
|
|
|
266
267
|
}
|
|
267
268
|
function vaultAccountsInPlacementOrder(state) {
|
|
268
269
|
const accounts = state.vaultAccounts ?? [], byId = new Map(accounts.map((account) => [account.id, account]));
|
|
269
|
-
return orderForPlacement(accounts.map((account) => account.id),
|
|
270
|
+
return orderForPlacement(accounts.map((account) => account.id), placementOf(state), vaultMainRouteId(accounts) ?? "").flatMap((id) => {
|
|
270
271
|
const account = byId.get(id);
|
|
271
272
|
return account ? [account] : [];
|
|
272
273
|
});
|
|
@@ -962,6 +963,67 @@ export function getCollapsedQuotaSummary(quota, now = Date.now()) {
|
|
|
962
963
|
text: !projection || projection.limits.length === 0 && !projection.budget ? null : formatQuota(projection, { now, form: "compact" })
|
|
963
964
|
};
|
|
964
965
|
}
|
|
966
|
+
function placementOf(state) {
|
|
967
|
+
return state.route === "sticky-balanced" ? "roster" : orderedPlacement(state.route);
|
|
968
|
+
}
|
|
969
|
+
export function getCollapsedAccountLines(state, options = {}) {
|
|
970
|
+
const now = options.now ?? Date.now(), activeId = resolveActiveAccount(state).id;
|
|
971
|
+
return (state.vaultAccounts !== void 0 ? vaultAccountsInPlacementOrder(state).map((account) => ({
|
|
972
|
+
id: account.id,
|
|
973
|
+
name: account.label ?? account.id,
|
|
974
|
+
quota: account.quota,
|
|
975
|
+
killed: account.killed
|
|
976
|
+
})) : localAccountsInPlacementOrder(state, activeId, options.showFallbacks ?? !0)).map((account) => {
|
|
977
|
+
const projection = sidebarQuotaProjection(account.quota, now), reading = projection && (projection.limits.length > 0 || projection.budget) ? projection : void 0;
|
|
978
|
+
return {
|
|
979
|
+
id: account.id,
|
|
980
|
+
name: account.name,
|
|
981
|
+
killed: account.killed,
|
|
982
|
+
active: account.id === activeId,
|
|
983
|
+
stale: reading ? isQuotaStale(reading, { now }) : !1,
|
|
984
|
+
text: reading ? formatQuota(reading, { now, form: "narrow" }) : null
|
|
985
|
+
};
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
function localAccountsInPlacementOrder(state, activeId, showFallbacks) {
|
|
989
|
+
const accounts = [
|
|
990
|
+
{
|
|
991
|
+
id: "main",
|
|
992
|
+
name: "main",
|
|
993
|
+
quota: state.main.quota,
|
|
994
|
+
killed: state.main.killed
|
|
995
|
+
},
|
|
996
|
+
...state.fallbacks.filter((account) => account.enabled && (showFallbacks || account.id === activeId)).map((account) => ({
|
|
997
|
+
id: account.id,
|
|
998
|
+
name: account.label ?? account.id,
|
|
999
|
+
quota: account.quota,
|
|
1000
|
+
killed: account.killed
|
|
1001
|
+
}))
|
|
1002
|
+
], byId = new Map(accounts.map((account) => [account.id, account]));
|
|
1003
|
+
return orderForPlacement(accounts.map((account) => account.id), placementOf(state), "main").flatMap((id) => {
|
|
1004
|
+
const account = byId.get(id);
|
|
1005
|
+
return account ? [account] : [];
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
export function displayWidth(text) {
|
|
1009
|
+
const bun = globalThis.Bun;
|
|
1010
|
+
return bun?.stringWidth ? bun.stringWidth(text) : Array.from(text).length;
|
|
1011
|
+
}
|
|
1012
|
+
export function fitCollapsedLabel(label, columns) {
|
|
1013
|
+
if (displayWidth(label) <= columns)
|
|
1014
|
+
return label;
|
|
1015
|
+
if (columns < 1)
|
|
1016
|
+
return "";
|
|
1017
|
+
let kept = "", used = 0;
|
|
1018
|
+
for (const char of label) {
|
|
1019
|
+
const width = displayWidth(char);
|
|
1020
|
+
if (used + width > columns - 1)
|
|
1021
|
+
break;
|
|
1022
|
+
kept += char;
|
|
1023
|
+
used += width;
|
|
1024
|
+
}
|
|
1025
|
+
return `${kept}\u2026`;
|
|
1026
|
+
}
|
|
965
1027
|
const PACING_MIN_ELAPSED_MS = 300000, PACING_MIN_ELAPSED_FRACTION = 0.01, ON_PACE_DELTA = 1;
|
|
966
1028
|
export function computeQuotaPacing(window, windowMs, now) {
|
|
967
1029
|
if (!window.resetsAt)
|