Skip to content

Commit 979c0f5

Browse files
committed
feat: add OpenAI Codex OAuth login and refresh UI polish
Implement the full OpenAI Codex OAuth flow with callback handling, model selection, and token refresh. Rename pi-tui theme adapters to pythinker-theme, share OAuth HTML pages across CLI and web, and align thinking spinner labels and README branding across TUI and web.
1 parent eda5e65 commit 979c0f5

85 files changed

Lines changed: 3218 additions & 1366 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/write-tui/SKILL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For any list dialog, selector, input box, or status/toggle list, the interaction
2525
- `src/tui/commands/` — slash-command declaration, parsing, ordering, and dynamic skill-command generation. Parsing and types only; execution is dispatched from `PythinkerTUI`'s slash-command handler section, and complex execution sinks into `utils` or focused components.
2626
- `src/tui/components/` — pi-tui components by UI type: `chrome/` (footer, todo, welcome, loader, device code), `dialogs/` (selectors, approval/question panels, settings popups that replace the editor), `editor/` (input box + mention provider), `media/` (image, diff, code highlight), `messages/` (transcript blocks + tool-renderers), `panes/` (activity, queue).
2727
- `src/tui/reverse-rpc/` — adapts SDK approval/question callbacks into UI panel data and the user's choice back into an SDK response.
28-
- `src/tui/theme/` — themes, color tokens, style helpers, pi-tui markdown theme, terminal-background detection. The single source of truth for color.
28+
- `src/tui/theme/` — themes, color tokens, Pythinker markdown/editor theme adapters, terminal-background detection. The single source of truth for color.
2929
- `src/tui/utils/` — TUI-only utilities (need `TUIState` or a component). App-wide, UI-independent helpers go in `src/utils/`.
3030

3131
When a controller or `PythinkerTUI` section keeps growing, split pure functions, state projections, and presentation components into the matching directory rather than expanding the file.
@@ -62,10 +62,9 @@ The feature type decides the landing spot:
6262
Themes are managed centrally under `src/tui/theme/`:
6363

6464
- `colors.ts` — semantic tokens: `ColorPalette`, `darkColors`, `lightColors`.
65-
- `styles.ts`common chalk helpers built on top of `ColorPalette`.
66-
- `pi-tui-theme.ts` — the markdown/pi-tui theme config.
65+
- `pythinker-theme.ts`Pythinker markdown and editor theme adapters (`createPythinkerMarkdownTheme`, `createPythinkerEditorTheme`).
66+
- `theme.ts` — the global `Theme` singleton and `currentTheme` accessor.
6767
- `terminal-background.ts` — terminal background detection used by auto resolution.
68-
- `bundle.ts` — packs `colors`, `styles`, `markdownTheme` into a `PythinkerTUIThemeBundle`.
6968
- `index.ts` / `detect.ts` — theme type and auto/dark/light resolution.
7069

7170
> **Keep the color-token set in sync.** `ColorPalette` in `colors.ts` is the source of truth for color tokens. When you add, rename, or remove one, update its mirrors in the same change: the custom-theme JSON schema (`apps/pythinker-code/src/tui/theme/theme-schema.json`), the token tables in the custom-theme docs (`docs/en/customization/themes.md`), and the token table in the `custom-theme` built-in skill (`packages/agent-core/src/skill/builtin/custom-theme.md`).

README.md

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
<div align="center">
22

3-
<img src="apps/pythinker-web/public/brand/bimi-logo.svg" alt="PyThinker logo" width="128" />
3+
<a href="https://www.pythinker.com">
4+
<img src="apps/pythinker-web/public/brand/pythinker_animated.svg" alt="Pythinker animated logo" width="112" />
5+
</a>
46

5-
# PyThinker
7+
<br />
8+
9+
<a href="https://www.pythinker.com/code">
10+
<img src="docs/media/readme-hero.svg" alt="Pythinker Code — next-gen AI coding agents in your terminal" width="100%" />
11+
</a>
12+
13+
<br />
14+
15+
# Pythinker Code
616

717
**The starting point for next-generation AI coding agents.**
818

