@99percentpeople/pi-codex-api 0.2.8 → 0.3.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.
- package/README.md +62 -14
- package/index.min.js +30 -25
- package/index.min.js.map +12 -10
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# @99percentpeople/pi-codex-api
|
|
2
2
|
|
|
3
|
-
Turn your ChatGPT subscription into Pi superpowers —
|
|
4
|
-
search, Fast mode, and usage
|
|
3
|
+
Turn your ChatGPT subscription into Pi superpowers — multilingual text and
|
|
4
|
+
vision delegation, image generation, web search, Fast mode, and usage
|
|
5
|
+
monitoring — **no OpenAI API key required**.
|
|
5
6
|
|
|
6
7
|
## Highlights
|
|
7
8
|
|
|
9
|
+
- **Ask Codex from any model** — `codex_ask` sends a standalone multilingual
|
|
10
|
+
text or vision request to a live Codex subscription model. Use it for an
|
|
11
|
+
explicit Codex second opinion, translation, rewrite, review, or screenshot
|
|
12
|
+
analysis while DeepSeek, Google, Claude, or another provider remains active.
|
|
13
|
+
- **Tool manager** — one `/99settings` submenu independently switches Search,
|
|
14
|
+
Image, and Ask Codex On or Off. Disabled model tools disappear from the
|
|
15
|
+
active prompt immediately.
|
|
16
|
+
- **Answer detail** — `/99settings` can leave Codex verbosity at the model
|
|
17
|
+
default or override normal Codex replies and `codex_ask` with Low, Medium,
|
|
18
|
+
or High detail.
|
|
8
19
|
- **Image generation & editing** — `codex_image` creates or edits images via
|
|
9
20
|
your Codex subscription's `gpt-image-2`, and works from **any model**:
|
|
10
21
|
even with a third-party provider active (DeepSeek, Google, …), it reuses Pi's
|
|
@@ -34,6 +45,27 @@ Image generation with `gpt-image-2` (saved PNG + description):
|
|
|
34
45
|
|
|
35
46
|

