pi-openai-toolkit 0.24.1 → 0.24.2

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.
Files changed (41) hide show
  1. package/LICENSE +21 -21
  2. package/NOTICE +83 -83
  3. package/README.md +1 -1
  4. package/README.zh.md +1 -1
  5. package/config.schema.json +264 -264
  6. package/docs/configuration.md +304 -304
  7. package/docs/internals.md +3 -1
  8. package/package.json +123 -123
  9. package/src/codex-fast/extension.ts +1 -1
  10. package/src/compact-client.ts +412 -412
  11. package/src/compaction-projection.ts +35 -35
  12. package/src/config/legacy.ts +469 -469
  13. package/src/config/migration.ts +115 -115
  14. package/src/config/notifications.ts +46 -46
  15. package/src/config/policy.ts +115 -115
  16. package/src/config/v2.ts +1128 -1128
  17. package/src/config.ts +320 -320
  18. package/src/debug.ts +238 -238
  19. package/src/deferred-tool-carryover.ts +282 -282
  20. package/src/details-store.ts +151 -151
  21. package/src/extension-runtime.ts +1095 -1095
  22. package/src/image-generation/extension.ts +189 -189
  23. package/src/image-generation/protocol.ts +579 -579
  24. package/src/image-generation/types.ts +300 -300
  25. package/src/native-fallback.ts +140 -140
  26. package/src/payload-rewrite.ts +515 -515
  27. package/src/pi-context-hook.ts +117 -117
  28. package/src/remote-v2-client.ts +811 -811
  29. package/src/request-context-cache.ts +155 -155
  30. package/src/responses-headers.ts +180 -180
  31. package/src/retired-remote-windows.ts +35 -35
  32. package/src/runtime.ts +875 -875
  33. package/src/serializer.ts +883 -882
  34. package/src/supported-environment.ts +27 -27
  35. package/src/types.ts +541 -541
  36. package/src/web-search/alpha-client.ts +876 -876
  37. package/src/web-search/extension.ts +530 -530
  38. package/src/web-search/payload.ts +299 -299
  39. package/src/web-search/prompt.ts +60 -60
  40. package/src/web-search/types.ts +166 -166
  41. package/tsconfig.check.json +50 -50