9-
An intelligent terminal agent that reads your codebase, edits files, runs shell commands, searches the web, and iterates until the job is done — powered by Pythinker models and compatible with other LLM providers.
19+
An intelligent terminal agent that reads your codebase, edits files, runs shell commands, searches the web, and iterates until the job is done — powered by [Pythinker models](https://www.pythinker.com) and compatible with other LLM providers.
1020

1121
<br />
1222

23+
[![Website](https://img.shields.io/badge/website-pythinker.com-1783ff?style=for-the-badge&logo=googlechrome&logoColor=white)](https://www.pythinker.com)
24+
[![Pythinker Code](https://img.shields.io/badge/product-Pythinker_Code-213853?style=for-the-badge)](https://www.pythinker.com/code)
1325
[![CI](https://img.shields.io/github/actions/workflow/status/Pythoughts-labs/pythinker-cli/ci.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=white&label=CI)](https://github.com/Pythoughts-labs/pythinker-cli/actions/workflows/ci.yml)
1426
[![npm version](https://img.shields.io/npm/v/@pythoughts-ai/pythinker-code?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@pythoughts-ai/pythinker-code)
1527
[![License: MIT](https://img.shields.io/badge/License-MIT-EE9983?style=for-the-badge)](LICENSE)
@@ -19,13 +31,13 @@ An intelligent terminal agent that reads your codebase, edits files, runs shell
1931

2032
<br />
2133

22-
[Documentation](https://pythoughtsai.github.io/pythinker-code/en/) · [Quick Start](#-quick-start) · [Features](#-features) · [Contributing](CONTRIBUTING.md) · [Report Issue](https://github.com/PythoughtsAI/pythinker-code/issues)
34+
**[pythinker.com](https://www.pythinker.com)** · **[Pythinker Code](https://www.pythinker.com/code)** · **[API Console](https://www.pythinker.com/code/console)** · **[Documentation](https://pythoughtsai.github.io/pythinker-code/en/)** · **[Quick Start](#-quick-start)** · **[Features](#-features)** · **[Contributing](CONTRIBUTING.md)** · **[Report Issue](https://github.com/Pythoughts-labs/pythinker-cli/issues)**
2335

2436
</div>
2537

2638
---
2739

28-
![Demo of PyThinker in action](./docs/media/intro.gif)
40+
![Demo of Pythinker Code in action](./docs/media/intro.gif)
2941

3042
## Table of Contents
3143

@@ -47,15 +59,27 @@ An intelligent terminal agent that reads your codebase, edits files, runs shell
4759

4860
## Overview
4961

50-
**PyThinker** (Pythinker Code CLI) is an AI coding agent built for real engineering work in the terminal. Give it a task — refactor a module, trace a bug, scaffold a feature — and it plans, executes tools, observes results, and keeps going until you are satisfied.
62+
**Pythinker Code** is an AI coding agent built for real engineering work in the terminal. Give it a task — refactor a module, trace a bug, scaffold a feature — and it plans, executes tools, observes results, and keeps going until you are satisfied.
5163

5264
| | |
5365
|---|---|
5466
| **Runs locally** | Your repo stays on your machine; the agent acts through a fast, purpose-built TUI |
5567
| **Tool-native** | File I/O, shell, grep, web fetch, MCP servers, subagents, and lifecycle hooks |
56-
| **Provider-flexible** | Works out of the box with Pythinker models; configurable for other compatible APIs |
68+
| **Provider-flexible** | Works out of the box with [Pythinker models](https://www.pythinker.com); configurable for other compatible APIs |
5769
| **Editor-ready** | Drive sessions from Zed, JetBrains, or any [ACP](https://agentclientprotocol.com/) client |
5870

71+
### Pythinker ecosystem
72+
73+
| Resource | Link |
74+
|----------|------|
75+
| Pythinker website | [pythinker.com](https://www.pythinker.com) |
76+
| Pythinker Code product | [pythinker.com/code](https://www.pythinker.com/code) |
77+
| API keys & console | [pythinker.com/code/console](https://www.pythinker.com/code/console) |
78+
| Install scripts (CDN) | [code.pythinker.com](https://code.pythinker.com/pythinker-code/install.sh) |
79+
| Open Platform | [platform.pythinker.com](https://platform.pythinker.com) |
80+
| npm package | [@pythoughts-ai/pythinker-code](https://www.npmjs.com/package/@pythoughts-ai/pythinker-code) |
81+
| Documentation | [pythoughtsai.github.io/pythinker-code](https://pythoughtsai.github.io/pythinker-code/en/) |
82+
5983
---
6084

6185
## ✨ Features
@@ -111,7 +135,7 @@ An intelligent terminal agent that reads your codebase, edits files, runs shell
111135

112136
## 🏗 Architecture
113137

114-
PyThinker is a **pnpm monorepo**. The CLI consumes capabilities through the SDK and never depends directly on internal engine packages.
138+
Pythinker Code is a **pnpm monorepo**. The CLI consumes capabilities through the SDK and never depends directly on internal engine packages.
115139

116140
```mermaid
117141
flowchart LR
@@ -124,7 +148,7 @@ flowchart LR
124148
subgraph Packages
125149
SDK["node-sdk"]
126150
CORE["agent-core"]
127-
KOSONG["kosong<br/>(LLM providers)"]
151+
ANYLLM["Any LLM<br/>(provider abstraction)"]
128152
KAOS["kaos<br/>(Execution env)"]
129153
SERVER["server<br/>(REST + WebSocket)"]
130154
end
@@ -134,15 +158,15 @@ flowchart LR
134158
DASH --> SERVER
135159
SDK --> CORE
136160
SERVER --> CORE
137-
CORE --> KOSONG
161+
CORE --> ANYLLM
138162
CORE --> KAOS
139163
```
140164

141165
| Package | Role |
142166
|---------|------|
143167
| `apps/pythinker-code` | CLI and terminal UI — the primary user-facing entry point |
144168
| `packages/agent-core` | Unified agent engine: sessions, tools, skills, permissions, plans |
145-
| `packages/kosong` | LLM and provider abstraction layer |
169+
| Any LLM (`packages/kosong`) | LLM and provider abstraction layer |
146170
| `packages/kaos` | Execution environment and file/process abstractions |
147171
| `packages/server` | Hosts agent sessions over REST + WebSocket (`/api/v1`) |
148172
| `packages/node-sdk` | Public TypeScript SDK for embedding and automation |
@@ -153,7 +177,7 @@ flowchart LR
153177

154178
### Recommended — install script
155179

156-
No Node.js required.
180+
No Node.js required. Scripts are served from [code.pythinker.com](https://code.pythinker.com/pythinker-code/install.sh).
157181

158182
**macOS / Linux**
159183

@@ -173,7 +197,7 @@ brew install pythinker-code
173197
irm https://code.pythinker.com/pythinker-code/install.ps1 | iex
174198
```
175199

176-
> **Windows note:** Install [Git for Windows](https://gitforwindows.org/) before first launch. PyThinker uses the bundled Git Bash as its shell. For a custom Git Bash location, set `PYTHINKER_SHELL_PATH` to the absolute path of `bash.exe`.
200+
> **Windows note:** Install [Git for Windows](https://gitforwindows.org/) before first launch. Pythinker Code uses the bundled Git Bash as its shell. For a custom Git Bash location, set `PYTHINKER_SHELL_PATH` to the absolute path of `bash.exe`.
177201
178202
Open a **new shell** and verify:
179203

@@ -202,7 +226,7 @@ cd your-project
202226
pythinker
203227
```
204228

205-
On first launch, run `/login` and choose **Pythinker Code OAuth** or a **Pythoughts Open Platform API key**. Then try your first task:
229+
On first launch, run `/login` and choose **[Pythinker Code OAuth](https://www.pythinker.com/code)** or an **[API key from the console](https://www.pythinker.com/code/console)**. Then try your first task:
206230

207231
```
208232
Take a look at this project and explain its main directories.
@@ -245,14 +269,14 @@ Use the SDK or server mode for programmatic control. See the [command reference]
245269

246270
## 🖥 Editor Integration (ACP)
247271

248-
PyThinker speaks the [Agent Client Protocol](https://agentclientprotocol.com/). Log in once via the CLI, then point your editor at `pythinker acp`.
272+
Pythinker Code speaks the [Agent Client Protocol](https://agentclientprotocol.com/). Log in once via the CLI, then point your editor at `pythinker acp`.
249273

250274
**Zed** — add to `~/.config/zed/settings.json`:
251275

252276
```json
253277
{
254278
"agent_servers": {
255-
"PyThinker": {
279+
"Pythinker Code": {
256280
"type": "custom",
257281
"command": "pythinker",
258282
"args": ["acp"],
@@ -276,6 +300,7 @@ Open a new conversation in Zed's Agent panel. For JetBrains setup, troubleshooti
276300
| IDE integration | [guides/ides](https://pythoughtsai.github.io/pythinker-code/en/guides/ides) |
277301
| Configuration | [configuration/config-files](https://pythoughtsai.github.io/pythinker-code/en/configuration/config-files) |
278302
| Command reference | [reference/pythinker-command](https://pythoughtsai.github.io/pythinker-code/en/reference/pythinker-command) |
303+
| Pythinker Code product | [pythinker.com/code](https://www.pythinker.com/code) |
279304

280305
---
281306

@@ -284,8 +309,8 @@ Open a new conversation in Zed's Agent panel. For JetBrains setup, troubleshooti
284309
**Requirements:** Node.js ≥ 24.15.0 · pnpm 10.33.0 · Git
285310

286311
```sh
287-
git clone https://github.com/PythoughtsAI/pythinker-code.git
288-
cd pythinker-code
312+
git clone https://github.com/Pythoughts-labs/pythinker-cli.git
313+
cd pythinker-cli
289314
pnpm install
290315
```
291316

@@ -324,9 +349,12 @@ pnpm lint:fix # auto-fix lint issues
324349

325350
| Channel | Link |
326351
|---------|------|
327-
| Bug reports & feature requests | [GitHub Issues](https://github.com/PythoughtsAI/pythinker-code/issues) |
352+
| Pythinker website | [pythinker.com](https://www.pythinker.com) |
353+
| Pythinker Code | [pythinker.com/code](https://www.pythinker.com/code) |
354+
| API console | [pythinker.com/code/console](https://www.pythinker.com/code/console) |
355+
| Bug reports & feature requests | [GitHub Issues](https://github.com/Pythoughts-labs/pythinker-cli/issues) |
328356
| Security vulnerabilities | [SECURITY.md](SECURITY.md)**do not** open public issues |
329-
| Private security disclosure | [GitHub Security Advisories](https://github.com/PythoughtsAI/pythinker-code/security/advisories/new) |
357+
| Private security disclosure | [GitHub Security Advisories](https://github.com/Pythoughts-labs/pythinker-cli/security/advisories/new) |
330358
| Security email | [code@pythoughts.ai](mailto:code@pythoughts.ai) (include `[security]` in the subject) |
331359

332360
---
@@ -345,8 +373,8 @@ Our TUI is built on [`pi-tui`](https://github.com/earendil-works/pi-mono/tree/ma
345373

346374
<div align="center">
347375

348-
**Built with care by [Pythoughts](https://github.com/PythoughtsAI)**
376+
**Built with care by [Pythoughts](https://www.pythinker.com)**
349377

350-
<sub>PyThinker · Pythinker Code CLI · Next-gen agents in your terminal</sub>
378+
<sub>[pythinker.com](https://www.pythinker.com) · [Pythinker Code](https://www.pythinker.com/code) · Next-gen agents in your terminal</sub>
351379

352380
</div>

apps/dashboard/server/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
"@hono/node-server": "^1.13.7",
3535
"@pythoughts-ai/agent-core": "workspace:^",
3636
"@pythoughts-ai/kosong": "workspace:^",
37-
"hono": "^4.7.7"
37+
"hono": "^4.12.25"
3838
},
3939
"devDependencies": {
40-
"tsx": "^4.21.0",
41-
"vitest": "4.1.4"
40+
"tsx": "^4.22.4",
41+
"vitest": "4.1.9"
4242
}
4343
}

apps/dashboard/web/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
"typecheck": "tsc --noEmit"
2222
},
2323
"dependencies": {
24-
"@tanstack/react-query": "^5.74.4",
25-
"@tanstack/react-virtual": "^3.13.5",
26-
"react": "^19.1.0",
27-
"react-dom": "^19.1.0",
28-
"react-router-dom": "^7.5.2"
24+
"@tanstack/react-query": "^5.101.0",
25+
"@tanstack/react-virtual": "^3.14.3",
26+
"react": "^19.2.7",
27+
"react-dom": "^19.2.7",
28+
"react-router-dom": "^7.18.0"
2929
},
3030
"devDependencies": {
31-
"@tailwindcss/vite": "^4.1.4",
32-
"@types/react": "^19.1.2",
31+
"@tailwindcss/vite": "^4.3.1",
32+
"@types/react": "^19.2.17",
3333
"@types/react-dom": "^19.1.2",
3434
"@vitejs/plugin-react": "^4.4.1",
35-
"tailwindcss": "^4.1.4",
36-
"typescript": "6.0.2",
35+
"tailwindcss": "^4.3.1",
36+
"typescript": "6.0.3",
3737
"vite": "^6.3.3",
3838
"vite-plugin-singlefile": "^2.3.3"
3939
}

apps/pythinker-code/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Main directories:
2828
- `src/tui/components/messages/`: message blocks in the transcript — assistant, user, tool call, thinking, usage, subagent, and so on.
2929
- `src/tui/components/panes/`: right-side / activity-area panes such as the activity pane and queue pane.
3030
- `src/tui/reverse-rpc/`: the adapter layer that bridges SDK approval/question callbacks to the UI.
31-
- `src/tui/theme/`: themes, color tokens, style helpers, terminal-background detection, and the pi-tui markdown theme.
31+
- `src/tui/theme/`: themes, color tokens, terminal-background detection, and the Pythinker markdown/editor theme (`pythinker-theme.ts`).
3232
- `src/tui/utils/`: TUI-only utility functions.
3333
- `src/utils/`: app-wide utilities — clipboard, git, history, image, process, usage, and so on.
3434

apps/pythinker-code/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythoughts-ai/pythinker-code",
3-
"version": "0.17.1",
3+
"version": "0.1.0",
44
"description": "The Starting Point for Next-Gen Agents",
55
"license": "MIT",
66
"author": "Pythoughts",
@@ -74,29 +74,29 @@
7474
"postinstall": "node scripts/postinstall.mjs"
7575
},
7676
"optionalDependencies": {
77-
"@mariozechner/clipboard": "^0.3.2",
77+
"@mariozechner/clipboard": "^0.3.9",
7878
"chalk": "^5.4.1",
7979
"cli-highlight": "^2.1.11",
8080
"commander": "^13.1.0",
8181
"koffi": "^2.16.0",
8282
"node-pty": "^1.1.0",
8383
"pathe": "^2.0.3",
8484
"pino-pretty": "^13.0.0",
85-
"semver": "^7.7.4",
85+
"semver": "^7.8.4",
8686
"smol-toml": "^1.6.1",
87-
"zod": "^4.3.6"
87+
"zod": "^4.4.3"
8888
},
8989
"devDependencies": {
90-
"@earendil-works/pi-tui": "^0.74.0",
90+
"@earendil-works/pi-tui": "^0.79.6",
9191
"@pythoughts-ai/acp-adapter": "workspace:^",
92+
"@pythoughts-ai/dashboard-server": "workspace:^",
93+
"@pythoughts-ai/dashboard-web": "workspace:*",
94+
"@pythoughts-ai/migration-legacy": "workspace:^",
9295
"@pythoughts-ai/pythinker-code-oauth": "workspace:^",
9396
"@pythoughts-ai/pythinker-code-sdk": "workspace:^",
9497
"@pythoughts-ai/pythinker-telemetry": "workspace:^",
9598
"@pythoughts-ai/pythinker-web": "workspace:^",
96-
"@pythoughts-ai/migration-legacy": "workspace:^",
9799
"@pythoughts-ai/server": "workspace:^",
98-
"@pythoughts-ai/dashboard-server": "workspace:^",
99-
"@pythoughts-ai/dashboard-web": "workspace:*",
100100
"@types/semver": "^7.7.0",
101101
"@types/yazl": "^2.4.6",
102102
"chalk": "^5.4.1",
@@ -106,9 +106,9 @@
106106
"postject": "1.0.0-alpha.6",
107107
"semver": "^7.7.4",
108108
"smol-toml": "^1.6.1",
109-
"tsx": "^4.21.0",
109+
"tsx": "^4.22.4",
110110
"yazl": "^3.3.1",
111-
"zod": "^4.3.6"
111+
"zod": "^4.4.3"
112112
},
113113
"engines": {
114114
"node": ">=22.19.0"

apps/pythinker-code/src/constant/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ErrorCodes } from '@pythoughts-ai/pythinker-code-sdk';
22

3-
export const PRODUCT_NAME = 'Pythinker Code';
3+
export const PRODUCT_NAME = 'Kimi';
44
export const CLI_COMMAND_NAME = 'pythinker';
55
export const PROCESS_NAME = 'pythinker-code';
66

0 commit comments

Comments
 (0)