kimi-code/packages/oauth/src
liruifengv b0f43aea28
feat(oauth): return structured managed usage rows (#2300)
* feat(oauth): return structured managed usage rows

Stop formatting plan-usage labels and reset hints into English strings
at the oauth layer. The parser still absorbs backend field drift, but
now emits a stable structured row (name / window{duration,unit} / used
/ limit / resetAt) that kap-server passes through and clients localize
themselves:

- window: normalized from duration/timeUnit (minute/hour/day/week),
  whole-hour minute windows fold to hours, unnamed summaries are the
  weekly limit
- resetAt: absolute ISO timestamp; relative reset_in/ttl seconds are
  converted at parse time
- TUI /usage panel formats labels and reset hints locally

* refactor(oauth): parse managed usage strictly to the current payload shape

Drop the defensive drift tolerance (alternate reset-time spellings,
reset_in/ttl seconds, remaining-derived used, title/scope names,
top-level duration/timeUnit, fuzzy time-unit matching) and parse only
what the platform actually sends: numeric strings, resetTime, nested
detail/window records, TIME_UNIT_* enums.

* fix(node-sdk): update managed usage smoke example and facade tests for structured rows
2026-07-28 15:03:25 +08:00
..
api-error.ts fix: Surface API-provided error messages for OAuth and managed API failures (#11) 2026-05-25 14:10:32 +08:00
constants.ts fix: scope managed OAuth credentials (#399) 2026-06-04 13:14:18 +08:00
custom-registry.ts fix: send the product User-Agent on provider registry and catalog fetches (#1597) 2026-07-13 17:45:34 +08:00
errors.ts fix(oauth): include the transport root cause in connection error messages (#1808) 2026-07-17 14:45:16 +08:00
identity.ts feat(managed-kimi-code): route anthropic protocol via beta api (#1186) 2026-06-29 14:24:01 +08:00
index.ts feat(oauth): return structured managed usage rows (#2300) 2026-07-28 15:03:25 +08:00
managed-feedback-upload.ts feat(feedback): support attaching logs and codebase (#1120) 2026-06-26 16:15:08 +08:00
managed-feedback.ts feat(feedback): support attaching logs and codebase (#1120) 2026-06-26 16:15:08 +08:00
managed-kimi-code.ts feat: refresh model list for API-key providers at the managed endpoint (#1824) 2026-07-17 17:17:58 +08:00
managed-usage.ts feat(oauth): return structured managed usage rows (#2300) 2026-07-28 15:03:25 +08:00
model-alias-merge.ts feat(oauth): parse support_efforts/default_effort in custom registry import (#1564) 2026-07-12 13:27:50 +08:00
oauth-manager.ts fix: classify OAuth token refresh errors by cause (#838) 2026-06-17 18:34:42 +08:00
oauth.ts fix(oauth): include the transport root cause in connection error messages (#1808) 2026-07-17 14:45:16 +08:00
open-platform.ts feat: add model alias overrides (#1262) 2026-07-01 19:57:13 +08:00
refreshProviderModels.ts feat: refresh model list for API-key providers at the managed endpoint (#1824) 2026-07-17 17:17:58 +08:00
storage.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
token-state.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
toolkit.ts feat: display Extra Usage fuel pack balance in /usage and /status (#1501) 2026-07-09 17:44:59 +08:00
types.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
utils.ts Kimi For Coding 2026-05-22 15:54:50 +08:00