@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.
- package/gui/dist/assets/{ApiKeys-LOOFiZfv.js → ApiKeys-CsmNyf4I.js} +1 -1
- package/gui/dist/assets/{Claude-BwKzpXe3.js → Claude-B4sHsGTD.js} +1 -1
- package/gui/dist/assets/{CodexSet-B5qi9KeE.js → CodexSet-BuAQ4YQn.js} +1 -1
- package/gui/dist/assets/{FileIntegrationPage-B0sUef6W.js → FileIntegrationPage-BC65sEaS.js} +1 -1
- package/gui/dist/assets/{Grok-bsb4n-f4.js → Grok-DNJWlISf.js} +1 -1
- package/gui/dist/assets/{Integrations-CSMwFDvM.js → Integrations-vGJshFZK.js} +2 -2
- package/gui/dist/assets/{IntegrationsOverview-CTORdKJA.js → IntegrationsOverview-DYMkDFHE.js} +1 -1
- package/gui/dist/assets/{Logs-BWYbfELf.js → Logs-Coc7_RPP.js} +1 -1
- package/gui/dist/assets/{Models-CexEtdT1.js → Models-CKVT8Meb.js} +1 -1
- package/gui/dist/assets/{NumberStepper-BapSFQnW.js → NumberStepper-Dug4wR8n.js} +1 -1
- package/gui/dist/assets/{Providers-BwUFeAgA.js → Providers-DyaCHRWL.js} +1 -1
- package/gui/dist/assets/{RestoreDialog-CD8piq90.js → RestoreDialog-BpuvVU2w.js} +1 -1
- package/gui/dist/assets/{Startup-BgX731C2.js → Startup-DAUQqNEN.js} +1 -1
- package/gui/dist/assets/{Storage-Bgq7HphP.js → Storage-DfP95SlJ.js} +1 -1
- package/gui/dist/assets/{Subagents-ChxItbeF.js → Subagents-CMNsZLfk.js} +1 -1
- package/gui/dist/assets/{Usage-BkylzP50.js → Usage-ESFRfBMO.js} +1 -1
- package/gui/dist/assets/{codex-stale-banner-D4gvSWnO.js → codex-stale-banner-W4FhikN7.js} +1 -1
- package/gui/dist/assets/{data-surface-BtO3lwam.js → data-surface-B8PX8rjm.js} +1 -1
- package/gui/dist/assets/{data-surface-pCXChiBf.js → data-surface-CETFXqiA.js} +1 -1
- package/gui/dist/assets/{index-CNopOid3.js → index-DHQHBRhb.js} +3 -3
- package/gui/dist/assets/{model-display-CiUpg8T9.js → model-display-OBTJhQwT.js} +1 -1
- package/gui/dist/assets/{provider-payload-b2jlS-On.js → provider-payload-CJRJUn7w.js} +1 -1
- package/gui/dist/assets/{section-tabs-BP7gEPK6.js → section-tabs-B8sLMiz6.js} +1 -1
- package/gui/dist/assets/shared-DI18-uF7.js +69 -0
- package/gui/dist/index.html +2 -2
- package/package.json +3 -1
- package/src/adapters/base.ts +26 -0
- package/src/adapters/cursor/catalog.ts +541 -0
- package/src/adapters/cursor/cursor-errors.ts +15 -0
- package/src/adapters/cursor/discovery.ts +34 -41
- package/src/adapters/cursor/envelope-echo.ts +128 -0
- package/src/adapters/cursor/request-builder.ts +19 -12
- package/src/adapters/cursor/tool-definitions.ts +2 -1
- package/src/adapters/cursor/tool-result-normalize.ts +23 -31
- package/src/adapters/cursor.ts +21 -2
- package/src/adapters/exec-tool-result-normalize.ts +99 -0
- package/src/adapters/google-antigravity-replay.ts +71 -2
- package/src/adapters/google.ts +19 -4
- package/src/adapters/kiro-constants.ts +12 -0
- package/src/adapters/kiro.ts +128 -11
- package/src/adapters/openai-chat.ts +16 -2
- package/src/adapters/openai-responses.ts +15 -2
- package/src/adapters/tool-catalog-nudge.ts +2 -1
- package/src/adapters/xai-web-search.ts +10 -14
- package/src/claude/outbound.ts +14 -3
- package/src/cli/access.ts +46 -3
- package/src/cli/account-api.ts +93 -16
- package/src/cli/account-extended.ts +262 -36
- package/src/cli/account-main.ts +12 -12
- package/src/cli/account.ts +40 -10
- package/src/cli/agent.ts +8 -1
- package/src/cli/capabilities-command.ts +94 -0
- package/src/cli/capabilities.ts +535 -0
- package/src/cli/claude-desktop.ts +31 -11
- package/src/cli/dispatch.ts +195 -27
- package/src/cli/doctor.ts +100 -1
- package/src/cli/help.ts +11 -2
- package/src/cli/index.ts +19 -3
- package/src/cli/inspect.ts +230 -0
- package/src/cli/observe.ts +11 -3
- package/src/cli/registry.ts +34 -2
- package/src/cli/runtime-api.ts +51 -7
- package/src/cli/status.ts +16 -0
- package/src/cli/storage.ts +234 -0
- package/src/cli/system-command.ts +16 -0
- package/src/cli/usage-report.ts +52 -2
- package/src/cli/version-skew.ts +46 -0
- package/src/codex/account-label.ts +21 -0
- package/src/codex/catalog/provider-fetch.ts +4 -0
- package/src/codex/transition-state.ts +12 -3
- package/src/compatibility/openai-responses.ts +9 -1
- package/src/generated/compatibility-version.json +94 -58
- package/src/integrations/ownership-policy.ts +24 -5
- package/src/integrations/ownership.ts +36 -2
- package/src/integrations/state.ts +40 -7
- package/src/integrations/writer.ts +21 -3
- package/src/lib/admin-secrets.ts +24 -0
- package/src/lib/errors.ts +25 -1
- package/src/lib/service-secrets.ts +15 -0
- package/src/oauth/store.ts +16 -6
- package/src/providers/label.ts +34 -1
- package/src/responses/turn-termination.ts +107 -0
- package/src/server/management/logs-usage-routes.ts +5 -27
- package/src/server/management/route-registry.ts +317 -0
- package/src/server/proxy-liveness.ts +27 -4
- package/src/server/request-log.ts +37 -17
- package/src/server/responses/core.ts +80 -4
- package/src/server/responses/policy-fallback.ts +1 -1
- package/src/service.ts +34 -0
- package/src/storage/policy-job.ts +14 -4
- package/src/storage/policy.ts +79 -33
- package/src/usage/log.ts +32 -6
- package/src/usage/summary.ts +22 -34
- package/gui/dist/assets/shared-BdYGV-yJ.js +0 -69
package/src/usage/summary.ts
CHANGED
|
@@ -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
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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)
|
|
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)
|
|
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
|
|
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".
|