@yansigit/opencodex 2.36.1-dev.20260829.48 → 2.36.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.
Files changed (94) hide show
  1. package/gui/dist/assets/{ApiKeys-LOOFiZfv.js → ApiKeys-CsmNyf4I.js} +1 -1
  2. package/gui/dist/assets/{Claude-BwKzpXe3.js → Claude-B4sHsGTD.js} +1 -1
  3. package/gui/dist/assets/{CodexSet-B5qi9KeE.js → CodexSet-BuAQ4YQn.js} +1 -1
  4. package/gui/dist/assets/{FileIntegrationPage-B0sUef6W.js → FileIntegrationPage-BC65sEaS.js} +1 -1
  5. package/gui/dist/assets/{Grok-bsb4n-f4.js → Grok-DNJWlISf.js} +1 -1
  6. package/gui/dist/assets/{Integrations-CSMwFDvM.js → Integrations-vGJshFZK.js} +2 -2
  7. package/gui/dist/assets/{IntegrationsOverview-CTORdKJA.js → IntegrationsOverview-DYMkDFHE.js} +1 -1
  8. package/gui/dist/assets/{Logs-BWYbfELf.js → Logs-Coc7_RPP.js} +1 -1
  9. package/gui/dist/assets/{Models-CexEtdT1.js → Models-CKVT8Meb.js} +1 -1
  10. package/gui/dist/assets/{NumberStepper-BapSFQnW.js → NumberStepper-Dug4wR8n.js} +1 -1
  11. package/gui/dist/assets/{Providers-BwUFeAgA.js → Providers-DyaCHRWL.js} +1 -1
  12. package/gui/dist/assets/{RestoreDialog-CD8piq90.js → RestoreDialog-BpuvVU2w.js} +1 -1
  13. package/gui/dist/assets/{Startup-BgX731C2.js → Startup-DAUQqNEN.js} +1 -1
  14. package/gui/dist/assets/{Storage-Bgq7HphP.js → Storage-DfP95SlJ.js} +1 -1
  15. package/gui/dist/assets/{Subagents-ChxItbeF.js → Subagents-CMNsZLfk.js} +1 -1
  16. package/gui/dist/assets/{Usage-BkylzP50.js → Usage-ESFRfBMO.js} +1 -1
  17. package/gui/dist/assets/{codex-stale-banner-D4gvSWnO.js → codex-stale-banner-W4FhikN7.js} +1 -1
  18. package/gui/dist/assets/{data-surface-BtO3lwam.js → data-surface-B8PX8rjm.js} +1 -1
  19. package/gui/dist/assets/{data-surface-pCXChiBf.js → data-surface-CETFXqiA.js} +1 -1
  20. package/gui/dist/assets/{index-CNopOid3.js → index-DHQHBRhb.js} +3 -3
  21. package/gui/dist/assets/{model-display-CiUpg8T9.js → model-display-OBTJhQwT.js} +1 -1
  22. package/gui/dist/assets/{provider-payload-b2jlS-On.js → provider-payload-CJRJUn7w.js} +1 -1
  23. package/gui/dist/assets/{section-tabs-BP7gEPK6.js → section-tabs-B8sLMiz6.js} +1 -1
  24. package/gui/dist/assets/shared-DI18-uF7.js +69 -0
  25. package/gui/dist/index.html +2 -2
  26. package/package.json +3 -1
  27. package/src/adapters/base.ts +26 -0
  28. package/src/adapters/cursor/catalog.ts +541 -0
  29. package/src/adapters/cursor/cursor-errors.ts +15 -0
  30. package/src/adapters/cursor/discovery.ts +34 -41
  31. package/src/adapters/cursor/envelope-echo.ts +128 -0
  32. package/src/adapters/cursor/request-builder.ts +19 -12
  33. package/src/adapters/cursor/tool-definitions.ts +2 -1
  34. package/src/adapters/cursor/tool-result-normalize.ts +23 -31
  35. package/src/adapters/cursor.ts +21 -2
  36. package/src/adapters/exec-tool-result-normalize.ts +99 -0
  37. package/src/adapters/google-antigravity-replay.ts +71 -2
  38. package/src/adapters/google.ts +19 -4
  39. package/src/adapters/kiro-constants.ts +12 -0
  40. package/src/adapters/kiro.ts +128 -11
  41. package/src/adapters/openai-chat.ts +16 -2
  42. package/src/adapters/openai-responses.ts +15 -2
  43. package/src/adapters/tool-catalog-nudge.ts +2 -1
  44. package/src/adapters/xai-web-search.ts +10 -14
  45. package/src/claude/outbound.ts +14 -3
  46. package/src/cli/access.ts +46 -3
  47. package/src/cli/account-api.ts +93 -16
  48. package/src/cli/account-extended.ts +262 -36
  49. package/src/cli/account-main.ts +12 -12
  50. package/src/cli/account.ts +40 -10
  51. package/src/cli/agent.ts +8 -1
  52. package/src/cli/capabilities-command.ts +94 -0
  53. package/src/cli/capabilities.ts +535 -0
  54. package/src/cli/claude-desktop.ts +31 -11
  55. package/src/cli/dispatch.ts +195 -27
  56. package/src/cli/doctor.ts +100 -1
  57. package/src/cli/help.ts +11 -2
  58. package/src/cli/index.ts +19 -3
  59. package/src/cli/inspect.ts +230 -0
  60. package/src/cli/observe.ts +11 -3
  61. package/src/cli/registry.ts +34 -2
  62. package/src/cli/runtime-api.ts +51 -7
  63. package/src/cli/status.ts +16 -0
  64. package/src/cli/storage.ts +234 -0
  65. package/src/cli/system-command.ts +16 -0
  66. package/src/cli/usage-report.ts +52 -2
  67. package/src/cli/version-skew.ts +46 -0
  68. package/src/codex/account-label.ts +21 -0
  69. package/src/codex/catalog/provider-fetch.ts +4 -0
  70. package/src/codex/transition-state.ts +12 -3
  71. package/src/compatibility/openai-responses.ts +9 -1
  72. package/src/generated/compatibility-version.json +94 -58
  73. package/src/integrations/ownership-policy.ts +24 -5
  74. package/src/integrations/ownership.ts +36 -2
  75. package/src/integrations/state.ts +40 -7
  76. package/src/integrations/writer.ts +21 -3
  77. package/src/lib/admin-secrets.ts +24 -0
  78. package/src/lib/errors.ts +25 -1
  79. package/src/lib/service-secrets.ts +15 -0
  80. package/src/oauth/store.ts +16 -6
  81. package/src/providers/label.ts +34 -1
  82. package/src/responses/turn-termination.ts +107 -0
  83. package/src/server/management/logs-usage-routes.ts +5 -27
  84. package/src/server/management/route-registry.ts +317 -0
  85. package/src/server/proxy-liveness.ts +27 -4
  86. package/src/server/request-log.ts +37 -17
  87. package/src/server/responses/core.ts +80 -4
  88. package/src/server/responses/policy-fallback.ts +1 -1
  89. package/src/service.ts +34 -0
  90. package/src/storage/policy-job.ts +14 -4
  91. package/src/storage/policy.ts +79 -33
  92. package/src/usage/log.ts +32 -6
  93. package/src/usage/summary.ts +22 -34
  94. package/gui/dist/assets/shared-BdYGV-yJ.js +0 -69
