pi-clawbay 0.0.16 → 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 -150
- 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 -846
- 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 -85
package/README.md
CHANGED
|
@@ -1,76 +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
|
-
- **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
|
|
13
12
|
|
|
14
13
|
## Installation
|
|
15
14
|
|
|
16
|
-
### Recommended: npm
|
|
15
|
+
### Recommended: Install from npm
|
|
17
16
|
|
|
18
17
|
```bash
|
|
19
18
|
pi install npm:pi-clawbay@latest
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
This uses the published npm package and avoids npm's GitHub dependency path.
|
|
23
22
|
|
|
24
|
-
|
|
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
|
|
25
32
|
|
|
26
33
|
```bash
|
|
27
34
|
pi -e /path/to/pi-clawbay
|
|
28
35
|
```
|
|
29
36
|
|
|
30
|
-
Use
|
|
37
|
+
Use this only while actively developing the extension locally.
|
|
31
38
|
|
|
32
39
|
## Configuration
|
|
33
40
|
|
|
41
|
+
### Environment Variable
|
|
42
|
+
|
|
34
43
|
Set your TheClawBay API key:
|
|
35
44
|
|
|
36
45
|
```bash
|
|
37
46
|
export THECLAWBAY_API_KEY=your-api-key-here
|
|
38
47
|
```
|
|
39
48
|
|
|
40
|
-
Get
|
|
49
|
+
Get your API key from [TheClawBay Dashboard](https://theclawbay.com).
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
### Available Models
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
Model IDs are discovered dynamically at extension load from:
|
|
45
54
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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.
|
|
58
|
+
|
|
59
|
+
Requests for `theclawbay/*` models are sent through TheClawBay's native Codex route:
|
|
60
|
+
|
|
61
|
+
- `https://api.theclawbay.com/backend-api/codex`
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
This extension uses a custom Responses transport for that route. It sends:
|
|
51
64
|
|
|
52
65
|
- `Authorization: Bearer $THECLAWBAY_API_KEY`
|
|
53
66
|
- `chatgpt-account-id: theclawbay`
|
|
54
|
-
- `
|
|
55
|
-
- `OpenAI-Beta: responses=experimental`
|
|
56
|
-
- `session_id` when Pi provides a session ID
|
|
67
|
+
- `session_id` when Pi provides a session id
|
|
57
68
|
- `prompt_cache_key` in the request body
|
|
58
69
|
|
|
59
|
-
|
|
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.
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
Based on the live docs at `https://theclawbay.com/docs`:
|
|
62
73
|
|
|
63
|
-
|
|
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
|
|
64
77
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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:
|
|
68
86
|
|
|
69
|
-
|
|
87
|
+
- `gpt-5.4` stays as-is
|
|
88
|
+
- `gpt-5.4[1m]` is remapped to upstream `gpt-5.4` before the request is sent
|
|
70
89
|
|
|
71
|
-
|
|
90
|
+
Why split it?
|
|
72
91
|
|
|
73
|
-
|
|
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
|
|
95
|
+
|
|
96
|
+
### Model Limits
|
|
97
|
+
|
|
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:
|
|
74
105
|
|
|
75
106
|
- `gpt-5.5`
|
|
76
107
|
- `gpt-5.4`
|
|
@@ -82,174 +113,99 @@ Selectable Pi chat models are filtered to GPT/Codex-compatible models. Image API
|
|
|
82
113
|
- `gpt-5.1-codex-max`
|
|
83
114
|
- `gpt-5.1-codex-mini`
|
|
84
115
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
The upstream TheClawBay model ID is `gpt-5.4`. This extension exposes two Pi entries for clearer cost/context selection:
|
|
88
|
-
|
|
89
|
-
| Pi model | Upstream model | Context configured in Pi |
|
|
90
|
-
|----------|----------------|--------------------------|
|
|
91
|
-
| `theclawbay/gpt-5.4` | `gpt-5.4` | `272,000` tokens |
|
|
92
|
-
| `theclawbay/gpt-5.4[1m]` | `gpt-5.4` | `1,050,000` tokens |
|
|
93
|
-
|
|
94
|
-
Other GPT/Codex fallback models use a `272,000` token context window and `128,000` max output tokens.
|
|
95
|
-
|
|
96
|
-
## Image generation
|
|
116
|
+
## Usage
|
|
97
117
|
|
|
98
|
-
|
|
118
|
+
### Select a Model
|
|
99
119
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
export PI_CLAWBAY_IMAGE_GENERATION=hosted
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Then select a text/Codex model, for example:
|
|
120
|
+
Use `/model` command in pi:
|
|
107
121
|
|
|
108
122
|
```text
|
|
109
123
|
/model theclawbay/gpt-5.5
|
|
124
|
+
/model theclawbay/gpt-5.4
|
|
125
|
+
/model theclawbay/gpt-5.4[1m]
|
|
110
126
|
```
|
|
111
127
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```text
|
|
115
|
-
Generate a minimalist black sailboat icon on a white background. No text.
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
When the feature flag is enabled, the provider adds the hosted Responses tool:
|
|
119
|
-
|
|
120
|
-
```json
|
|
121
|
-
{ "type": "image_generation", "output_format": "png" }
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
The stream parser handles `image_generation_call` items, decodes the returned base64 PNG, and saves it to:
|
|
125
|
-
|
|
126
|
-
```text
|
|
127
|
-
~/.pi/agent/generated_images/<session_id>/<image_generation_call_id>.png
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
The assistant response includes:
|
|
131
|
-
|
|
132
|
-
- a `file://` URL
|
|
133
|
-
- the filesystem path
|
|
134
|
-
- the revised prompt, when returned by TheClawBay
|
|
135
|
-
|
|
136
|
-
For tests or automation, override the output root:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
export PI_CLAWBAY_GENERATED_IMAGES_DIR=/absolute/output/dir
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Image model IDs
|
|
143
|
-
|
|
144
|
-
The current TheClawBay image model ID is:
|
|
145
|
-
|
|
146
|
-
```text
|
|
147
|
-
gpt-image-2
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
It is not `gpt-image-2.0`. The extension keeps `gpt-image-*` out of the Pi chat model list. Hosted image generation is invoked from a text/Codex model through the `image_generation` hosted tool.
|
|
151
|
-
|
|
152
|
-
### Skill guidance
|
|
153
|
-
|
|
154
|
-
This package includes a Pi skill:
|
|
155
|
-
|
|
156
|
-
```text
|
|
157
|
-
theclawbay-imagegen
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
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.
|
|
128
|
+
### Commands
|
|
161
129
|
|
|
162
|
-
|
|
130
|
+
This extension currently registers:
|
|
163
131
|
|
|
164
132
|
```text
|
|
165
|
-
/
|
|
133
|
+
/quota
|
|
166
134
|
```
|
|
167
135
|
|
|
168
|
-
|
|
136
|
+
`/cachehit` was removed.
|
|
169
137
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
```http
|
|
173
|
-
POST https://api.theclawbay.com/v1/images/generations
|
|
174
|
-
Authorization: Bearer $THECLAWBAY_API_KEY
|
|
175
|
-
Content-Type: application/json
|
|
176
|
-
```
|
|
138
|
+
### Programmatic Usage
|
|
177
139
|
|
|
178
|
-
|
|
140
|
+
```typescript
|
|
141
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
179
142
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
|
187
150
|
}
|
|
188
151
|
```
|
|
189
152
|
|
|
190
|
-
|
|
153
|
+
## API Reference
|
|
191
154
|
|
|
192
|
-
|
|
155
|
+
### Endpoints
|
|
193
156
|
|
|
194
|
-
|
|
157
|
+
| Provider | Base URL | API Type |
|
|
158
|
+
|----------|----------|----------|
|
|
159
|
+
| `theclawbay` | `https://api.theclawbay.com/backend-api/codex` | OpenAI Codex Responses |
|
|
195
160
|
|
|
196
|
-
|
|
197
|
-
/model theclawbay/gpt-5.5
|
|
198
|
-
/model theclawbay/gpt-5.4
|
|
199
|
-
/model theclawbay/gpt-5.4[1m]
|
|
200
|
-
```
|
|
161
|
+
### Authentication
|
|
201
162
|
|
|
202
|
-
|
|
163
|
+
All requests use Bearer token authentication:
|
|
203
164
|
|
|
204
165
|
```text
|
|
205
|
-
|
|
166
|
+
Authorization: Bearer THECLAWBAY_API_KEY
|
|
206
167
|
```
|
|
207
168
|
|
|
208
|
-
|
|
169
|
+
### Quota Checking
|
|
209
170
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
| Provider | Base URL | API type |
|
|
213
|
-
|----------|----------|----------|
|
|
214
|
-
| `theclawbay` | `https://api.theclawbay.com/backend-api/codex` | Responses over HTTP streaming |
|
|
215
|
-
|
|
216
|
-
All provider requests use Bearer token authentication:
|
|
217
|
-
|
|
218
|
-
```text
|
|
219
|
-
Authorization: Bearer $THECLAWBAY_API_KEY
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Quota endpoint:
|
|
171
|
+
Check your current usage:
|
|
223
172
|
|
|
224
173
|
```bash
|
|
225
174
|
curl "https://theclawbay.com/api/codex-auth/v1/quota" \
|
|
226
175
|
-H "Authorization: Bearer $THECLAWBAY_API_KEY"
|
|
227
176
|
```
|
|
228
177
|
|
|
229
|
-
##
|
|
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
|
|
230
190
|
|
|
231
191
|
```bash
|
|
232
192
|
npm install
|
|
233
|
-
npm run
|
|
234
|
-
npm test
|
|
193
|
+
npm run build
|
|
235
194
|
npm pack --dry-run
|
|
236
195
|
```
|
|
237
196
|
|
|
238
197
|
## Publishing
|
|
239
198
|
|
|
240
|
-
Publishing is handled by the GitHub Actions workflow in `.github/workflows/publish.yml`.
|
|
241
|
-
|
|
242
|
-
Manual local publishing is not recommended. Use the workflow so npm provenance is attached:
|
|
243
|
-
|
|
244
199
|
```bash
|
|
245
|
-
|
|
200
|
+
npm version patch
|
|
201
|
+
npm publish
|
|
246
202
|
```
|
|
247
203
|
|
|
248
204
|
## Resources
|
|
249
205
|
|
|
250
206
|
- [TheClawBay Docs](https://theclawbay.com/docs)
|
|
251
207
|
- [TheClawBay Dashboard](https://theclawbay.com)
|
|
252
|
-
- [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)
|
|
253
209
|
|
|
254
210
|
## License
|
|
255
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",
|
|
41
|
+
...PINNED_MODEL_IDS,
|
|
42
|
+
];
|
|
43
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"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"}
|
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"}
|