mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 09:01:14 +00:00
Add .opencode to gitignore
This commit is contained in:
parent
0ef73ad1dc
commit
4e476f603e
2 changed files with 1 additions and 22 deletions
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`
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue