@cortexkit/opencode-openai-auth 1.1.0 → 1.3.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.
Files changed (66) hide show
  1. package/dist/bin.js +8 -8
  2. package/dist/{codex-request-BXDXToyt.d.ts → codex-request-B9D0e97Q.d.ts} +177 -28
  3. package/dist/{index-7c6sxtd6.js → index-1mbgsxsr.js} +2 -2
  4. package/dist/{index-4c8yw54k.js → index-2pgkrebq.js} +2 -2
  5. package/dist/index-4v2fs42x.js +65 -0
  6. package/dist/index-8x1aj7q3.js +2 -0
  7. package/dist/{index-f2fmb596.js → index-bc89akak.js} +1 -1
  8. package/dist/index-ex6nx3mq.js +2 -0
  9. package/dist/{index-zpm95mt5.js → index-ftkhhr6d.js} +1 -1
  10. package/dist/{index-msx2m78k.js → index-gn2b097f.js} +2 -2
  11. package/dist/{index-j8v2xwq6.js → index-m3ctrabv.js} +1 -1
  12. package/dist/index-psjyexj3.js +69 -0
  13. package/dist/{index-k6cydkgt.js → index-tddr876f.js} +2 -2
  14. package/dist/index-tn8x5tz8.js +90 -0
  15. package/dist/{index-csky2xpg.js → index-xwvze96g.js} +1 -1
  16. package/dist/index.d.ts +5 -3
  17. package/dist/index.js +1 -1
  18. package/dist/{model-YRg7Uowo.d.ts → model-BdITTmeb.d.ts} +1 -1
  19. package/dist/{port-file-CxEpgSHY.d.ts → port-file-DbHIVC9a.d.ts} +1 -1
  20. package/dist/{protocol-CDV1Pc6h.d.ts → protocol-MysYPAho.d.ts} +1 -1
  21. package/dist/rpc/port-file.d.ts +1 -1
  22. package/dist/rpc/port-file.js +1 -1
  23. package/dist/rpc/protocol.d.ts +1 -1
  24. package/dist/rpc/protocol.js +1 -1
  25. package/dist/rpc/rpc-client.d.ts +3 -3
  26. package/dist/rpc/rpc-client.js +1 -1
  27. package/dist/rpc/rpc-dir.js +1 -1
  28. package/dist/{sidebar-state-DjTWUbmf.d.ts → sidebar-state-CVSok7zv.d.ts} +114 -5
  29. package/dist/sidebar-state.d.ts +2 -2
  30. package/dist/sidebar-state.js +1 -1
  31. package/dist/token-util-cf0nyh7n.js +1 -0
  32. package/dist/{token-rz4t3ay6.js → token-z6qq7a1d.js} +1 -1
  33. package/dist/tui-preferences.js +1 -1
  34. package/dist/tui.d.ts +2 -2
  35. package/dist/v2/server.d.ts +109 -2
  36. package/dist/v2/server.js +3 -3
  37. package/package.json +4 -4
  38. package/src/tui-compiled/raw/shared/0332701351b3eeec-format.js +203 -18
  39. package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +242 -16
  40. package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +168 -6
  41. package/src/tui-compiled/raw/shared/375d9cca2def037d-private-files.js +10 -2
  42. package/src/tui-compiled/raw/shared/94f53cfd572ba4bb-availability.js +106 -0
  43. package/src/tui-compiled/raw/shared/d0f0b6be200311af-insula.js +286 -21
  44. package/src/tui-compiled/raw/shared/d5a8f1061ee2f114-index.js +1 -1
  45. package/src/tui-compiled/raw/shared/dc9290c2a7552ba6-watch.js +253 -0
  46. package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +4 -1
  47. package/src/tui-compiled/raw/sidebar-state.js +63 -1
  48. package/src/tui-compiled/raw/tui.tsx +82 -30
  49. package/src/tui-compiled/runtime/shared/0332701351b3eeec-format.js +203 -18
  50. package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +242 -16
  51. package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +168 -6
  52. package/src/tui-compiled/runtime/shared/375d9cca2def037d-private-files.js +10 -2
  53. package/src/tui-compiled/runtime/shared/94f53cfd572ba4bb-availability.js +106 -0
  54. package/src/tui-compiled/runtime/shared/d0f0b6be200311af-insula.js +286 -21
  55. package/src/tui-compiled/runtime/shared/d5a8f1061ee2f114-index.js +1 -1
  56. package/src/tui-compiled/runtime/shared/dc9290c2a7552ba6-watch.js +253 -0
  57. package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +4 -1
  58. package/src/tui-compiled/runtime/sidebar-state.js +63 -1
  59. package/src/tui-compiled/runtime/tui.js +245 -208
  60. package/dist/index-0yh85bwb.js +0 -69
  61. package/dist/index-7eb3dw37.js +0 -90
  62. package/dist/index-8re8rprk.js +0 -2
  63. package/dist/index-edbdscy7.js +0 -65
  64. package/dist/index-m5qmvr6c.js +0 -2
  65. package/dist/map-Buq-GW7l.d.ts +0 -56
  66. 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), state.route === "sticky-balanced" ? "roster" : orderedPlacement(state.route), vaultMainRouteId(accounts) ?? "").flatMap((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)