@@ -94,7 +94,6 @@ export interface UsageProvider {
94
94
 
95
95
  export interface UsageAccount {
96
96
  accountLogLabel: string;
97
- provider?: string;
98
97
  ambiguous: boolean;
99
98
  requests: number;
100
99
  attemptCount: number;
@@ -685,25 +684,22 @@ function legacyCodexAccountLabel(provider: string): string | null {
685
684
  return suffix ?? LEGACY_AMBIGUOUS_ACCOUNT_LABEL;
686
685
  }
687
686
 
688
- export function accountLabelForAttribution(
689
- provider: string,
690
- explicit: unknown,
691
- fallbackAccountByProvider?: Record<string, string>,
692
- ): string | null {
693
- if (typeof explicit === "string" && explicit.trim().length > 0) return explicit.trim();
694
- const legacy = legacyCodexAccountLabel(provider);
695
- if (legacy) return legacy;
696
- const base = baseProviderLabel(provider);
697
- if (fallbackAccountByProvider && fallbackAccountByProvider[base]) {
698
- return fallbackAccountByProvider[base];
699
- }
700
- return null;
687
+ /**
688
+ * An explicitly stamped label of EITHER family is authoritative for any provider (#2699).
689
+ *
690
+ * No `o`-label branch is needed here: `isCodexUsageAccountLogLabel` now accepts both families,
691
+ * and adding a second predicate call would be a no-op guarded by a comment claiming otherwise.
692
+ *
693
+ * The legacy fallback stays openai-only on purpose. It infers an account from the PROVIDER
694
+ * string, and inferring for a non-Codex row would merge unrelated accounts under one label --
695
+ * so an unlabeled xai row is dropped from the account table rather than guessed at.
696
+ */
697
+ function accountLabelForAttribution(provider: string, explicit: unknown): string | null {
698
+ if (isCodexUsageAccountLogLabel(explicit)) return explicit;
699
+ return legacyCodexAccountLabel(provider);
701
700
  }
702
701
 
703
- function buildAccounts(
704
- entries: PersistedUsageEntry[],
705
- fallbackAccountByProvider?: Record<string, string>,
706
- ): UsageAccount[] {
702
+ function buildAccounts(entries: PersistedUsageEntry[]): UsageAccount[] {
707
703
  const byLabel = new Map<string, UsageAccount>();
708
704
  const requestIds = new Map<string, Set<string>>();
709
705
 
@@ -716,13 +712,12 @@ function buildAccounts(
716
712
  totalTokens?: number;
717
713
  estimate: ReturnType<typeof estimateRequestCost>;
718
714
  }): void => {
719
- const label = accountLabelForAttribution(input.provider, input.accountLogLabel, fallbackAccountByProvider);
715
+ const label = accountLabelForAttribution(input.provider, input.accountLogLabel);
720
716
  if (!label) return;
721
717
  let row = byLabel.get(label);
722
718
  if (!row) {
723
719
  row = {
724
720
  accountLogLabel: label,
725
- provider: baseProviderLabel(input.provider),
726
721
  ambiguous: label === LEGACY_AMBIGUOUS_ACCOUNT_LABEL,
727
722
  requests: 0,
728
723
  attemptCount: 0,
@@ -823,7 +818,6 @@ export function summarizeUsage(
823
818
  range: UsageRange,
824
819
  now: number,
825
820
  surface: UsageSurface = "all",
826
- fallbackAccountByProvider?: Record<string, string>,
827
821
  ): UsageSummary {
828
822
  const { since } = rangeWindow(range, now);
829
823
  const filteredEntries = entries.filter(entry => {
@@ -853,7 +847,7 @@ export function summarizeUsage(
853
847
  days: buildDayGrid(range, since, now, filteredEntries),
854
848
  models: buildModels(filteredEntries, totals.totalTokens),
855
849
  providers: buildProviders(filteredEntries, totals.totalTokens),
856
- accounts: buildAccounts(filteredEntries, fallbackAccountByProvider),
850
+ accounts: buildAccounts(filteredEntries),
857
851
  };
858
852
  }
859
853
 
@@ -885,14 +879,12 @@ function normalizeFilterValue(input: string | null | undefined): string | null {
885
879
  */
886
880
  export function projectUsageSummary<T extends UsageSummary>(
887
881
  summary: T,
888
- filter: { provider?: string | null; model?: string | null; account?: string | null },
882
+ filter: { provider?: string | null; model?: string | null },
889
883
  entries?: PersistedUsageEntry[],
890
- fallbackAccountByProvider?: Record<string, string>,
891
884
  ): T & { filter?: UsageFilterEcho } {
892
885
  const provider = normalizeFilterValue(filter.provider);
893
886
  const model = normalizeFilterValue(filter.model);
894
- const account = normalizeFilterValue(filter.account);
895
- if (provider === null && model === null && account === null) return summary;
887
+ if (provider === null && model === null) return summary;
896
888
 
897
889
  // Re-summarise from the entries the summary was built from, rather than
898
890
  // projecting over its rows.
@@ -909,13 +901,9 @@ export function projectUsageSummary<T extends UsageSummary>(
909
901
  //
910
902
  // The entries are already in hand on every path that filters, so the honest
911
903
  // computation is also the simple one.
912
- const matches = (rowProvider: string, rowModel: string, rowAccount?: string | null): boolean => {
904
+ const matches = (rowProvider: string, rowModel: string): boolean => {
913
905
  if (provider !== null && baseProviderLabel(rowProvider).toLowerCase() !== provider) return false;
914
906
  if (model !== null && rowModel.toLowerCase() !== model) return false;
915
- if (account !== null && rowAccount !== undefined) {
916
- const effectiveAccount = accountLabelForAttribution(rowProvider, rowAccount, fallbackAccountByProvider);
917
- if (!effectiveAccount || effectiveAccount.toLowerCase() !== account) return false;
918
- }
919
907
  return true;
920
908
  };
921
909
 
@@ -931,10 +919,10 @@ export function projectUsageSummary<T extends UsageSummary>(
931
919
  const filtered: PersistedUsageEntry[] = [];
932
920
  for (const entry of source) {
933
921
  if (!entry.attempts?.length) {
934
- if (matches(entry.provider, antigravityUsageModel(entry.provider, entry.model), entry.accountLogLabel)) filtered.push(entry);
922
+ if (matches(entry.provider, antigravityUsageModel(entry.provider, entry.model))) filtered.push(entry);
935
923
  continue;
936
924
  }
937
- const attempts = entry.attempts.filter(a => matches(a.provider, antigravityUsageModel(a.provider, a.model), a.accountLogLabel ?? entry.accountLogLabel));
925
+ const attempts = entry.attempts.filter(a => matches(a.provider, antigravityUsageModel(a.provider, a.model)));
938
926
  if (attempts.length === 0) continue;
939
927
  // A combo is still counted once per participating model, so a filtered
940
928
  // request count can exceed the number of distinct requests. That is the
@@ -943,7 +931,7 @@ export function projectUsageSummary<T extends UsageSummary>(
943
931
  filtered.push({ ...entry, attempts });
944
932
  }
945
933
 
946
- const projected = summarizeUsage(filtered, summary.range, summary.generatedAt, summary.surface, fallbackAccountByProvider);
934
+ const projected = summarizeUsage(filtered, summary.range, summary.generatedAt, summary.surface);
947
935
  // matched reflects usage inside the requested WINDOW, not anywhere in the
948
936
  // log: summarizeUsage applies the range and surface predicates, and the CLI
949
937
  // uses this flag to decide between a table and "no usage recorded".