@ai-sdk/harness-codex 0.0.0 → 1.0.0-beta.11

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.
@@ -0,0 +1,73 @@
1
+ import * as _ai_sdk_harness from '@ai-sdk/harness';
2
+ import { HarnessV1, HarnessV1BuiltinTool } from '@ai-sdk/harness';
3
+
4
+ type CodexAuthOptions = {
5
+ readonly openaiCompatible?: {
6
+ readonly apiKey?: string;
7
+ readonly baseUrl?: string;
8
+ readonly modelProviderName?: string;
9
+ readonly queryParamsJson?: string;
10
+ };
11
+ readonly openai?: {
12
+ readonly apiKey?: string;
13
+ readonly baseUrl?: string;
14
+ readonly organization?: string;
15
+ readonly project?: string;
16
+ };
17
+ readonly gateway?: {
18
+ readonly apiKey?: string;
19
+ readonly baseUrl?: string;
20
+ };
21
+ };
22
+
23
+ type CodexHarnessSettings = {
24
+ readonly auth?: CodexAuthOptions;
25
+ /**
26
+ * OpenAI model id the underlying `codex` CLI should use. Leaving this unset
27
+ * pins the adapter default (`DEFAULT_CODEX_MODEL`).
28
+ */
29
+ readonly model?: string;
30
+ /**
31
+ * Reasoning effort for reasoning-capable models. Leaving this unset
32
+ * defers to the CLI's default.
33
+ */
34
+ readonly reasoningEffort?: 'low' | 'medium' | 'high';
35
+ /**
36
+ * When `true`, allow the underlying runtime to use live web search.
37
+ */
38
+ readonly webSearch?: boolean;
39
+ /**
40
+ * Override the port the bridge binds inside the sandbox. By default the
41
+ * adapter uses the first port the sandbox declares via `sandbox.ports`.
42
+ * Only set this if the sandbox declares multiple ports and the first one
43
+ * is reserved for something else.
44
+ */
45
+ readonly port?: number;
46
+ /** Maximum milliseconds to wait for the bridge to advertise its port. Defaults to 120000. */
47
+ readonly startupTimeoutMs?: number;
48
+ };
49
+ declare const CODEX_BUILTIN_TOOLS: {
50
+ readonly bash: HarnessV1BuiltinTool<{
51
+ command: string;
52
+ }, unknown>;
53
+ readonly webSearch: HarnessV1BuiltinTool<{
54
+ query: string;
55
+ }, unknown>;
56
+ };
57
+ declare function createCodex(settings?: CodexHarnessSettings): HarnessV1<typeof CODEX_BUILTIN_TOOLS>;
58
+
59
+ /**
60
+ * Default `codex` harness instance with no overrides — suitable for the
61
+ * common case where the underlying `codex` CLI's defaults are fine.
62
+ * Equivalent to `createCodex()`.
63
+ */
64
+ declare const codex: _ai_sdk_harness.HarnessV1<{
65
+ readonly bash: _ai_sdk_harness.HarnessV1BuiltinTool<{
66
+ command: string;
67
+ }, unknown>;
68
+ readonly webSearch: _ai_sdk_harness.HarnessV1BuiltinTool<{
69
+ query: string;
70
+ }, unknown>;
71
+ }>;
72
+
73
+ export { type CodexAuthOptions, type CodexHarnessSettings, codex, createCodex };