pi-openai-toolkit 0.14.3 → 0.14.5
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 +135 -175
- package/README.zh.md +135 -175
- package/docs/internals.md +73 -0
- package/extensions/auto-mode.ts +1 -1
- package/extensions/codex-astra.ts +1 -1
- package/extensions/compaction.ts +1 -1
- package/extensions/image-generation.ts +1 -1
- package/extensions/web-search.ts +1 -1
- package/package.json +127 -126
- package/src/config.ts +621 -582
- package/src/context-management/codex-provider.ts +260 -262
- package/src/context-management/history-notes.ts +325 -319
- package/src/context-management/tools.ts +5 -3
- package/src/context-management/types.ts +161 -160
- package/src/extension-runtime.ts +9 -5
- package/src/image-generation/extension.ts +19 -2
- package/src/image-generation/protocol.ts +473 -405
- package/src/image-generation/service.ts +249 -243
- package/src/image-generation/types.ts +189 -184
- package/src/responses-headers.ts +108 -108
- package/src/runtime.ts +477 -477
- package/src/types.ts +18 -0
- package/src/web-search/prompt.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -80,6 +80,12 @@ export type CompactionConfig = {
|
|
|
80
80
|
* Subset of RESPONSES_COMPACT_CAPABLE_APIS that should use remote compaction.
|
|
81
81
|
*/
|
|
82
82
|
responsesApis: string[];
|
|
83
|
+
/**
|
|
84
|
+
* Exact "provider/model" keys allowed to use Codex Remote Context on the
|
|
85
|
+
* `openai-responses` gateway wire. The native `openai-codex` route ignores
|
|
86
|
+
* this list; gateway coverage is opt-in per model.
|
|
87
|
+
*/
|
|
88
|
+
gatewayContextModels: string[];
|
|
83
89
|
/**
|
|
84
90
|
* Percentage of the context window that, when remaining tokens drop below it,
|
|
85
91
|
* triggers a checkpoint/new_context reminder (0-100; 0 disables reminders).
|
|
@@ -101,6 +107,12 @@ export type WebSearchConfig = {
|
|
|
101
107
|
|
|
102
108
|
export type ImageGenerationConfig = {
|
|
103
109
|
enabled: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Bare `image_generation` tool model ids this toolkit may send, without a `provider/` prefix.
|
|
112
|
+
* The first entry is the default; `openai_generate_image`'s optional `model` argument may
|
|
113
|
+
* select any other entry in this order-preserving list.
|
|
114
|
+
*/
|
|
115
|
+
models: string[];
|
|
104
116
|
};
|
|
105
117
|
|
|
106
118
|
/** `side-effect` reviews bash/write/edit plus extras; `all` reviews every tool call. */
|
|
@@ -506,6 +518,7 @@ export const DEFAULT_COMPACTION_CONFIG: CompactionConfig = {
|
|
|
506
518
|
remoteCompactModel: undefined,
|
|
507
519
|
nativeFallback: { ...DEFAULT_NATIVE_FALLBACK_CONFIG },
|
|
508
520
|
responsesApis: [...RESPONSES_COMPACT_CAPABLE_APIS],
|
|
521
|
+
gatewayContextModels: [],
|
|
509
522
|
contextReminderThresholdPercent: 5,
|
|
510
523
|
notifyOnLoad: false,
|
|
511
524
|
debug: false,
|
|
@@ -520,8 +533,13 @@ export const DEFAULT_WEB_SEARCH_CONFIG: WebSearchConfig = {
|
|
|
520
533
|
models: [],
|
|
521
534
|
};
|
|
522
535
|
|
|
536
|
+
/** Single source of truth for the hosted image model used when nothing is configured. */
|
|
537
|
+
export const DEFAULT_IMAGE_GENERATION_MODEL = "gpt-image-2.5";
|
|
538
|
+
export const DEFAULT_IMAGE_GENERATION_MODELS: readonly string[] = [DEFAULT_IMAGE_GENERATION_MODEL];
|
|
539
|
+
|
|
523
540
|
export const DEFAULT_IMAGE_GENERATION_CONFIG: ImageGenerationConfig = {
|
|
524
541
|
enabled: false,
|
|
542
|
+
models: [...DEFAULT_IMAGE_GENERATION_MODELS],
|
|
525
543
|
};
|
|
526
544
|
|
|
527
545
|
export const DEFAULT_AUTO_MODE_CONFIG: AutoModeConfig = {
|
package/src/web-search/prompt.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { isWebSearchEnabledForModel, WEB_SEARCH_PROMPT_MARKER, type WebSearchMod
|
|
|
4
4
|
export const WEB_SEARCH_PROMPT_SECTION = `${WEB_SEARCH_PROMPT_MARKER}
|
|
5
5
|
## Web Search
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The hosted \`web_search\` tool is part of your tool list for this model. The API executes it server-side: it is a real callable tool even though no client-side function schema or description accompanies it. Call it whenever current or online information matters instead of guessing, cite the returned sources in the answer, and never claim that web search or internet access is unavailable while this section is present.`;
|
|
8
8
|
|
|
9
9
|
export function appendWebSearchPrompt(args: {
|
|
10
10
|
model: WebSearchModel | undefined;
|