pi-clawbay 0.0.17 → 0.0.18
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 +106 -178
- package/dist/constants.d.ts +31 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +43 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -979
- package/dist/index.js.map +1 -1
- package/dist/model-cache.d.ts +11 -0
- package/dist/model-cache.d.ts.map +1 -0
- package/dist/model-cache.js +104 -0
- package/dist/model-cache.js.map +1 -0
- package/dist/models.d.ts +9 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +92 -0
- package/dist/models.js.map +1 -0
- package/dist/provider.d.ts +3 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +12 -0
- package/dist/provider.js.map +1 -0
- package/dist/quota.d.ts +6 -0
- package/dist/quota.d.ts.map +1 -0
- package/dist/quota.js +76 -0
- package/dist/quota.js.map +1 -0
- package/dist/transport.d.ts +5 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +61 -0
- package/dist/transport.js.map +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +8 -12
- package/skills/theclawbay-imagegen/SKILL.md +0 -120
package/README.md
CHANGED
|
@@ -1,77 +1,107 @@
|
|
|
1
1
|
# TheClawBay Provider for Pi Coding Agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A provider extension for [Pi Coding Agent](https://github.com/earendil-works/pi) that enables access to GPT-5 and Codex models through [TheClawBay](https://theclawbay.com) API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **Direct Images API transport:** manual `gpt-image-2` and `gpt-image-1.5` selections call TheClawBay's documented `/v1/images/generations` endpoint and save returned PNGs locally.
|
|
13
|
-
- **Quota command:** adds `/quota` for current TheClawBay usage information.
|
|
7
|
+
- **GPT-5 & Codex Models** - Access via Codex Responses API with session-based prompt cache
|
|
8
|
+
- **Single Provider** - Only `theclawbay` is registered
|
|
9
|
+
- **GPT-5.4 Split Options** - `gpt-5.4` and `gpt-5.4[1m]` for clearer cost/context choice
|
|
10
|
+
- **High Usage Headroom** - More capacity than standard subscriptions
|
|
11
|
+
- **Simple Setup** - Single API key
|
|
14
12
|
|
|
15
13
|
## Installation
|
|
16
14
|
|
|
17
|
-
### Recommended: npm
|
|
15
|
+
### Recommended: Install from npm
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
18
|
pi install npm:pi-clawbay@latest
|
|
21
19
|
```
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
This uses the published npm package and avoids npm's GitHub dependency path.
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
Do not use:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pi install npm:chrislopez24/pi-clawbay
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
That form is treated as a GitHub install, not a registry package install, and it can leave broken global symlinks behind.
|
|
30
|
+
|
|
31
|
+
### Local Development
|
|
26
32
|
|
|
27
33
|
```bash
|
|
28
34
|
pi -e /path/to/pi-clawbay
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
Use
|
|
37
|
+
Use this only while actively developing the extension locally.
|
|
32
38
|
|
|
33
39
|
## Configuration
|
|
34
40
|
|
|
41
|
+
### Environment Variable
|
|
42
|
+
|
|
35
43
|
Set your TheClawBay API key:
|
|
36
44
|
|
|
37
45
|
```bash
|
|
38
46
|
export THECLAWBAY_API_KEY=your-api-key-here
|
|
39
47
|
```
|
|
40
48
|
|
|
41
|
-
Get
|
|
49
|
+
Get your API key from [TheClawBay Dashboard](https://theclawbay.com).
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
### Available Models
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
Model IDs are discovered dynamically at extension load from:
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
- `GET https://api.theclawbay.com/v1/models`
|
|
56
|
+
|
|
57
|
+
If discovery fails or `THECLAWBAY_API_KEY` is not set yet, the extension falls back to the last successful discovery cache, then to a bundled default list so `/model` still works on startup. Live discovery refreshes the cache in the background after the provider has been registered.
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
Requests for `theclawbay/*` models are sent through TheClawBay's native Codex route:
|
|
60
|
+
|
|
61
|
+
- `https://api.theclawbay.com/backend-api/codex`
|
|
62
|
+
|
|
63
|
+
This extension uses a custom Responses transport for that route. It sends:
|
|
52
64
|
|
|
53
65
|
- `Authorization: Bearer $THECLAWBAY_API_KEY`
|
|
54
66
|
- `chatgpt-account-id: theclawbay`
|
|
55
|
-
- `
|
|
56
|
-
- `OpenAI-Beta: responses=experimental`
|
|
57
|
-
- `session_id` when Pi provides a session ID
|
|
67
|
+
- `session_id` when Pi provides a session id
|
|
58
68
|
- `prompt_cache_key` in the request body
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
This avoids Pi's built-in `openai-codex-responses` JWT parsing path, which expects a ChatGPT/Codex-style token and can fail with `Failed to extract accountId from token` when given a normal TheClawBay API key.
|
|
61
71
|
|
|
62
|
-
|
|
72
|
+
Based on the live docs at `https://theclawbay.com/docs`:
|
|
63
73
|
|
|
64
|
-
|
|
74
|
+
- OpenAI-compatible apps use `https://api.theclawbay.com/v1`
|
|
75
|
+
- Native Codex config uses `https://api.theclawbay.com/backend-api/codex`
|
|
76
|
+
- The docs recommend calling `/models` first and selecting an available model dynamically
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
### GPT-5.4 Variants In This Extension
|
|
79
|
+
|
|
80
|
+
The live TheClawBay docs expose `gpt-5.4` as the upstream model. This extension presents it in Pi as two selectable entries:
|
|
81
|
+
|
|
82
|
+
- `theclawbay/gpt-5.4` → standard variant, capped to `272k` context in Pi
|
|
83
|
+
- `theclawbay/gpt-5.4[1m]` → long-context variant, configured to `1,050,000`
|
|
84
|
+
|
|
85
|
+
Internally:
|
|
86
|
+
|
|
87
|
+
- `gpt-5.4` stays as-is
|
|
88
|
+
- `gpt-5.4[1m]` is remapped to upstream `gpt-5.4` before the request is sent
|
|
89
|
+
|
|
90
|
+
Why split it?
|
|
69
91
|
|
|
70
|
-
|
|
92
|
+
- `gpt-5.4` is the cheaper/default option
|
|
93
|
+
- `gpt-5.4[1m]` gives explicit access to long context
|
|
94
|
+
- both end up using the same official upstream model id from TheClawBay
|
|
71
95
|
|
|
72
|
-
|
|
96
|
+
### Model Limits
|
|
73
97
|
|
|
74
|
-
|
|
98
|
+
- `gpt-5.4` is configured with a `272,000` token context window.
|
|
99
|
+
- `gpt-5.4[1m]` is configured with a `1,050,000` token context window.
|
|
100
|
+
- Current non-5.4 GPT-5/Codex variants default to `400,000` context and `128,000` max output tokens.
|
|
101
|
+
|
|
102
|
+
### Example Model List
|
|
103
|
+
|
|
104
|
+
Current fallback list in this package:
|
|
75
105
|
|
|
76
106
|
- `gpt-5.5`
|
|
77
107
|
- `gpt-5.4`
|
|
@@ -82,202 +112,100 @@ Selectable Pi models include GPT/Codex text models plus two explicit image-only
|
|
|
82
112
|
- `gpt-5.2`
|
|
83
113
|
- `gpt-5.1-codex-max`
|
|
84
114
|
- `gpt-5.1-codex-mini`
|
|
85
|
-
- `gpt-image-2`
|
|
86
|
-
- `gpt-image-1.5`
|
|
87
|
-
|
|
88
|
-
### GPT-5.4 variants
|
|
89
|
-
|
|
90
|
-
The upstream TheClawBay model ID is `gpt-5.4`. This extension exposes two Pi entries for clearer cost/context selection:
|
|
91
|
-
|
|
92
|
-
| Pi model | Upstream model | Context configured in Pi |
|
|
93
|
-
|----------|----------------|--------------------------|
|
|
94
|
-
| `theclawbay/gpt-5.4` | `gpt-5.4` | `272,000` tokens |
|
|
95
|
-
| `theclawbay/gpt-5.4[1m]` | `gpt-5.4` | `1,050,000` tokens |
|
|
96
|
-
|
|
97
|
-
Other GPT/Codex fallback models use a `272,000` token context window and `128,000` max output tokens.
|
|
98
115
|
|
|
99
|
-
##
|
|
100
|
-
|
|
101
|
-
`pi-clawbay` supports two image-generation flows. Prefer the Codex-style hosted tool from a text/Codex model; select a `gpt-image-*` model only when you explicitly want the direct Images API transport documented at <https://theclawbay.com/docs#image-generation>.
|
|
116
|
+
## Usage
|
|
102
117
|
|
|
103
|
-
|
|
118
|
+
### Select a Model
|
|
104
119
|
|
|
105
|
-
|
|
120
|
+
Use `/model` command in pi:
|
|
106
121
|
|
|
107
122
|
```text
|
|
108
123
|
/model theclawbay/gpt-5.5
|
|
124
|
+
/model theclawbay/gpt-5.4
|
|
125
|
+
/model theclawbay/gpt-5.4[1m]
|
|
109
126
|
```
|
|
110
127
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
Generate a minimalist black sailboat icon on a white background. No text.
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
The hosted Responses tool definition is:
|
|
118
|
-
|
|
119
|
-
```json
|
|
120
|
-
{ "type": "image_generation", "output_format": "png" }
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
The stream parser handles `image_generation_call` items, decodes the returned base64 PNG, and saves it to:
|
|
124
|
-
|
|
125
|
-
```text
|
|
126
|
-
~/.pi/agent/generated_images/<session_id>/<image_generation_call_id>.png
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
The assistant response includes:
|
|
130
|
-
|
|
131
|
-
- a `file://` URL
|
|
132
|
-
- the filesystem path
|
|
133
|
-
- the revised prompt, when returned by TheClawBay
|
|
134
|
-
|
|
135
|
-
### Environment controls
|
|
136
|
-
|
|
137
|
-
To disable hosted image generation entirely, use:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
export PI_CLAWBAY_IMAGE_GENERATION=off
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Override the output root when needed:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
export PI_CLAWBAY_GENERATED_IMAGES_DIR=/absolute/output/dir
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Manual Direct Images API flow
|
|
128
|
+
### Commands
|
|
150
129
|
|
|
151
|
-
|
|
130
|
+
This extension currently registers:
|
|
152
131
|
|
|
153
132
|
```text
|
|
154
|
-
/
|
|
155
|
-
/model theclawbay/gpt-image-1.5
|
|
133
|
+
/quota
|
|
156
134
|
```
|
|
157
135
|
|
|
158
|
-
|
|
136
|
+
`/cachehit` was removed.
|
|
159
137
|
|
|
160
|
-
|
|
161
|
-
POST https://api.theclawbay.com/v1/images/generations
|
|
162
|
-
```
|
|
138
|
+
### Programmatic Usage
|
|
163
139
|
|
|
164
|
-
|
|
140
|
+
```typescript
|
|
141
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
165
142
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
143
|
+
export default function (pi: ExtensionAPI) {
|
|
144
|
+
// After loading this extension, models are available:
|
|
145
|
+
// - theclawbay/gpt-5.5
|
|
146
|
+
// - theclawbay/gpt-5.4
|
|
147
|
+
// - theclawbay/gpt-5.4[1m]
|
|
148
|
+
// - theclawbay/gpt-5.4-mini
|
|
149
|
+
// - theclawbay/gpt-5.3-codex
|
|
173
150
|
}
|
|
174
151
|
```
|
|
175
152
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
The valid TheClawBay image model IDs exposed here are `gpt-image-2` and `gpt-image-1.5`. `gpt-image-2.0` is not a valid model ID.
|
|
179
|
-
|
|
180
|
-
### Skill guidance
|
|
181
|
-
|
|
182
|
-
This package includes a Pi skill:
|
|
183
|
-
|
|
184
|
-
```text
|
|
185
|
-
theclawbay-imagegen
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
The skill documents the recommended image-generation workflow and fallback behavior. It is helpful guidance for the agent, but it is not a separate runtime requirement. The provider stream implements the actual hosted image generation support.
|
|
189
|
-
|
|
190
|
-
If needed, load it explicitly inside Pi:
|
|
191
|
-
|
|
192
|
-
```text
|
|
193
|
-
/skill:theclawbay-imagegen
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Direct Images API outside Pi
|
|
153
|
+
## API Reference
|
|
197
154
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
```http
|
|
201
|
-
POST https://api.theclawbay.com/v1/images/generations
|
|
202
|
-
Authorization: Bearer $THECLAWBAY_API_KEY
|
|
203
|
-
Content-Type: application/json
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Example payload:
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"model": "gpt-image-2",
|
|
211
|
-
"prompt": "A minimalist black sailboat icon on a white background. No text.",
|
|
212
|
-
"size": "1024x1024",
|
|
213
|
-
"quality": "low",
|
|
214
|
-
"output_format": "png"
|
|
215
|
-
}
|
|
216
|
-
```
|
|
155
|
+
### Endpoints
|
|
217
156
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
### Select a model
|
|
157
|
+
| Provider | Base URL | API Type |
|
|
158
|
+
|----------|----------|----------|
|
|
159
|
+
| `theclawbay` | `https://api.theclawbay.com/backend-api/codex` | OpenAI Codex Responses |
|
|
223
160
|
|
|
224
|
-
|
|
225
|
-
/model theclawbay/gpt-5.5
|
|
226
|
-
/model theclawbay/gpt-5.4
|
|
227
|
-
/model theclawbay/gpt-5.4[1m]
|
|
228
|
-
```
|
|
161
|
+
### Authentication
|
|
229
162
|
|
|
230
|
-
|
|
163
|
+
All requests use Bearer token authentication:
|
|
231
164
|
|
|
232
165
|
```text
|
|
233
|
-
|
|
166
|
+
Authorization: Bearer THECLAWBAY_API_KEY
|
|
234
167
|
```
|
|
235
168
|
|
|
236
|
-
|
|
169
|
+
### Quota Checking
|
|
237
170
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
| Provider | Base URL | API type |
|
|
241
|
-
|----------|----------|----------|
|
|
242
|
-
| `theclawbay` | `https://api.theclawbay.com/backend-api/codex` | Responses over HTTP streaming |
|
|
243
|
-
|
|
244
|
-
All provider requests use Bearer token authentication:
|
|
245
|
-
|
|
246
|
-
```text
|
|
247
|
-
Authorization: Bearer $THECLAWBAY_API_KEY
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
Quota endpoint:
|
|
171
|
+
Check your current usage:
|
|
251
172
|
|
|
252
173
|
```bash
|
|
253
174
|
curl "https://theclawbay.com/api/codex-auth/v1/quota" \
|
|
254
175
|
-H "Authorization: Bearer $THECLAWBAY_API_KEY"
|
|
255
176
|
```
|
|
256
177
|
|
|
257
|
-
##
|
|
178
|
+
## Error Handling
|
|
179
|
+
|
|
180
|
+
Common error codes:
|
|
181
|
+
|
|
182
|
+
| Code | Description |
|
|
183
|
+
|------|-------------|
|
|
184
|
+
| `weekly_cost_limit_reached` | Weekly spend cap hit |
|
|
185
|
+
| `5h_cost_limit_reached` | 5-hour spend cap hit |
|
|
186
|
+
| `invalid_api_key` | Key missing or malformed |
|
|
187
|
+
| `model_not_found` | Requested model unavailable |
|
|
188
|
+
|
|
189
|
+
## Building
|
|
258
190
|
|
|
259
191
|
```bash
|
|
260
192
|
npm install
|
|
261
|
-
npm run
|
|
262
|
-
npm test
|
|
193
|
+
npm run build
|
|
263
194
|
npm pack --dry-run
|
|
264
195
|
```
|
|
265
196
|
|
|
266
197
|
## Publishing
|
|
267
198
|
|
|
268
|
-
Publishing is handled by the GitHub Actions workflow in `.github/workflows/publish.yml`.
|
|
269
|
-
|
|
270
|
-
Manual local publishing is not recommended. Use the workflow so npm provenance is attached:
|
|
271
|
-
|
|
272
199
|
```bash
|
|
273
|
-
|
|
200
|
+
npm version patch
|
|
201
|
+
npm publish
|
|
274
202
|
```
|
|
275
203
|
|
|
276
204
|
## Resources
|
|
277
205
|
|
|
278
206
|
- [TheClawBay Docs](https://theclawbay.com/docs)
|
|
279
207
|
- [TheClawBay Dashboard](https://theclawbay.com)
|
|
280
|
-
- [Pi Custom Provider Docs](https://github.com/
|
|
208
|
+
- [Pi Custom Provider Docs](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/custom-provider.md)
|
|
281
209
|
|
|
282
210
|
## License
|
|
283
211
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
export declare const THECLAWBAY_OPENAI_DISCOVERY_BASE_URL = "https://api.theclawbay.com/v1";
|
|
3
|
+
export declare const THECLAWBAY_CODEX_BASE_URL = "https://api.theclawbay.com/backend-api/codex";
|
|
4
|
+
export declare const THECLAWBAY_QUOTA_URL = "https://theclawbay.com/api/codex-auth/v1/quota";
|
|
5
|
+
export declare const THECLAWBAY_OPENAI_MODELS_URL = "https://api.theclawbay.com/v1/models";
|
|
6
|
+
export declare const THECLAWBAY_CODEX_API = "theclawbay-codex-responses";
|
|
7
|
+
export declare const THECLAWBAY_CHATGPT_ACCOUNT_ID = "theclawbay";
|
|
8
|
+
export declare const MODEL_CACHE_VERSION = 1;
|
|
9
|
+
export declare const MODEL_CACHE_TTL_MS: number;
|
|
10
|
+
export declare const GPT_54_UPSTREAM_MODEL_ID = "gpt-5.4";
|
|
11
|
+
export declare const GPT_54_DEFAULT_MODEL_ID = "gpt-5.4";
|
|
12
|
+
export declare const GPT_54_1M_MODEL_ID = "gpt-5.4[1m]";
|
|
13
|
+
export declare const MODEL_INPUTS: readonly ["text", "image"];
|
|
14
|
+
export declare const OPENAI_CODEX_THINKING_LEVEL_MAP: {
|
|
15
|
+
readonly xhigh: "xhigh";
|
|
16
|
+
readonly minimal: "low";
|
|
17
|
+
};
|
|
18
|
+
export declare const ZERO_COST: {
|
|
19
|
+
readonly input: 0;
|
|
20
|
+
readonly output: 0;
|
|
21
|
+
readonly cacheRead: 0;
|
|
22
|
+
readonly cacheWrite: 0;
|
|
23
|
+
};
|
|
24
|
+
export declare const OPENAI_KNOWN_COSTS: Record<string, ProviderModelConfig["cost"]>;
|
|
25
|
+
export declare const OPENAI_CODEX_CONTEXT_WINDOW = 272000;
|
|
26
|
+
export declare const OPENAI_DEFAULT_CONTEXT_WINDOW = 272000;
|
|
27
|
+
export declare const OPENAI_FRONTIER_CONTEXT_WINDOW = 1050000;
|
|
28
|
+
export declare const OPENAI_DEFAULT_MAX_TOKENS = 128000;
|
|
29
|
+
export declare const PINNED_MODEL_IDS: string[];
|
|
30
|
+
export declare const FALLBACK_OPENAI_MODEL_IDS: string[];
|
|
31
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,eAAO,MAAM,oCAAoC,kCAAkC,CAAC;AACpF,eAAO,MAAM,yBAAyB,iDAAiD,CAAC;AACxF,eAAO,MAAM,oBAAoB,mDAAmD,CAAC;AACrF,eAAO,MAAM,4BAA4B,yCAAmD,CAAC;AAC7F,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AACjE,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,kBAAkB,QAAqB,CAAC;AAErD,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,eAAO,MAAM,YAAY,4BAA6B,CAAC;AACvD,eAAO,MAAM,+BAA+B;;;CAA8C,CAAC;AAC3F,eAAO,MAAM,SAAS;;;;;CAAgE,CAAC;AACvF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAU1E,CAAC;AACF,eAAO,MAAM,2BAA2B,SAAS,CAAC;AAClD,eAAO,MAAM,6BAA6B,SAA8B,CAAC;AACzE,eAAO,MAAM,8BAA8B,UAAU,CAAC;AACtD,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAEhD,eAAO,MAAM,gBAAgB,UAAqC,CAAC;AACnE,eAAO,MAAM,yBAAyB,UAWrC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const THECLAWBAY_OPENAI_DISCOVERY_BASE_URL = "https://api.theclawbay.com/v1";
|
|
2
|
+
export const THECLAWBAY_CODEX_BASE_URL = "https://api.theclawbay.com/backend-api/codex";
|
|
3
|
+
export const THECLAWBAY_QUOTA_URL = "https://theclawbay.com/api/codex-auth/v1/quota";
|
|
4
|
+
export const THECLAWBAY_OPENAI_MODELS_URL = `${THECLAWBAY_OPENAI_DISCOVERY_BASE_URL}/models`;
|
|
5
|
+
export const THECLAWBAY_CODEX_API = "theclawbay-codex-responses";
|
|
6
|
+
export const THECLAWBAY_CHATGPT_ACCOUNT_ID = "theclawbay";
|
|
7
|
+
export const MODEL_CACHE_VERSION = 1;
|
|
8
|
+
export const MODEL_CACHE_TTL_MS = 6 * 60 * 60 * 1000;
|
|
9
|
+
export const GPT_54_UPSTREAM_MODEL_ID = "gpt-5.4";
|
|
10
|
+
export const GPT_54_DEFAULT_MODEL_ID = "gpt-5.4";
|
|
11
|
+
export const GPT_54_1M_MODEL_ID = "gpt-5.4[1m]";
|
|
12
|
+
export const MODEL_INPUTS = ["text", "image"];
|
|
13
|
+
export const OPENAI_CODEX_THINKING_LEVEL_MAP = { xhigh: "xhigh", minimal: "low" };
|
|
14
|
+
export const ZERO_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
|
15
|
+
export const OPENAI_KNOWN_COSTS = {
|
|
16
|
+
"gpt-5.5": { input: 5.0, output: 30.0, cacheRead: 0.5, cacheWrite: 5.0 },
|
|
17
|
+
[GPT_54_DEFAULT_MODEL_ID]: { input: 2.5, output: 15.0, cacheRead: 0.25, cacheWrite: 2.5 },
|
|
18
|
+
[GPT_54_1M_MODEL_ID]: { input: 5.0, output: 22.5, cacheRead: 0.5, cacheWrite: 5.0 },
|
|
19
|
+
"gpt-5.4-mini": { input: 1.25, output: 10.0, cacheRead: 0.125, cacheWrite: 1.25 },
|
|
20
|
+
"gpt-5.3-codex": { input: 1.75, output: 14.0, cacheRead: 0.175, cacheWrite: 1.75 },
|
|
21
|
+
"gpt-5.2-codex": { input: 1.75, output: 14.0, cacheRead: 0.175, cacheWrite: 1.75 },
|
|
22
|
+
"gpt-5.2": { input: 1.75, output: 14.0, cacheRead: 0.175, cacheWrite: 1.75 },
|
|
23
|
+
"gpt-5.1-codex-max": { input: 1.25, output: 10.0, cacheRead: 0.125, cacheWrite: 1.25 },
|
|
24
|
+
"gpt-5.1-codex-mini": { input: 0.25, output: 2.0, cacheRead: 0.025, cacheWrite: 0.25 },
|
|
25
|
+
};
|
|
26
|
+
export const OPENAI_CODEX_CONTEXT_WINDOW = 272000;
|
|
27
|
+
export const OPENAI_DEFAULT_CONTEXT_WINDOW = OPENAI_CODEX_CONTEXT_WINDOW;
|
|
28
|
+
export const OPENAI_FRONTIER_CONTEXT_WINDOW = 1050000;
|
|
29
|
+
export const OPENAI_DEFAULT_MAX_TOKENS = 128000;
|
|
30
|
+
export const PINNED_MODEL_IDS = ["gpt-image-1.5", "gpt-image-2.0"];
|
|
31
|
+
export const FALLBACK_OPENAI_MODEL_IDS = [
|
|
32
|
+
"gpt-5.5",
|
|
33
|
+
GPT_54_DEFAULT_MODEL_ID,
|
|
34
|
+
GPT_54_1M_MODEL_ID,
|
|
35
|
+
"gpt-5.4-mini",
|
|
36
|
+
"gpt-5.3-codex",
|
|
37
|
+
"gpt-5.2-codex",
|
|
38
|
+
"gpt-5.2",
|
|
39
|
+
"gpt-5.1-codex-max",
|
|
40
|
+
"gpt-5.1-codex-mini",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yB,GAAG,MAAM,CAAC;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,SAAS;IACT,uBAAuB;IACvB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,eAAe;IACf,SAAS;IACT,mBAAmB;IACnB,oBAAoB;IACpB,GAAG,gBAAgB;CACnB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Get your API key at: https://theclawbay.com
|
|
18
18
|
*/
|
|
19
|
-
import type { ExtensionAPI } from "@
|
|
19
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
20
20
|
export default function (pi: ExtensionAPI): void;
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAcpE,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,GAAG,IAAI,CAe/C"}
|