summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bun.lock3
-rw-r--r--package.json4
-rw-r--r--packages/opencode/src/config/config.ts13
-rw-r--r--patches/@standard-community%[email protected]16
4 files changed, 28 insertions, 8 deletions
diff --git a/bun.lock b/bun.lock
index 11b6938e7..fcb2f8f0c 100644
--- a/bun.lock
+++ b/bun.lock
@@ -497,6 +497,9 @@
"web-tree-sitter",
"tree-sitter-bash",
],
+ "patchedDependencies": {
+ "@standard-community/[email protected]": "patches/@standard-community%[email protected]",
+ },
"overrides": {
"@types/bun": "catalog:",
"@types/node": "catalog:",
diff --git a/package.json b/package.json
index 148d2ad84..2c69f46d2 100644
--- a/package.json
+++ b/package.json
@@ -100,5 +100,7 @@
"@types/bun": "catalog:",
"@types/node": "catalog:"
},
- "patchedDependencies": {}
+ "patchedDependencies": {
+ "@standard-community/[email protected]": "patches/@standard-community%[email protected]"
+ }
}
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts
index 6dd0592d5..e01fee28a 100644
--- a/packages/opencode/src/config/config.ts
+++ b/packages/opencode/src/config/config.ts
@@ -33,6 +33,8 @@ import { proxied } from "@/util/proxied"
import { iife } from "@/util/iife"
export namespace Config {
+ const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" })
+
const log = Log.create({ service: "config" })
// Managed settings directory for enterprise deployments (highest priority, admin-controlled)
@@ -653,7 +655,7 @@ export namespace Config {
template: z.string(),
description: z.string().optional(),
agent: z.string().optional(),
- model: z.string().optional(),
+ model: ModelId.optional(),
subtask: z.boolean().optional(),
})
export type Command = z.infer<typeof Command>
@@ -669,7 +671,7 @@ export namespace Config {
export const Agent = z
.object({
- model: z.string().optional(),
+ model: ModelId.optional(),
variant: z
.string()
.optional()
@@ -1040,11 +1042,8 @@ export namespace Config {
.array(z.string())
.optional()
.describe("When set, ONLY these providers will be enabled. All other providers will be ignored"),
- model: z.string().describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(),
- small_model: z
- .string()
- .describe("Small model to use for tasks like title generation in the format of provider/model")
- .optional(),
+ model: ModelId.describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(),
+ small_model: ModelId.describe("Small model to use for tasks like title generation in the format of provider/model").optional(),
default_agent: z
.string()
.optional()
diff --git a/patches/@standard-community%[email protected] b/patches/@standard-community%[email protected]
new file mode 100644
index 000000000..2ac5af09a
--- /dev/null
+++ b/patches/@standard-community%[email protected]
@@ -0,0 +1,16 @@
+diff --git a/dist/vendors/convert.js b/dist/vendors/convert.js
+index 0d615eebfd7cd646937ec1b29f8332db73586ec1..7b146f903c07a9377d676753691cba67781879be 100644
+--- a/dist/vendors/convert.js
++++ b/dist/vendors/convert.js
+@@ -74,7 +74,10 @@ function convertToOpenAPISchema(jsonSchema, context) {
+ $ref: `#/components/schemas/${id}`
+ };
+ } else if (_jsonSchema.$ref) {
+- const { $ref, $defs } = _jsonSchema;
++ const { $ref, $defs, ...rest } = _jsonSchema;
++ if ($ref.includes("://")) {
++ return Object.keys(rest).length > 0 ? rest : { type: "string" };
++ }
+ const ref = $ref.split("/").pop();
+ context.components.schemas = {
+ ...context.components.schemas,