@herbertgao/pi-extensions 2026.10.3 → 2026.10.4

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/README.md CHANGED
@@ -21,6 +21,7 @@ When migrating from `pi-mcp-adapter`, remove any standalone adapter install as w
21
21
  The package bundles 5 active `@herbertgao/*` child packages—`pi-agency`, `pi-bark`, `pi-cc-extensions`, `pi-subagents`, and `sol-pi`—plus the following upstream packages under their original names:
22
22
 
23
23
  - `pi-antigravity@0.10.0`
24
+ - `pi-provider-qoder@0.5.0`
24
25
  - `@dietrichgebert/ponytail@5.1.0`
25
26
  - `@juicesharp/rpiv-ask-user-question@2.12.0`
26
27
  - `@narumitw/pi-btw@0.61.1`
@@ -59,7 +60,7 @@ The locally customized CC and SoL-Pi packages now follow complete upstream basel
59
60
 
60
61
  `pi-jev-auto-mode@0.5.0` adds fail-closed Jev safety gates for shell commands and file changes. `pi-typesafe@0.9.1` provides `/typesafe` and `typesafe_evaluate` for explicit structured decisions; `/typesafe enable` or `PI_TYPESAFE_ENABLED=1` is still required for agent tool calls. The Pi extension continues to use the TypeSafe API, not Liquid. The package's programmatic client additionally supports Liquid with its own API key and free or paid models; existing usage accounting now merges writes under a short-lived file lock (up to 200ms synchronous wait under contention).
61
62
 
62
- `resume-from@0.4.1` continues sessions across Pi, Claude Code, and Codex; it keeps a Claude Code session matched to its start directory when the active transcript later moves into a nested cwd. `@herbertgao/sol-pi` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.4.1` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. `pi-web-access@0.38.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. It adds structured search/fetch data for codemode and an optional, manually started `pi-web-access-mcp` stdio CLI; installing the aggregate does not start that server. Degoog, Keenable, and the new Ceramic provider are explicit-only, excluded from automatic and `all` selection. OpenAI search now defaults to `gpt-6-luna`, results and clone cleanup are scoped per extension instance, and the promoted `@modelcontextprotocol/sdk@^1.32.1` moves the bundle off GHSA-6qxp-vccf-f47h. Perplexity search now uses the Search API's ranked pages and snippets rather than a Sonar-generated answer; requests requiring prose still use Sonar. `pi-antigravity@0.10.0` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
63
+ `resume-from@0.4.1` continues sessions across Pi, Claude Code, and Codex; it keeps a Claude Code session matched to its start directory when the active transcript later moves into a nested cwd. `@herbertgao/sol-pi` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.4.1` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. `pi-web-access@0.38.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. It adds structured search/fetch data for codemode and an optional, manually started `pi-web-access-mcp` stdio CLI; installing the aggregate does not start that server. Degoog, Keenable, and the new Ceramic provider are explicit-only, excluded from automatic and `all` selection. OpenAI search now defaults to `gpt-6-luna`, results and clone cleanup are scoped per extension instance, and the promoted `@modelcontextprotocol/sdk@^1.32.1` moves the bundle off GHSA-6qxp-vccf-f47h. Perplexity search now uses the Search API's ranked pages and snippets rather than a Sonar-generated answer; requests requiring prose still use Sonar. `pi-antigravity@0.10.0` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. `pi-provider-qoder@0.5.0` registers the `qoder` and `qoder-cn` model providers. Sign in with `/login qoder` (browser or a personal access token from [qoder.com/account/integrations](https://qoder.com/account/integrations)) or `/login qoder-cn` (token from [qoder.com.cn/account/integrations](https://qoder.com.cn/account/integrations)). `QODER_PERSONAL_ACCESS_TOKEN` and `QODERCN_PERSONAL_ACCESS_TOKEN` log those providers in at startup. `/qoder-usage footer on` replaces the status-bar footer for that session, so leave it off while the pi-cc footer is in use. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
63
64
 