|
|
36
47
|
|
|
48
|
+
## Ask Codex
|
|
49
|
+
|
|
50
|
+
`codex_ask` is deliberately opt-in. The active model should call it only when
|
|
51
|
+
someone explicitly asks to consult Codex or requests a Codex second opinion;
|
|
52
|
+
it must not recursively delegate routine work just because Codex is available.
|
|
53
|
+
|
|
54
|
+
Each call is standalone. Pi does **not** copy the surrounding conversation or
|
|
55
|
+
workspace into the request automatically, so the tool prompt must contain the
|
|
56
|
+
necessary context, target language, and output format. Optional controls include:
|
|
57
|
+
|
|
58
|
+
- an exact `openai-codex` model ID from Pi's existing model list (otherwise the
|
|
59
|
+
active Codex model or first logged-in Codex model is selected);
|
|
60
|
+
- reasoning effort and per-call answer detail;
|
|
61
|
+
- up to five workspace images or recent conversation images for vision;
|
|
62
|
+
- an explicit output-token cap when the default 8,192 tokens is unsuitable.
|
|
63
|
+
|
|
64
|
+
Text calls reuse Pi's model-provider implementation and record their nested LLM
|
|
65
|
+
usage on the tool result. One-off delegated requests use a fresh routing session
|
|
66
|
+
and disable prompt-cache retention. With SSH Remote active, workspace image
|
|
67
|
+
inputs are read through the remote binary file adapter.
|
|
68
|
+
|
|
37
69
|
## Search output
|
|
38
70
|
|
|
39
71
|
`codex_search` keeps each result family readable:
|
|
@@ -74,6 +106,7 @@ pi install npm:@99percentpeople/pi-codex-api
|
|
|
74
106
|
|
|
75
107
|
Requirements:
|
|
76
108
|
|
|
109
|
+
- Pi 0.84.1 or newer for `codex_ask`
|
|
77
110
|
- Pi logged in with `/login` for `openai-codex`
|
|
78
111
|
- An active `openai-codex` model, or **Other providers** enabled in
|
|
79
112
|
`/99settings` to use the subscription from any model
|
|
@@ -82,7 +115,7 @@ That's it — just ask *"generate an image of a neon ramen shop"* or *"search
|
|
|
82
115
|
the web for today's Rust releases"* and the model calls the tools for you.
|
|
83
116
|
|
|
84
117
|
When `@99percentpeople/pi-ssh-remote` is active, `codex_image.output_path` and
|
|
85
|
-
`
|
|
118
|
+
`referenced_paths` resolve through `@99percentpeople/pi-workspace-files`
|
|
86
119
|
and its remote binary backend. Generated
|
|
87
120
|
Base64 data is written directly through the remote adapter and references are
|
|
88
121
|
read directly from it, without creating local staging files.
|
|
@@ -123,8 +156,11 @@ rate limit redeem
|
|
|
123
156
|
(red), other failures keep the last known usage or show `Codex usage unavailable`
|
|
124
157
|
until the next successful refresh
|
|
125
158
|
|
|
126
|
-
Usage refreshes automatically on session start and
|
|
127
|
-
`/codex-usage` always forces a fresh read.
|
|
159
|
+
Usage refreshes automatically on session start, model select, and the configured
|
|
160
|
+
usage-poll interval; `/codex-usage` always forces a fresh read. Between refreshes,
|
|
161
|
+
the status-bar reset countdown advances locally from the last server timestamp
|
|
162
|
+
once per minute without making another request. A refresh simply re-synchronizes
|
|
163
|
+
that timestamp and the usage snapshot. Every usage request is capped at a
|
|
128
164
|
15-second timeout so a stalled backend cannot leave the status bar spinning.
|
|
129
165
|
|
|
130
166
|
### `/codex-redeem`
|
|
@@ -162,16 +198,26 @@ Redeem Full reset (expires 2026-08-12)? (30s)
|
|
|
162
198
|
|
|
163
199
|
Configure under **Codex API** in `/99settings`:
|
|
164
200
|
|
|
165
|
-
- **
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- **
|
|
171
|
-
|
|
201
|
+
- **Tools** opens one tool manager where **Search**, **Image**, and **Ask Codex**
|
|
202
|
+
can each be switched **On** or **Off**. Disabled tools are removed from the active model
|
|
203
|
+
prompt immediately; stale or concurrently queued calls are rejected before
|
|
204
|
+
they reach Codex.
|
|
205
|
+
- **Fast mode** remains a direct On/Off setting for the priority service tier.
|
|
206
|
+
- **Usage monitor** remains a direct On/Off setting. Turning it off stops
|
|
207
|
+
background status refreshes, while explicit `/codex-usage` and
|
|
208
|
+
`/codex-redeem` commands remain available.
|
|
209
|
+
- **Answer detail** selects model default, Low, Medium, or High verbosity for
|
|
210
|
+
normal Codex replies and `codex_ask` unless a call overrides it.
|
|
211
|
+
- **Other providers** lets any model (DeepSeek, Google, …) use the logged-in
|
|
212
|
+
Codex subscription.
|
|
213
|
+
- **Search mode** and **Search context** configure search when its feature is on.
|
|
214
|
+
- **Image quality** sets the GPT Image 2 default when its feature is on.
|
|
215
|
+
- **Usage poll** controls the monitor refresh interval when its feature is on.
|
|
172
216
|
|
|
173
217
|
Settings live in `~/.pi/agent/99extensions.json` under the `codex-api`
|
|
174
|
-
namespace.
|
|
218
|
+
namespace. Existing configurations migrate with Search, Image, and Ask Codex
|
|
219
|
+
enabled, so upgrading does not remove tools unless you explicitly switch them
|
|
220
|
+
off.
|
|
175
221
|
|
|
176
222
|
## How it works
|
|
177
223
|
|
|
@@ -179,7 +225,9 @@ namespace.
|
|
|
179
225
|
separate search provider
|
|
180
226
|
- Tokens are fetched per call from Pi's model registry, never stored in
|
|
181
227
|
settings or tool results
|
|
182
|
-
-
|
|
228
|
+
- `codex_ask` uses Pi 0.84+'s authenticated model completion API so OAuth,
|
|
229
|
+
provider overrides, and request transport stay inside Pi's model registry
|
|
230
|
+
- Text, image, and search requests go to OpenAI's Codex backend and follow your
|
|
183
231
|
ChatGPT workspace's policies
|
|
184
232
|
- The extension also ships the **`gpt-image-prompts`** skill for crafting
|
|
185
233
|
production-grade image prompts — invoke it with `/skill:gpt-image-prompts`
|