GHHG10/CodeServer / opencode /packages /plugin /src /example-workspace.ts
GHHG10's picture
download
raw
849 Bytes
import type { Plugin } from "@opencode-ai/plugin"
import { mkdir, rm } from "node:fs/promises"
export const FolderWorkspacePlugin: Plugin = async ({ experimental_workspace }) => {
experimental_workspace.register("folder", {
name: "Folder",
description: "Create a blank folder",
configure(config) {
const rand = "" + Math.random()
return {
...config,
directory: `/tmp/folder/folder-${rand}`,
}
},
async create(config) {
if (!config.directory) return
await mkdir(config.directory, { recursive: true })
},
async remove(config) {
await rm(config.directory!, { recursive: true, force: true })
},
target(config) {
return {
type: "local",
directory: config.directory!,
}
},
})
return {}
}
export default FolderWorkspacePlugin

Xet Storage Details

Size:
849 Bytes
·
Xet hash:
5c8fcd8039d0f98de4d34312efcca867edb00f424181c2ba37ad30991059030c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.