Add .opencode to gitignore
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,3 +26,4 @@ coverage/
|
|||||||
.pi_config/
|
.pi_config/
|
||||||
tui-debug.log
|
tui-debug.log
|
||||||
compaction-results/
|
compaction-results/
|
||||||
|
.opencode/
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
import { tool } from "@opencode-ai/plugin"
|
|
||||||
|
|
||||||
export default tool({
|
|
||||||
description: "Sleep for a specified number of milliseconds",
|
|
||||||
args: {
|
|
||||||
ms: tool.schema.number().describe("Number of milliseconds to sleep"),
|
|
||||||
},
|
|
||||||
async execute(args, context) {
|
|
||||||
if (context.abort.aborted) {
|
|
||||||
throw new Error("Sleep aborted")
|
|
||||||
}
|
|
||||||
await new Promise<void>((resolve, reject) => {
|
|
||||||
const timeout = setTimeout(resolve, args.ms)
|
|
||||||
const onAbort = () => {
|
|
||||||
clearTimeout(timeout)
|
|
||||||
reject(new Error("Sleep aborted"))
|
|
||||||
}
|
|
||||||
context.abort.addEventListener("abort", onAbort, { once: true })
|
|
||||||
})
|
|
||||||
return `Slept for ${args.ms}ms`
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user