@@ -1,264 +1,264 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/awoaCrim/pi-openai-toolkit/blob/main/config.schema.json",
4
- "title": "Pi OpenAI Toolkit global configuration v2",
5
- "description": "Strict schema for the canonical global Toolkit configuration. Runtime validation additionally enforces normalized exact keys and image default membership.",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": [
9
- "schemaVersion"
10
- ],
11
- "properties": {
12
- "$schema": {
13
- "type": "string",
14
- "description": "Optional schema metadata URI. It does not select a runtime schema."
15
- },
16
- "schemaVersion": {
17
- "const": 2
18
- },
19
- "defaults": {
20
- "$ref": "#/$defs/defaults"
21
- },
22
- "models": {
23
- "type": "object",
24
- "propertyNames": {
25
- "pattern": "^[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+/[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+$"
26
- },
27
- "additionalProperties": {
28
- "$ref": "#/$defs/modelOverride"
29
- }
30
- },
31
- "diagnostics": {
32
- "$ref": "#/$defs/diagnostics"
33
- }
34
- },
35
- "$defs": {
36
- "modelRef": {
37
- "description": "Exact provider/model reference; model ids may contain additional slashes.",
38
- "anyOf": [
39
- {
40
- "type": "null"
41
- },
42
- {
43
- "type": "string",
44
- "minLength": 1,
45
- "pattern": "^[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+/[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+$"
46
- }
47
- ]
48
- },
49
- "responsesApis": {
50
- "type": "array",
51
- "items": {
52
- "enum": [
53
- "openai-responses",
54
- "openai-codex-responses",
55
- "azure-openai-responses"
56
- ]
57
- }
58
- },
59
- "context": {
60
- "type": "object",
61
- "additionalProperties": false,
62
- "properties": {
63
- "mode": {
64
- "enum": [
65
- "pi",
66
- "remote-compaction"
67
- ]
68
- },
69
- "remoteCompaction": {
70
- "$ref": "#/$defs/remoteCompaction"
71
- },
72
- "nativeFallback": {
73
- "$ref": "#/$defs/nativeFallback"
74
- },
75
- "remoteWindows": {
76
- "$ref": "#/$defs/retiredRemoteWindows"
77
- }
78
- }
79
- },
80
- "remoteCompaction": {
81
- "type": "object",
82
- "additionalProperties": false,
83
- "properties": {
84
- "model": {
85
- "$ref": "#/$defs/modelRef"
86
- },
87
- "inputSource": {
88
- "enum": [
89
- "legacy",
90
- "pi-context-hook"
91
- ]
92
- },
93
- "allowContinuityBreak": {
94
- "type": "boolean"
95
- },
96
- "apis": {
97
- "$ref": "#/$defs/responsesApis"
98
- }
99
- }
100
- },
101
- "nativeFallback": {
102
- "type": "object",
103
- "additionalProperties": false,
104
- "properties": {
105
- "enabled": {
106
- "type": "boolean"
107
- },
108
- "model": {
109
- "$ref": "#/$defs/modelRef"
110
- },
111
- "thinkingLevel": {
112
- "enum": [
113
- "off",
114
- "minimal",
115
- "low",
116
- "medium",
117
- "high",
118
- "xhigh",
119
- "max"
120
- ]
121
- }
122
- }
123
- },
124
- "retiredRemoteWindows": {
125
- "deprecated": true,
126
- "description": "Remote Windows has been removed. This opaque ancillary value is ignored with a warning; remove it from your configuration. Selecting the removed mode blocks context operations until pi or remote-compaction is explicitly selected."
127
- },
128
- "webSearch": {
129
- "type": "object",
130
- "additionalProperties": false,
131
- "properties": {
132
- "route": {
133
- "enum": [
134
- "unmanaged",
135
- "local",
136
- "hosted",
137
- "standalone-alpha"
138
- ]
139
- }
140
- }
141
- },
142
- "imageGeneration": {
143
- "type": "object",
144
- "additionalProperties": false,
145
- "properties": {
146
- "enabled": {
147
- "type": "boolean"
148
- },
149
- "defaultModel": {
150
- "type": "string",
151
- "minLength": 1,
152
- "maxLength": 256,
153
- "pattern": "\\S"
154
- },
155
- "allowedModels": {
156
- "type": "array",
157
- "minItems": 1,
158
- "items": {
159
- "type": "string",
160
- "minLength": 1,
161
- "maxLength": 256,
162
- "pattern": "\\S"
163
- }
164
- }
165
- }
166
- },
167
- "responsesWebSocket": {
168
- "type": "object",
169
- "additionalProperties": false,
170
- "properties": {
171
- "enabled": {
172
- "type": "boolean",
173
- "default": false
174
- }
175
- }
176
- },
177
- "retiredAutoMode": {
178
- "deprecated": true,
179
- "description": "Auto Mode has been removed. This value is ignored with a warning; tool calls are no longer reviewed by it. Remove this section from your configuration."
180
- },
181
- "compatibility": {
182
- "type": "object",
183
- "additionalProperties": false,
184
- "properties": {
185
- "transport": {
186
- "enum": [
187
- "standard",
188
- "codex-gateway"
189
- ]
190
- }
191
- }
192
- },
193
- "defaults": {
194
- "type": "object",
195
- "additionalProperties": false,
196
- "properties": {
197
- "context": {
198
- "$ref": "#/$defs/context"
199
- },
200
- "webSearch": {
201
- "$ref": "#/$defs/webSearch"
202
- },
203
- "imageGeneration": {
204
- "$ref": "#/$defs/imageGeneration"
205
- },
206
- "responsesWebSocket": {
207
- "$ref": "#/$defs/responsesWebSocket"
208
- },
209
- "autoMode": {
210
- "$ref": "#/$defs/retiredAutoMode"
211
- }
212
- }
213
- },
214
- "modelOverride": {
215
- "type": "object",
216
- "additionalProperties": false,
217
- "properties": {
218
- "context": {
219
- "$ref": "#/$defs/context"
220
- },
221
- "webSearch": {
222
- "$ref": "#/$defs/webSearch"
223
- },
224
- "autoMode": {
225
- "$ref": "#/$defs/retiredAutoMode"
226
- },
227
- "compatibility": {
228
- "$ref": "#/$defs/compatibility"
229
- }
230
- }
231
- },
232
- "diagnostics": {
233
- "type": "object",
234
- "additionalProperties": false,
235
- "properties": {
236
- "level": {
237
- "enum": [
238
- "error",
239
- "warn",
240
- "info",
241
- "debug"
242
- ]
243
- },
244
- "notifyOnLoad": {
245
- "type": "boolean"
246
- },
247
- "captureRequests": {
248
- "type": "boolean"
249
- },
250
- "captureResponses": {
251
- "type": "boolean"
252
- },
253
- "redactSensitiveData": {
254
- "type": "boolean"
255
- },
256
- "artifactRoot": {
257
- "type": "string",
258
- "minLength": 1,
259
- "pattern": "\\S"
260
- }
261
- }
262
- }
263
- }
264
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/awoaCrim/pi-openai-toolkit/blob/main/config.schema.json",
4
+ "title": "Pi OpenAI Toolkit global configuration v2",
5
+ "description": "Strict schema for the canonical global Toolkit configuration. Runtime validation additionally enforces normalized exact keys and image default membership.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion"
10
+ ],
11
+ "properties": {
12
+ "$schema": {
13
+ "type": "string",
14
+ "description": "Optional schema metadata URI. It does not select a runtime schema."
15
+ },
16
+ "schemaVersion": {
17
+ "const": 2
18
+ },
19
+ "defaults": {
20
+ "$ref": "#/$defs/defaults"
21
+ },
22
+ "models": {
23
+ "type": "object",
24
+ "propertyNames": {
25
+ "pattern": "^[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+/[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+$"
26
+ },
27
+ "additionalProperties": {
28
+ "$ref": "#/$defs/modelOverride"
29
+ }
30
+ },
31
+ "diagnostics": {
32
+ "$ref": "#/$defs/diagnostics"
33
+ }
34
+ },
35
+ "$defs": {
36
+ "modelRef": {
37
+ "description": "Exact provider/model reference; model ids may contain additional slashes.",
38
+ "anyOf": [
39
+ {
40
+ "type": "null"
41
+ },
42
+ {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "pattern": "^[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+/[^\\s*?\\[\\]{}\\u0000-\\u001f\\u007f]+$"
46
+ }
47
+ ]
48
+ },
49
+ "responsesApis": {
50
+ "type": "array",
51
+ "items": {
52
+ "enum": [
53
+ "openai-responses",
54
+ "openai-codex-responses",
55
+ "azure-openai-responses"
56
+ ]
57
+ }
58
+ },
59
+ "context": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "properties": {
63
+ "mode": {
64
+ "enum": [
65
+ "pi",
66
+ "remote-compaction"
67
+ ]
68
+ },
69
+ "remoteCompaction": {
70
+ "$ref": "#/$defs/remoteCompaction"
71
+ },
72
+ "nativeFallback": {
73
+ "$ref": "#/$defs/nativeFallback"
74
+ },
75
+ "remoteWindows": {
76
+ "$ref": "#/$defs/retiredRemoteWindows"
77
+ }
78
+ }
79
+ },
80
+ "remoteCompaction": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "properties": {
84
+ "model": {
85
+ "$ref": "#/$defs/modelRef"
86
+ },
87
+ "inputSource": {
88
+ "enum": [
89
+ "legacy",
90
+ "pi-context-hook"
91
+ ]
92
+ },
93
+ "allowContinuityBreak": {
94
+ "type": "boolean"
95
+ },
96
+ "apis": {
97
+ "$ref": "#/$defs/responsesApis"
98
+ }
99
+ }
100
+ },
101
+ "nativeFallback": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "properties": {
105
+ "enabled": {
106
+ "type": "boolean"
107
+ },
108
+ "model": {
109
+ "$ref": "#/$defs/modelRef"
110
+ },
111
+ "thinkingLevel": {
112
+ "enum": [
113
+ "off",
114
+ "minimal",
115
+ "low",
116
+ "medium",
117
+ "high",
118
+ "xhigh",
119
+ "max"
120
+ ]
121
+ }
122
+ }
123
+ },
124
+ "retiredRemoteWindows": {
125
+ "deprecated": true,
126
+ "description": "Remote Windows has been removed. This opaque ancillary value is ignored with a warning; remove it from your configuration. Selecting the removed mode blocks context operations until pi or remote-compaction is explicitly selected."
127
+ },
128
+ "webSearch": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "route": {
133
+ "enum": [
134
+ "unmanaged",
135
+ "local",
136
+ "hosted",
137
+ "standalone-alpha"
138
+ ]
139
+ }
140
+ }
141
+ },
142
+ "imageGeneration": {
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "properties": {
146
+ "enabled": {
147
+ "type": "boolean"
148
+ },
149
+ "defaultModel": {
150
+ "type": "string",
151
+ "minLength": 1,
152
+ "maxLength": 256,
153
+ "pattern": "\\S"
154
+ },
155
+ "allowedModels": {
156
+ "type": "array",
157
+ "minItems": 1,
158
+ "items": {
159
+ "type": "string",
160
+ "minLength": 1,
161
+ "maxLength": 256,
162
+ "pattern": "\\S"
163
+ }
164
+ }
165
+ }
166
+ },
167
+ "responsesWebSocket": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "properties": {
171
+ "enabled": {
172
+ "type": "boolean",
173
+ "default": false
174
+ }
175
+ }
176
+ },
177
+ "retiredAutoMode": {
178
+ "deprecated": true,
179
+ "description": "Auto Mode has been removed. This value is ignored with a warning; tool calls are no longer reviewed by it. Remove this section from your configuration."
180
+ },
181
+ "compatibility": {
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "properties": {
185
+ "transport": {
186
+ "enum": [
187
+ "standard",
188
+ "codex-gateway"
189
+ ]
190
+ }
191
+ }
192
+ },
193
+ "defaults": {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "properties": {
197
+ "context": {
198
+ "$ref": "#/$defs/context"
199
+ },
200
+ "webSearch": {
201
+ "$ref": "#/$defs/webSearch"
202
+ },
203
+ "imageGeneration": {
204
+ "$ref": "#/$defs/imageGeneration"
205
+ },
206
+ "responsesWebSocket": {
207
+ "$ref": "#/$defs/responsesWebSocket"
208
+ },
209
+ "autoMode": {
210
+ "$ref": "#/$defs/retiredAutoMode"
211
+ }
212
+ }
213
+ },
214
+ "modelOverride": {
215
+ "type": "object",
216
+ "additionalProperties": false,
217
+ "properties": {
218
+ "context": {
219
+ "$ref": "#/$defs/context"
220
+ },
221
+ "webSearch": {
222
+ "$ref": "#/$defs/webSearch"
223
+ },
224
+ "autoMode": {
225
+ "$ref": "#/$defs/retiredAutoMode"
226
+ },
227
+ "compatibility": {
228
+ "$ref": "#/$defs/compatibility"
229
+ }
230
+ }
231
+ },
232
+ "diagnostics": {
233
+ "type": "object",
234
+ "additionalProperties": false,
235
+ "properties": {
236
+ "level": {
237
+ "enum": [
238
+ "error",
239
+ "warn",
240
+ "info",
241
+ "debug"
242
+ ]
243
+ },
244
+ "notifyOnLoad": {
245
+ "type": "boolean"
246
+ },
247
+ "captureRequests": {
248
+ "type": "boolean"
249
+ },
250
+ "captureResponses": {
251
+ "type": "boolean"
252
+ },
253
+ "redactSensitiveData": {
254
+ "type": "boolean"
255
+ },
256
+ "artifactRoot": {
257
+ "type": "string",
258
+ "minLength": 1,
259
+ "pattern": "\\S"
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }