pi-openai-toolkit 0.14.5 → 0.14.7
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/docs/internals.md +42 -21
- package/package.json +1 -1
- package/src/auto-mode/classifier.ts +165 -165
- package/src/auto-mode/policy.ts +146 -146
- package/src/auto-mode/prompt.ts +279 -279
- package/src/auto-mode/reviewer.ts +325 -325
- package/src/auto-mode/transcript.ts +133 -133
- package/src/auto-mode/types.ts +137 -137
- package/src/codex-astra/effort-planner.ts +175 -175
- package/src/codex-astra/extension.ts +122 -122
- package/src/context-management/codex-provider.ts +20 -20
- package/src/context-management/history-notes.ts +32 -0
- package/src/context-management/messages.ts +112 -106
- package/src/context-management/namespace-tools.ts +426 -426
- package/src/context-management/tool-contract.ts +23 -23
- package/src/context-management/tools.ts +279 -311
- package/src/context-management/types.ts +7 -0
- package/src/context-management/window-budget.ts +83 -83
- package/src/context-management/window-manager.ts +60 -51
- package/src/context-management/window-request.ts +125 -125
- package/src/debug.ts +1 -1
- package/src/extension-runtime.ts +34 -9
- package/src/image-generation/artifacts.ts +237 -237
- package/src/image-generation/client.ts +248 -248
- package/src/image-generation/eligibility.ts +18 -18
- package/src/image-generation/references.ts +194 -194
- package/src/image-generation/render.ts +252 -252
- package/src/model-scope.ts +17 -17
- package/src/provider-headers.ts +23 -23
- package/src/responses-headers.ts +76 -11
- package/src/runtime.ts +37 -1
- package/src/web-search/extension.ts +80 -80
- package/src/web-search/payload.ts +96 -96
- package/src/web-search/prompt.ts +20 -20
- package/src/web-search/types.ts +45 -45
package/src/web-search/types.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { getExactModelKey, isExactModelAllowed } from "../model-scope";
|
|
2
|
-
import type { WebSearchConfig } from "../types";
|
|
3
|
-
|
|
4
|
-
export const WEB_SEARCH_CAPABLE_APIS = ["openai-responses", "openai-codex-responses"] as const;
|
|
5
|
-
export const WEB_SEARCH_SOURCE_INCLUDE = "web_search_call.action.sources";
|
|
6
|
-
export const WEB_SEARCH_PROMPT_MARKER = "<!-- pi-openai-toolkit:web-search -->";
|
|
7
|
-
|
|
8
|
-
export type WebSearchCapableApi = (typeof WEB_SEARCH_CAPABLE_APIS)[number];
|
|
9
|
-
|
|
10
|
-
export type WebSearchModel = {
|
|
11
|
-
api?: string;
|
|
12
|
-
provider?: string;
|
|
13
|
-
id?: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type WebSearchPayloadOutcome =
|
|
17
|
-
| "disabled"
|
|
18
|
-
| "unsupported-model"
|
|
19
|
-
| "non-object-payload"
|
|
20
|
-
| "invalid-tools"
|
|
21
|
-
| "invalid-include"
|
|
22
|
-
| "existing-native-tool"
|
|
23
|
-
| "injected-native-tool";
|
|
24
|
-
|
|
25
|
-
export type WebSearchPayloadTransform = {
|
|
26
|
-
payload: unknown;
|
|
27
|
-
outcome: WebSearchPayloadOutcome;
|
|
28
|
-
changed: boolean;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export function getWebSearchModelKey(model: WebSearchModel | undefined): string | undefined {
|
|
32
|
-
return getExactModelKey(model);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function isWebSearchEnabledForModel(
|
|
36
|
-
model: WebSearchModel | undefined,
|
|
37
|
-
config: WebSearchConfig,
|
|
38
|
-
): boolean {
|
|
39
|
-
return (
|
|
40
|
-
config.enabled &&
|
|
41
|
-
typeof model?.api === "string" &&
|
|
42
|
-
(WEB_SEARCH_CAPABLE_APIS as readonly string[]).includes(model.api) &&
|
|
43
|
-
isExactModelAllowed(model, config.models)
|
|
44
|
-
);
|
|
45
|
-
}
|
|
1
|
+
import { getExactModelKey, isExactModelAllowed } from "../model-scope";
|
|
2
|
+
import type { WebSearchConfig } from "../types";
|
|
3
|
+
|
|
4
|
+
export const WEB_SEARCH_CAPABLE_APIS = ["openai-responses", "openai-codex-responses"] as const;
|
|
5
|
+
export const WEB_SEARCH_SOURCE_INCLUDE = "web_search_call.action.sources";
|
|
6
|
+
export const WEB_SEARCH_PROMPT_MARKER = "<!-- pi-openai-toolkit:web-search -->";
|
|
7
|
+
|
|
8
|
+
export type WebSearchCapableApi = (typeof WEB_SEARCH_CAPABLE_APIS)[number];
|
|
9
|
+
|
|
10
|
+
export type WebSearchModel = {
|
|
11
|
+
api?: string;
|
|
12
|
+
provider?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type WebSearchPayloadOutcome =
|
|
17
|
+
| "disabled"
|
|
18
|
+
| "unsupported-model"
|
|
19
|
+
| "non-object-payload"
|
|
20
|
+
| "invalid-tools"
|
|
21
|
+
| "invalid-include"
|
|
22
|
+
| "existing-native-tool"
|
|
23
|
+
| "injected-native-tool";
|
|
24
|
+
|
|
25
|
+
export type WebSearchPayloadTransform = {
|
|
26
|
+
payload: unknown;
|
|
27
|
+
outcome: WebSearchPayloadOutcome;
|
|
28
|
+
changed: boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function getWebSearchModelKey(model: WebSearchModel | undefined): string | undefined {
|
|
32
|
+
return getExactModelKey(model);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function isWebSearchEnabledForModel(
|
|
36
|
+
model: WebSearchModel | undefined,
|
|
37
|
+
config: WebSearchConfig,
|
|
38
|
+
): boolean {
|
|
39
|
+
return (
|
|
40
|
+
config.enabled &&
|
|
41
|
+
typeof model?.api === "string" &&
|
|
42
|
+
(WEB_SEARCH_CAPABLE_APIS as readonly string[]).includes(model.api) &&
|
|
43
|
+
isExactModelAllowed(model, config.models)
|
|
44
|
+
);
|
|
45
|
+
}
|