pi-provider-qoder 0.1.0

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 (3) hide show
  1. package/README.md +85 -0
  2. package/dist/index.js +1530 -0
  3. package/package.json +43 -0
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # pi-provider-qoder
2
+
3
+ A [pi](https://shittycodingagent.ai/) provider extension that connects pi to the **Qoder API**, exposing Qoder models through one provider surface.
4
+
5
+ ## Features
6
+
7
+ - **Interactive Login**: Standard OAuth browser device-code flow or Personal Access Token (PAT) login.
8
+ - **WAF Bypass**: Built-in WAF obfuscation and body encoding (`Encode=1`).
9
+ - **COSY Signing**: Full COSY signature header generation (RSA/AES-CBC/MD5).
10
+ - **Dynamic Model Catalog**: Dynamically fetches model limits, effort configurations, and options from the `/algo/api/v2/model/list` endpoint.
11
+ - **Reasoning/Thinking Support**: Real-time extraction of thinking process from API reasoning or HTML-like `<think>` tags.
12
+
13
+ ## Quick start
14
+
15
+ Install the provider:
16
+
17
+ ```bash
18
+ pi install npm:pi-provider-qoder
19
+ ```
20
+
21
+ Or install it globally with npm:
22
+
23
+ ```bash
24
+ npm install -g pi-provider-qoder
25
+ ```
26
+
27
+ Then log in from pi:
28
+
29
+ ```text
30
+ /login qoder
31
+ ```
32
+
33
+ The login flow will prompt you to complete authorization in your browser.
34
+
35
+ ### Personal Access Token (PAT) Fallback
36
+
37
+ For non-interactive environments, you can set the `QODER_PERSONAL_ACCESS_TOKEN` (or `QODER_PAT`) environment variable before starting pi. The provider will automatically pick up the PAT and authenticate.
38
+
39
+ ## Models
40
+
41
+ Exposes the following backing models:
42
+
43
+ - **Tier Tiers**: `auto`, `ultimate`, `performance`, `efficient`, `lite`
44
+ - **Frontier Models**:
45
+ - `qmodel` (Qwen3.7 Plus)
46
+ - `qmodel_latest` (Qwen3.7 Max)
47
+ - `dmodel` (DeepSeek V4 Pro)
48
+ - `dfmodel` (DeepSeek V4 Flash)
49
+ - `gm51model` (GLM 5.1)
50
+ - `kmodel` (Kimi K2.6)
51
+ - `mmodel` (MiniMax M3)
52
+
53
+ ## Usage
54
+
55
+ Once logged in, select any Qoder model in pi:
56
+
57
+ ```text
58
+ /model ultimate
59
+ ```
60
+
61
+ Or let Qoder select automatically:
62
+
63
+ ```text
64
+ /model auto
65
+ ```
66
+
67
+ ## Architecture
68
+
69
+ ```
70
+ src/
71
+ ├── index.ts # Extension registration
72
+ ├── cosy.ts # COSY Signature and Machine ID resolver
73
+ ├── login.ts # OAuth Device Flow login sequence
74
+ ├── login-ui.ts # Custom TUI components for login
75
+ ├── models.ts # Model definitions and Dynamic Config Cache
76
+ ├── oauth.ts # PAT / OAuth callback orchestrator
77
+ ├── stream.ts # Main streaming response handler
78
+ ├── transform.ts # Message conversions (OpenAI schema mapping)
79
+ ├── thinking-parser.ts # Fallback <think> tag parser
80
+ └── qoder-encoding.ts # WAF bypass body encoder
81
+ ```
82
+
83
+ ## License
84
+
85
+ MIT