64
65
  `pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
65
66
 
@@ -238,3 +238,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
238
238
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
239
239
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
240
240
  THE SOFTWARE.
241
+
242
+ ## `pi-provider-qoder`
243
+
244
+ The aggregate bundles [`pi-provider-qoder`](https://github.com/simonsmh/pi-provider-qoder) version 0.5.0 under its original package name. npm metadata and the repository README declare the MIT license. The published tarball does not include a LICENSE file. The published package corresponds to git commit [`2e29cbbda03862e20f216c5ecbb6c6042a6cabd7`](https://github.com/simonsmh/pi-provider-qoder/commit/2e29cbbda03862e20f216c5ecbb6c6042a6cabd7).
@@ -0,0 +1,140 @@
1
+ # pi-provider-qoder
2
+
3
+ A [pi](https://shittycodingagent.ai/) extension that connects pi to Qoder.
4
+
5
+ ```bash
6
+ pi install npm:pi-provider-qoder
7
+ # or: omp install npm:pi-provider-qoder
8
+ ```
9
+
10
+ ```bash
11
+ pi --provider qoder --model Lite
12
+ pi --provider qoder-cn --model Qwen3.7-Plus
13
+ ```
14
+
15
+ Inside pi:
16
+
17
+ ```text
18
+ /login qoder
19
+ /model Qwen3.8-Max
20
+ ```
21
+
22
+ ## Providers
23
+
24
+ Both providers register together.
25
+
26
+ ### `qoder` (global)
27
+
28
+ - `https://api3.qoder.sh/`
29
+ - Login: `/login qoder` (browser OAuth or PAT)
30
+ - PAT page: https://qoder.com/account/integrations
31
+ - Env (first match): `QODER_API_KEY`, `QODER_PERSONAL_ACCESS_TOKEN`, `QODER_PAT`
32
+
33
+ ### `qoder-cn` (China)
34
+
35
+ - `https://gateway.qoder.com.cn/`
36
+ - Login: `/login qoder-cn` (PAT only)
37
+ - PAT page: https://qoder.com.cn/account/integrations
38
+ - Env (first match): `QODERCN_API_KEY`, `QODERCN_PERSONAL_ACCESS_TOKEN`, `QODERCN_PAT`
39
+
40
+ A PAT (`pt-...`) is exchanged for a job token. Setting any of those env vars logs the provider in at startup.
41
+
42
+ ## Models
43
+
44
+ Model IDs are the catalog `display_name` with whitespace stripped. After login, `/model` lists what that region offers.
45
+
46
+ Examples: `Lite`, `Qwen3.8-Max`, `Qwen3.7-Plus`, `Qwen3.8-Flash`.
47
+
48
+ Context uses the largest live catalog option (often 1M). Output is 128K.
49
+
50
+ ## Endpoints
51
+
52
+ | | Global (`qoder`) | China (`qoder-cn`) |
53
+ | --- | --- | --- |
54
+ | PAT exchange | `https://openapi.qoder.sh/api/v1/jobToken/exchange` | `https://openapi.qoder.com.cn/api/v1/jobToken/exchange` |
55
+ | User info | `https://openapi.qoder.sh/api/v1/userinfo` | `https://openapi.qoder.com.cn/api/v1/userinfo` |
56
+ | Usage | `https://openapi.qoder.sh/api/v2/quota/usage` | `https://openapi.qoder.com.cn/api/v2/quota/usage` |
57
+ | Chat gateway | `https://api3.qoder.sh/` | `https://gateway.qoder.com.cn/` |
58
+
59
+ ## Request and account Credits
60
+
61
+ The footer shows **actual session deductions in Credits**, accumulated from Qoder's
62
+ request-level `usage.credits` and `usage.billable` response fields. Tokens are shown
63
+ separately and are not used to estimate Credits. A non-billable request contributes zero
64
+ to actual deductions even when its reported nominal Credits are positive. Missing
65
+ billing metadata is counted as `unknown`, so an incomplete session total is visible.
66
+ Global and CN session totals are separate and are rebuilt from stored session entries,
67
+ including attributed compaction, summary and tool usage entries.
68
+
69
+ Account quota is an **account-wide period balance**, including other Qoder clients.
70
+ Personal, add-on and organization quota are displayed separately. Account balances may
71
+ be rounded or updated later; they do not determine per-request cost.
72
+
73
+ Assistant `usage` preserves Qoder's `credits`, `original_credits`, and `billable`, and
74
+ adds `qoder_provider`, `charged_credits`, and `usd_equivalent`. `charged_credits` is zero
75
+ for non-billable calls, or the returned discounted Credits for billable calls; it remains
76
+ absent when actual deductions cannot be determined. `usd_equivalent` is a reference
77
+ conversion at **$20 / 1,500 Credits**, not a dollar charge. Credits never enter pi's
78
+ dollar-denominated `usage.cost` fields. See the [Qoder usage field definitions](https://docs.qoder.com/cli/sdk/cost-usage).
79
+
80
+ For example, a CN response with `credits: 0.000613272` and `billable: true` contributes
81
+ `0.000613272` Credits, while a Global response with `credits: 0.005221428571428571` and
82
+ `billable: false` contributes zero. The UI keeps up to eight decimal places; serialized
83
+ usage preserves the full returned precision.
84
+
85
+ A compact session-Credits and account-quota status is shown for the selected Qoder provider.
86
+ `/qoder-usage` also shows the session deductions and account quota. For the full
87
+ credit footer, opt in for the current pi session:
88
+
89
+ ```text
90
+ /qoder-usage footer on
91
+ /qoder-usage
92
+ /qoder-usage footer off
93
+ ```
94
+
95
+ Or start pi with `--qoder-credit-footer`. The custom footer replaces the misleading
96
+ `$0.000 (sub)` with labelled session Credits and account-quota rows. Input/output,
97
+ cache totals/hit rate, context, model/thinking level, directory, branch, session name,
98
+ and other extension statuses remain visible. Existing nonzero dollar charges in mixed
99
+ sessions are retained as `session $…` and are not relabelled as Qoder credits.
100
+ Narrow terminals wrap quota and put the model on its own line.
101
+
102
+ pi exposes one custom-footer slot. Enabling this option replaces another custom footer;
103
+ leave it off when using a separate footer extension. If another extension takes the slot
104
+ later, Qoder stops trying to reclaim it. Disabling restores pi's built-in footer only
105
+ while Qoder still owns the slot. The public API does not expose the current auto-compaction
106
+ setting, so the custom footer does not add the built-in `(auto)` hint. Alternate hosts without
107
+ pi's TUI footer API keep the status/command where supported.
108
+
109
+ Quota refreshes asynchronously at session start, model selection, before a new agent run,
110
+ and after an agent run. The in-memory cache lasts 30 seconds and coalesces simultaneous
111
+ requests; agent completion and `/qoder-usage` force a refresh. A local timer marks expired snapshots `[stale]`
112
+ without polling. Missing data shows `?`/unavailable, not zero; failed refreshes retain only
113
+ the last snapshot for the same account. Personal, add-on and organization quota are separate,
114
+ with the API's own units. The command also shows the allowance and expiry when provided.
115
+ Credential lookup and quota requests are each bounded to 10 seconds.
116
+
117
+ There is no dedicated host login/logout event. After changing authentication for an
118
+ already-selected model, run `/qoder-usage`; otherwise the next supported lifecycle event
119
+ rechecks identity. No account quota is written to disk. Per-request Credits are stored
120
+ with the assistant usage in the host's session log.
121
+
122
+ ### Offline visual preview
123
+
124
+ ```bash
125
+ npm ci
126
+ npm run demo:credits
127
+ ```
128
+
129
+ The demo runs the same footer renderer inside pi-tui with **sample data only**. It makes
130
+ no account or model requests. Press `f` (fresh), `s` (stale), `u` (unavailable), `0` (zero
131
+ quota), or `q` (quit). It shows both standard and 54-column layouts. Global and CN
132
+ quota queries and request-level billing fields have been verified with live calls.
133
+
134
+ Sanitized billing samples in `src/__fixtures__/billing/usage.json` cover free Global
135
+ calls, paid Global/CN calls, and two Kimi-K3 calls totaling 1.03185159 Credits.
136
+ Session accounting regression tests use these samples without making live requests.
137
+
138
+ ## License
139
+
140
+ MIT