Skip to content

feat: add Kimi for Coding support#46

Open
overbit wants to merge 12 commits intoslkiser:mainfrom
overbit:feat/kimi-for-code
Open

feat: add Kimi for Coding support#46
overbit wants to merge 12 commits intoslkiser:mainfrom
overbit:feat/kimi-for-code

Conversation

@overbit
Copy link
Copy Markdown

@overbit overbit commented Apr 16, 2026

Summary

Introduce the Kimi Code provider, enabling authentication through environment variables and configuration files. Implement a quota fetcher with string-number parsing and a fallback mechanism. Add tests for the new provider and ensure alignment of package dependencies. This enhancement expands the functionality of the application by integrating Kimi's services.

image

Linked Issue

#45

OpenCode Validation

  • Current production released OpenCode version tested: 1.4.6
  • Why this version is relevant to the fix:

Quality Checklist

  • I ran npm run typecheck
  • I ran npm test
  • I ran npm run build
  • This is the smallest safe root-cause fix (no unnecessary hook/output mutation logic)
  • I preserved behavioral invariants and updated/added boundary tests as needed
  • I updated docs for user-facing workflow/command/config changes (README.md and CONTRIBUTING.md when applicable)

slkiser and others added 11 commits April 15, 2026 15:56
Introduce TUI sidebar support and centralize quota rendering logic. Adds new TUI runtime, sidebar formatter, config diagnostics, and quota-render-data modules; updates display sanitization and quota-status to include TUI diagnostics. Package.json exports, oc-plugin entries, dependencies, and build script updated to publish TUI assets (prepare-tui-dist). README updated with TUI install instructions and OpenCode version bump. Plugin code refactored to reuse collectQuotaRenderData/provider cache logic (removes duplication). New tests and tui.jsonc added to cover TUI behavior and rendering.
Add a compact, width-safe session tokens renderer and fix TUI sidebar to use a dedicated compact layout.

- Introduce renderSessionTokensLines(options) with maxWidth to choose between wide and compact layouts; add renderCompactSessionTokensLines and WIDE_SESSION_TOKEN_LINE_WIDTH.
- Pass maxWidth through formatQuotaRows and grouped toast formatter so callers can request compact token output.
- Add TUI_SIDEBAR_LAYOUT constant (and export it) and make buildSidebarQuotaPanelLines use that fixed layout instead of reading toast layout from config; clamp sidebar width to a safe, compact renderer.
- Update tests to cover the new compact session-token formatting and the sidebar layout behavior.
- Update README to note that the TUI sidebar uses its own fixed compact layout and that toast layout settings only affect toasts.
Introduce a shared "Session input/output tokens" heading and sidebar-friendly rendering: export SESSION_TOKEN_SECTION_HEADING, normalize/clamp helpers, and renderSidebarSessionTokenSummaryLines from session-tokens-format (one-line totals for the fixed-width TUI panel). Add tui-line-style helper to preserve normal text color for the heading and mute other lines, and update tui.tsx to use it. Modify tui-sidebar-format to keep per-model token rows out of the main quota formatter and append the compact sidebar summary. Update types/comments and README to document TUI install step, shared settings (toast vs sidebar differences), and the showSessionTokens behavior. Update and add tests to cover rendering, runtime behavior, styling, and config runtime-path mocking.
Replace the boolean `enabled` panel flag with a `SidebarPanelState` (status: "loading" | "disabled" | "ready") and add helpers `shouldRenderSidebarPanel` and `getSidebarPanelLines`. Update runtime and TUI code to use the new state shape and to hide the panel when disabled while providing appropriate loading/unavailable placeholders. Improve line color logic to keep truncated session-heading text highlighted. Add unit and integration tests for panel state, runtime behavior, line styling, and config runtime-path resolution, and update README wording to clarify how the sidebar hides stale/loading quota content when disabled.
# Conflicts:
#	package-lock.json
@overbit overbit force-pushed the feat/kimi-for-code branch from c70eb0d to 94ccf46 Compare April 16, 2026 14:33
@overbit overbit marked this pull request as ready for review April 16, 2026 14:34
@overbit
Copy link
Copy Markdown
Author

overbit commented Apr 16, 2026

@slkiser this is now based on your latest commits to main..

@slkiser
Copy link
Copy Markdown
Owner

slkiser commented Apr 16, 2026

Hello, sorry I push to main for this project, I'll take a look and implement soon :)

# Conflicts:
#	README.md
#	package-lock.json
#	src/lib/quota-status.ts
@overbit
Copy link
Copy Markdown
Author

overbit commented Apr 17, 2026

@slkiser I've fixed this pr against your force pushed main branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants