opencodekit 0.20.7 → 0.21.0

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 (82) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +60 -0
  3. package/dist/template/.opencode/agent/build.md +3 -2
  4. package/dist/template/.opencode/agent/explore.md +14 -14
  5. package/dist/template/.opencode/agent/general.md +1 -1
  6. package/dist/template/.opencode/agent/plan.md +1 -1
  7. package/dist/template/.opencode/agent/review.md +1 -1
  8. package/dist/template/.opencode/agent/vision.md +0 -9
  9. package/dist/template/.opencode/memory.db +0 -0
  10. package/dist/template/.opencode/memory.db-shm +0 -0
  11. package/dist/template/.opencode/memory.db-wal +0 -0
  12. package/dist/template/.opencode/opencode.json +83 -614
  13. package/dist/template/.opencode/opencodex-fast.jsonc +1 -1
  14. package/dist/template/.opencode/package.json +1 -1
  15. package/dist/template/.opencode/plugin/copilot-auth.ts +27 -12
  16. package/dist/template/.opencode/plugin/prompt-leverage.ts +193 -0
  17. package/dist/template/.opencode/plugin/prompt-leverage.ts.bak +228 -0
  18. package/dist/template/.opencode/plugin/sdk/copilot/copilot-provider.ts +14 -2
  19. package/dist/template/.opencode/plugin/sdk/copilot/index.ts +2 -2
  20. package/dist/template/.opencode/plugin/sdk/copilot/responses/convert-to-openai-responses-input.ts +335 -0
  21. package/dist/template/.opencode/plugin/sdk/copilot/responses/map-openai-responses-finish-reason.ts +22 -0
  22. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-config.ts +18 -0
  23. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-error.ts +22 -0
  24. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-api-types.ts +214 -0
  25. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-language-model.ts +1770 -0
  26. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-prepare-tools.ts +173 -0
  27. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-settings.ts +1 -0
  28. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/code-interpreter.ts +87 -0
  29. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/file-search.ts +127 -0
  30. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/image-generation.ts +114 -0
  31. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/local-shell.ts +64 -0
  32. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/web-search-preview.ts +103 -0
  33. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/web-search.ts +102 -0
  34. package/dist/template/.opencode/pnpm-lock.yaml +791 -9
  35. package/dist/template/.opencode/skill/api-and-interface-design/SKILL.md +162 -0
  36. package/dist/template/.opencode/skill/beads/SKILL.md +10 -9
  37. package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +10 -10
  38. package/dist/template/.opencode/skill/ci-cd-and-automation/SKILL.md +202 -0
  39. package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +253 -0
  40. package/dist/template/.opencode/skill/code-simplification/SKILL.md +211 -0
  41. package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +12 -0
  42. package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +16 -6
  43. package/dist/template/.opencode/skill/deprecation-and-migration/SKILL.md +189 -0
  44. package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +12 -48
  45. package/dist/template/.opencode/skill/documentation-and-adrs/SKILL.md +220 -0
  46. package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +29 -0
  47. package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +237 -0
  48. package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +38 -0
  49. package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +509 -0
  50. package/dist/template/.opencode/skill/incremental-implementation/SKILL.md +191 -0
  51. package/dist/template/.opencode/skill/performance-optimization/SKILL.md +236 -0
  52. package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +90 -0
  53. package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +91 -0
  54. package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +157 -0
  55. package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +11 -0
  56. package/dist/template/.opencode/skill/screenshot/SKILL.md +48 -0
  57. package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +54 -0
  58. package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +22 -0
  59. package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +40 -0
  60. package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +126 -0
  61. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +163 -0
  62. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +585 -0
  63. package/dist/template/.opencode/skill/security-and-hardening/SKILL.md +296 -0
  64. package/dist/template/.opencode/skill/security-threat-model/SKILL.md +36 -0
  65. package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +255 -0
  66. package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +32 -0
  67. package/dist/template/.opencode/skill/skill-installer/SKILL.md +58 -0
  68. package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +21 -0
  69. package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +313 -0
  70. package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +106 -0
  71. package/dist/template/.opencode/skill/structured-edit/SKILL.md +10 -0
  72. package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +66 -1
  73. package/package.json +1 -1
  74. package/dist/template/.opencode/skill/beads-bridge/SKILL.md +0 -321
  75. package/dist/template/.opencode/skill/code-navigation/SKILL.md +0 -130
  76. package/dist/template/.opencode/skill/mqdh/SKILL.md +0 -171
  77. package/dist/template/.opencode/skill/obsidian/SKILL.md +0 -192
  78. package/dist/template/.opencode/skill/obsidian/mcp.json +0 -22
  79. package/dist/template/.opencode/skill/pencil/SKILL.md +0 -72
  80. package/dist/template/.opencode/skill/ralph/SKILL.md +0 -296
  81. package/dist/template/.opencode/skill/tilth-cli/SKILL.md +0 -207
  82. package/dist/template/.opencode/skill/tool-priority/SKILL.md +0 -299
@@ -0,0 +1,335 @@
1
+ import {
2
+ type LanguageModelV3Prompt,
3
+ type LanguageModelV3ToolCallPart,
4
+ type SharedV3Warning,
5
+ UnsupportedFunctionalityError,
6
+ } from "@ai-sdk/provider"
7
+ import { convertToBase64, parseProviderOptions } from "@ai-sdk/provider-utils"
8
+ import { z } from "zod/v4"
9
+ import type { OpenAIResponsesInput, OpenAIResponsesReasoning } from "./openai-responses-api-types.js"
10
+ import { localShellInputSchema, localShellOutputSchema } from "./tool/local-shell.js"
11
+
12
+ /**
13
+ * Check if a string is a file ID based on the given prefixes
14
+ * Returns false if prefixes is undefined (disables file ID detection)
15
+ */
16
+ function isFileId(data: string, prefixes?: readonly string[]): boolean {
17
+ if (!prefixes) return false
18
+ return prefixes.some((prefix) => data.startsWith(prefix))
19
+ }
20
+
21
+ export async function convertToOpenAIResponsesInput({
22
+ prompt,
23
+ systemMessageMode,
24
+ fileIdPrefixes,
25
+ store,
26
+ hasLocalShellTool = false,
27
+ }: {
28
+ prompt: LanguageModelV3Prompt
29
+ systemMessageMode: "system" | "developer" | "remove"
30
+ fileIdPrefixes?: readonly string[]
31
+ store: boolean
32
+ hasLocalShellTool?: boolean
33
+ }): Promise<{
34
+ input: OpenAIResponsesInput
35
+ warnings: Array<SharedV3Warning>
36
+ }> {
37
+ const input: OpenAIResponsesInput = []
38
+ const warnings: Array<SharedV3Warning> = []
39
+ const processedApprovalIds = new Set<string>()
40
+
41
+ for (const { role, content } of prompt) {
42
+ switch (role) {
43
+ case "system": {
44
+ switch (systemMessageMode) {
45
+ case "system": {
46
+ input.push({ role: "system", content })
47
+ break
48
+ }
49
+ case "developer": {
50
+ input.push({ role: "developer", content })
51
+ break
52
+ }
53
+ case "remove": {
54
+ warnings.push({
55
+ type: "other",
56
+ message: "system messages are removed for this model",
57
+ })
58
+ break
59
+ }
60
+ default: {
61
+ const _exhaustiveCheck: never = systemMessageMode
62
+ throw new Error(`Unsupported system message mode: ${_exhaustiveCheck}`)
63
+ }
64
+ }
65
+ break
66
+ }
67
+
68
+ case "user": {
69
+ input.push({
70
+ role: "user",
71
+ content: content.map((part, index) => {
72
+ switch (part.type) {
73
+ case "text": {
74
+ return { type: "input_text", text: part.text }
75
+ }
76
+ case "file": {
77
+ if (part.mediaType.startsWith("image/")) {
78
+ const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType
79
+
80
+ return {
81
+ type: "input_image",
82
+ ...(part.data instanceof URL
83
+ ? { image_url: part.data.toString() }
84
+ : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes)
85
+ ? { file_id: part.data }
86
+ : {
87
+ image_url: `data:${mediaType};base64,${convertToBase64(part.data)}`,
88
+ }),
89
+ detail: part.providerOptions?.openai?.imageDetail,
90
+ }
91
+ } else if (part.mediaType === "application/pdf") {
92
+ if (part.data instanceof URL) {
93
+ return {
94
+ type: "input_file",
95
+ file_url: part.data.toString(),
96
+ }
97
+ }
98
+ return {
99
+ type: "input_file",
100
+ ...(typeof part.data === "string" && isFileId(part.data, fileIdPrefixes)
101
+ ? { file_id: part.data }
102
+ : {
103
+ filename: part.filename ?? `part-${index}.pdf`,
104
+ file_data: `data:application/pdf;base64,${convertToBase64(part.data)}`,
105
+ }),
106
+ }
107
+ } else {
108
+ throw new UnsupportedFunctionalityError({
109
+ functionality: `file part media type ${part.mediaType}`,
110
+ })
111
+ }
112
+ }
113
+ }
114
+ }),
115
+ })
116
+
117
+ break
118
+ }
119
+
120
+ case "assistant": {
121
+ const reasoningMessages: Record<string, OpenAIResponsesReasoning> = {}
122
+ const toolCallParts: Record<string, LanguageModelV3ToolCallPart> = {}
123
+
124
+ for (const part of content) {
125
+ switch (part.type) {
126
+ case "text": {
127
+ input.push({
128
+ role: "assistant",
129
+ content: [{ type: "output_text", text: part.text }],
130
+ id: (part.providerOptions?.openai?.itemId as string) ?? undefined,
131
+ })
132
+ break
133
+ }
134
+ case "tool-call": {
135
+ toolCallParts[part.toolCallId] = part
136
+
137
+ if (part.providerExecuted) {
138
+ break
139
+ }
140
+
141
+ if (hasLocalShellTool && part.toolName === "local_shell") {
142
+ const parsedInput = localShellInputSchema.parse(part.input)
143
+ input.push({
144
+ type: "local_shell_call",
145
+ call_id: part.toolCallId,
146
+ id: (part.providerOptions?.openai?.itemId as string) ?? undefined,
147
+ action: {
148
+ type: "exec",
149
+ command: parsedInput.action.command,
150
+ timeout_ms: parsedInput.action.timeoutMs,
151
+ user: parsedInput.action.user,
152
+ working_directory: parsedInput.action.workingDirectory,
153
+ env: parsedInput.action.env,
154
+ },
155
+ })
156
+
157
+ break
158
+ }
159
+
160
+ input.push({
161
+ type: "function_call",
162
+ call_id: part.toolCallId,
163
+ name: part.toolName,
164
+ arguments: JSON.stringify(part.input),
165
+ id: (part.providerOptions?.openai?.itemId as string) ?? undefined,
166
+ })
167
+ break
168
+ }
169
+
170
+ // assistant tool result parts are from provider-executed tools:
171
+ case "tool-result": {
172
+ if (store) {
173
+ // use item references to refer to tool results from built-in tools
174
+ input.push({ type: "item_reference", id: part.toolCallId })
175
+ } else {
176
+ warnings.push({
177
+ type: "other",
178
+ message: `Results for OpenAI tool ${part.toolName} are not sent to the API when store is false`,
179
+ })
180
+ }
181
+
182
+ break
183
+ }
184
+
185
+ case "reasoning": {
186
+ const providerOptions = await parseProviderOptions({
187
+ provider: "copilot",
188
+ providerOptions: part.providerOptions,
189
+ schema: openaiResponsesReasoningProviderOptionsSchema,
190
+ })
191
+
192
+ const reasoningId = providerOptions?.itemId
193
+
194
+ if (reasoningId != null) {
195
+ const reasoningMessage = reasoningMessages[reasoningId]
196
+
197
+ if (store) {
198
+ if (reasoningMessage === undefined) {
199
+ // use item references to refer to reasoning (single reference)
200
+ input.push({ type: "item_reference", id: reasoningId })
201
+
202
+ // store unused reasoning message to mark id as used
203
+ reasoningMessages[reasoningId] = {
204
+ type: "reasoning",
205
+ id: reasoningId,
206
+ summary: [],
207
+ }
208
+ }
209
+ } else {
210
+ const summaryParts: Array<{
211
+ type: "summary_text"
212
+ text: string
213
+ }> = []
214
+
215
+ if (part.text.length > 0) {
216
+ summaryParts.push({
217
+ type: "summary_text",
218
+ text: part.text,
219
+ })
220
+ } else if (reasoningMessage !== undefined) {
221
+ warnings.push({
222
+ type: "other",
223
+ message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`,
224
+ })
225
+ }
226
+
227
+ if (reasoningMessage === undefined) {
228
+ reasoningMessages[reasoningId] = {
229
+ type: "reasoning",
230
+ id: reasoningId,
231
+ encrypted_content: providerOptions?.reasoningEncryptedContent,
232
+ summary: summaryParts,
233
+ }
234
+ input.push(reasoningMessages[reasoningId])
235
+ } else {
236
+ reasoningMessage.summary.push(...summaryParts)
237
+ }
238
+ }
239
+ } else {
240
+ warnings.push({
241
+ type: "other",
242
+ message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(part)}.`,
243
+ })
244
+ }
245
+ break
246
+ }
247
+ }
248
+ }
249
+
250
+ break
251
+ }
252
+
253
+ case "tool": {
254
+ for (const part of content) {
255
+ if (part.type === "tool-approval-response") {
256
+ if (processedApprovalIds.has(part.approvalId)) {
257
+ continue
258
+ }
259
+ processedApprovalIds.add(part.approvalId)
260
+
261
+ if (store) {
262
+ input.push({
263
+ type: "item_reference",
264
+ id: part.approvalId,
265
+ })
266
+ }
267
+
268
+ input.push({
269
+ type: "mcp_approval_response",
270
+ approval_request_id: part.approvalId,
271
+ approve: part.approved,
272
+ })
273
+ continue
274
+ }
275
+ const output = part.output
276
+
277
+ if (output.type === "execution-denied") {
278
+ const approvalId = (output.providerOptions?.openai as { approvalId?: string } | undefined)?.approvalId
279
+
280
+ if (approvalId) {
281
+ continue
282
+ }
283
+ }
284
+
285
+ if (hasLocalShellTool && part.toolName === "local_shell" && output.type === "json") {
286
+ input.push({
287
+ type: "local_shell_call_output",
288
+ call_id: part.toolCallId,
289
+ output: localShellOutputSchema.parse(output.value).output,
290
+ })
291
+ break
292
+ }
293
+
294
+ let contentValue: string
295
+ switch (output.type) {
296
+ case "text":
297
+ case "error-text":
298
+ contentValue = output.value
299
+ break
300
+ case "execution-denied":
301
+ contentValue = output.reason ?? "Tool execution denied."
302
+ break
303
+ case "content":
304
+ case "json":
305
+ case "error-json":
306
+ contentValue = JSON.stringify(output.value)
307
+ break
308
+ }
309
+
310
+ input.push({
311
+ type: "function_call_output",
312
+ call_id: part.toolCallId,
313
+ output: contentValue,
314
+ })
315
+ }
316
+
317
+ break
318
+ }
319
+
320
+ default: {
321
+ const _exhaustiveCheck: never = role
322
+ throw new Error(`Unsupported role: ${_exhaustiveCheck}`)
323
+ }
324
+ }
325
+ }
326
+
327
+ return { input, warnings }
328
+ }
329
+
330
+ const openaiResponsesReasoningProviderOptionsSchema = z.object({
331
+ itemId: z.string().nullish(),
332
+ reasoningEncryptedContent: z.string().nullish(),
333
+ })
334
+
335
+ export type OpenAIResponsesReasoningProviderOptions = z.infer<typeof openaiResponsesReasoningProviderOptionsSchema>
@@ -0,0 +1,22 @@
1
+ import type { LanguageModelV3FinishReason } from "@ai-sdk/provider"
2
+
3
+ export function mapOpenAIResponseFinishReason({
4
+ finishReason,
5
+ hasFunctionCall,
6
+ }: {
7
+ finishReason: string | null | undefined
8
+ // flag that checks if there have been client-side tool calls (not executed by openai)
9
+ hasFunctionCall: boolean
10
+ }): LanguageModelV3FinishReason["unified"] {
11
+ switch (finishReason) {
12
+ case undefined:
13
+ case null:
14
+ return hasFunctionCall ? "tool-calls" : "stop"
15
+ case "max_output_tokens":
16
+ return "length"
17
+ case "content_filter":
18
+ return "content-filter"
19
+ default:
20
+ return hasFunctionCall ? "tool-calls" : "other"
21
+ }
22
+ }
@@ -0,0 +1,18 @@
1
+ import type { FetchFunction } from "@ai-sdk/provider-utils"
2
+
3
+ export type OpenAIConfig = {
4
+ provider: string
5
+ url: (options: { modelId: string; path: string }) => string
6
+ headers: () => Record<string, string | undefined>
7
+ fetch?: FetchFunction
8
+ generateId?: () => string
9
+ /**
10
+ * File ID prefixes used to identify file IDs in Responses API.
11
+ * When undefined, all file data is treated as base64 content.
12
+ *
13
+ * Examples:
14
+ * - OpenAI: ['file-'] for IDs like 'file-abc123'
15
+ * - Azure OpenAI: ['assistant-'] for IDs like 'assistant-abc123'
16
+ */
17
+ fileIdPrefixes?: readonly string[]
18
+ }
@@ -0,0 +1,22 @@
1
+ import { z } from "zod/v4"
2
+ import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils"
3
+
4
+ export const openaiErrorDataSchema = z.object({
5
+ error: z.object({
6
+ message: z.string(),
7
+
8
+ // The additional information below is handled loosely to support
9
+ // OpenAI-compatible providers that have slightly different error
10
+ // responses:
11
+ type: z.string().nullish(),
12
+ param: z.any().nullish(),
13
+ code: z.union([z.string(), z.number()]).nullish(),
14
+ }),
15
+ })
16
+
17
+ export type OpenAIErrorData = z.infer<typeof openaiErrorDataSchema>
18
+
19
+ export const openaiFailedResponseHandler: any = createJsonErrorResponseHandler({
20
+ errorSchema: openaiErrorDataSchema,
21
+ errorToMessage: (data) => data.error.message,
22
+ })
@@ -0,0 +1,214 @@
1
+ import type { JSONSchema7 } from "@ai-sdk/provider"
2
+
3
+ export type OpenAIResponsesInput = Array<OpenAIResponsesInputItem>
4
+
5
+ export type OpenAIResponsesInputItem =
6
+ | OpenAIResponsesSystemMessage
7
+ | OpenAIResponsesUserMessage
8
+ | OpenAIResponsesAssistantMessage
9
+ | OpenAIResponsesFunctionCall
10
+ | OpenAIResponsesFunctionCallOutput
11
+ | OpenAIResponsesComputerCall
12
+ | OpenAIResponsesLocalShellCall
13
+ | OpenAIResponsesLocalShellCallOutput
14
+ | OpenAIResponsesReasoning
15
+ | OpenAIResponsesItemReference
16
+ | OpenAIResponsesMcpApprovalResponse
17
+
18
+ export type OpenAIResponsesIncludeValue =
19
+ | "web_search_call.action.sources"
20
+ | "code_interpreter_call.outputs"
21
+ | "computer_call_output.output.image_url"
22
+ | "file_search_call.results"
23
+ | "message.input_image.image_url"
24
+ | "message.output_text.logprobs"
25
+ | "reasoning.encrypted_content"
26
+
27
+ export type OpenAIResponsesIncludeOptions = Array<OpenAIResponsesIncludeValue> | undefined | null
28
+
29
+ export type OpenAIResponsesSystemMessage = {
30
+ role: "system" | "developer"
31
+ content: string
32
+ }
33
+
34
+ export type OpenAIResponsesUserMessage = {
35
+ role: "user"
36
+ content: Array<
37
+ | { type: "input_text"; text: string }
38
+ | { type: "input_image"; image_url: string }
39
+ | { type: "input_image"; file_id: string }
40
+ | { type: "input_file"; file_url: string }
41
+ | { type: "input_file"; filename: string; file_data: string }
42
+ | { type: "input_file"; file_id: string }
43
+ >
44
+ }
45
+
46
+ export type OpenAIResponsesAssistantMessage = {
47
+ role: "assistant"
48
+ content: Array<{ type: "output_text"; text: string }>
49
+ id?: string
50
+ }
51
+
52
+ export type OpenAIResponsesFunctionCall = {
53
+ type: "function_call"
54
+ call_id: string
55
+ name: string
56
+ arguments: string
57
+ id?: string
58
+ }
59
+
60
+ export type OpenAIResponsesFunctionCallOutput = {
61
+ type: "function_call_output"
62
+ call_id: string
63
+ output: string
64
+ }
65
+
66
+ export type OpenAIResponsesComputerCall = {
67
+ type: "computer_call"
68
+ id: string
69
+ status?: string
70
+ }
71
+
72
+ export type OpenAIResponsesLocalShellCall = {
73
+ type: "local_shell_call"
74
+ id: string
75
+ call_id: string
76
+ action: {
77
+ type: "exec"
78
+ command: string[]
79
+ timeout_ms?: number
80
+ user?: string
81
+ working_directory?: string
82
+ env?: Record<string, string>
83
+ }
84
+ }
85
+
86
+ export type OpenAIResponsesLocalShellCallOutput = {
87
+ type: "local_shell_call_output"
88
+ call_id: string
89
+ output: string
90
+ }
91
+
92
+ export type OpenAIResponsesItemReference = {
93
+ type: "item_reference"
94
+ id: string
95
+ }
96
+
97
+ export type OpenAIResponsesMcpApprovalResponse = {
98
+ type: "mcp_approval_response"
99
+ approval_request_id: string
100
+ approve: boolean
101
+ }
102
+
103
+ /**
104
+ * A filter used to compare a specified attribute key to a given value using a defined comparison operation.
105
+ */
106
+ export type OpenAIResponsesFileSearchToolComparisonFilter = {
107
+ /**
108
+ * The key to compare against the value.
109
+ */
110
+ key: string
111
+
112
+ /**
113
+ * Specifies the comparison operator: eq, ne, gt, gte, lt, lte.
114
+ */
115
+ type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte"
116
+
117
+ /**
118
+ * The value to compare against the attribute key; supports string, number, or boolean types.
119
+ */
120
+ value: string | number | boolean
121
+ }
122
+
123
+ /**
124
+ * Combine multiple filters using and or or.
125
+ */
126
+ export type OpenAIResponsesFileSearchToolCompoundFilter = {
127
+ /**
128
+ * Type of operation: and or or.
129
+ */
130
+ type: "and" | "or"
131
+
132
+ /**
133
+ * Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
134
+ */
135
+ filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>
136
+ }
137
+
138
+ export type OpenAIResponsesTool =
139
+ | {
140
+ type: "function"
141
+ name: string
142
+ description: string | undefined
143
+ parameters: JSONSchema7
144
+ strict: boolean | undefined
145
+ }
146
+ | {
147
+ type: "web_search"
148
+ filters: { allowed_domains: string[] | undefined } | undefined
149
+ search_context_size: "low" | "medium" | "high" | undefined
150
+ user_location:
151
+ | {
152
+ type: "approximate"
153
+ city?: string
154
+ country?: string
155
+ region?: string
156
+ timezone?: string
157
+ }
158
+ | undefined
159
+ }
160
+ | {
161
+ type: "web_search_preview"
162
+ search_context_size: "low" | "medium" | "high" | undefined
163
+ user_location:
164
+ | {
165
+ type: "approximate"
166
+ city?: string
167
+ country?: string
168
+ region?: string
169
+ timezone?: string
170
+ }
171
+ | undefined
172
+ }
173
+ | {
174
+ type: "code_interpreter"
175
+ container: string | { type: "auto"; file_ids: string[] | undefined }
176
+ }
177
+ | {
178
+ type: "file_search"
179
+ vector_store_ids: string[]
180
+ max_num_results: number | undefined
181
+ ranking_options: { ranker?: string; score_threshold?: number } | undefined
182
+ filters: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter | undefined
183
+ }
184
+ | {
185
+ type: "image_generation"
186
+ background: "auto" | "opaque" | "transparent" | undefined
187
+ input_fidelity: "low" | "high" | undefined
188
+ input_image_mask:
189
+ | {
190
+ file_id: string | undefined
191
+ image_url: string | undefined
192
+ }
193
+ | undefined
194
+ model: string | undefined
195
+ moderation: "auto" | undefined
196
+ output_compression: number | undefined
197
+ output_format: "png" | "jpeg" | "webp" | undefined
198
+ partial_images: number | undefined
199
+ quality: "auto" | "low" | "medium" | "high" | undefined
200
+ size: "auto" | "1024x1024" | "1024x1536" | "1536x1024" | undefined
201
+ }
202
+ | {
203
+ type: "local_shell"
204
+ }
205
+
206
+ export type OpenAIResponsesReasoning = {
207
+ type: "reasoning"
208
+ id: string
209
+ encrypted_content?: string | null
210
+ summary: Array<{
211
+ type: "summary_text"
212
+ text: string
213
+ }>
214
+ }