@99percentpeople/pi-codex-api 0.2.9 → 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 CHANGED
@@ -1,10 +1,21 @@
1
1
  # @99percentpeople/pi-codex-api
2
2
 
3
- Turn your ChatGPT subscription into Pi superpowers — image generation, web
4
- search, Fast mode, and usage monitoring — **no OpenAI API key required**.
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
  ![codex image demo](../../promo/demo/codex-image.gif)
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
- `referenced_image_paths` resolve through `@99percentpeople/pi-workspace-files`
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.
@@ -165,16 +198,26 @@ Redeem Full reset (expires 2026-08-12)? (30s)
165
198
 
166
199
  Configure under **Codex API** in `/99settings`:
167
200
 
168
- - **Other providers** let any model (DeepSeek, Google, …) use the logged-in
169
- Codex subscription
170
- - **Fast mode** priority service tier (lower latency, faster limit use)
171
- - **Search** — auto routing (Cached / Indexed / Live per call) or a fixed mode,
172
- plus context size
173
- - **Image quality** default GPT Image 2 quality
174
- - **Usage status** show or hide the Codex quota line in the status bar
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.
175
216
 
176
217
  Settings live in `~/.pi/agent/99extensions.json` under the `codex-api`
177
- 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.
178
221
 
179
222
  ## How it works
180
223
 
@@ -182,7 +225,9 @@ namespace.
182
225
  separate search provider
183
226
  - Tokens are fetched per call from Pi's model registry, never stored in
184
227
  settings or tool results
185
- - Images and search requests go to OpenAI's Codex backend and follow your
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
186
231
  ChatGPT workspace's policies
187
232
  - The extension also ships the **`gpt-image-prompts`** skill for crafting
188
233
  production-grade image prompts — invoke it with `/skill:gpt-image-prompts`