mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 02:34:21 +01:00
chore: format code
This commit is contained in:
@@ -32,12 +32,12 @@ import { tool } from "@opencode-ai/plugin"
|
|||||||
export default tool({
|
export default tool({
|
||||||
description: "Query the project database",
|
description: "Query the project database",
|
||||||
args: {
|
args: {
|
||||||
query: tool.schema.string().describe("SQL query to execute")
|
query: tool.schema.string().describe("SQL query to execute"),
|
||||||
},
|
},
|
||||||
async execute(args) {
|
async execute(args) {
|
||||||
// Your database logic here
|
// Your database logic here
|
||||||
return `Executed query: ${args.query}`
|
return `Executed query: ${args.query}`
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ import { z } from "zod"
|
|||||||
export default {
|
export default {
|
||||||
description: "Tool description",
|
description: "Tool description",
|
||||||
args: {
|
args: {
|
||||||
param: z.string().describe("Parameter description")
|
param: z.string().describe("Parameter description"),
|
||||||
},
|
},
|
||||||
async execute(args, context) {
|
async execute(args, context) {
|
||||||
// Tool implementation
|
// Tool implementation
|
||||||
@@ -105,22 +105,22 @@ export const add = tool({
|
|||||||
description: "Add two numbers",
|
description: "Add two numbers",
|
||||||
args: {
|
args: {
|
||||||
a: tool.schema.number().describe("First number"),
|
a: tool.schema.number().describe("First number"),
|
||||||
b: tool.schema.number().describe("Second number")
|
b: tool.schema.number().describe("Second number"),
|
||||||
},
|
},
|
||||||
async execute(args) {
|
async execute(args) {
|
||||||
return args.a + args.b
|
return args.a + args.b
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const multiply = tool({
|
export const multiply = tool({
|
||||||
description: "Multiply two numbers",
|
description: "Multiply two numbers",
|
||||||
args: {
|
args: {
|
||||||
a: tool.schema.number().describe("First number"),
|
a: tool.schema.number().describe("First number"),
|
||||||
b: tool.schema.number().describe("Second number")
|
b: tool.schema.number().describe("Second number"),
|
||||||
},
|
},
|
||||||
async execute(args) {
|
async execute(args) {
|
||||||
return args.a * args.b
|
return args.a * args.b
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user