cloudaxe-opencode/packages/opencode/src/cli/bootstrap.ts

21 lines
536 B
TypeScript
Raw Normal View History

2025-06-27 15:29:20 +00:00
import { App } from "../app/app"
import { ConfigHooks } from "../config/hooks"
import { Format } from "../format"
2025-06-30 20:45:13 +00:00
import { LSP } from "../lsp"
2025-08-02 22:50:19 +00:00
import { Plugin } from "../plugin"
2025-06-27 15:29:20 +00:00
import { Share } from "../share/share"
import { Snapshot } from "../snapshot"
2025-06-27 15:29:20 +00:00
export async function bootstrap<T>(input: App.Input, cb: (app: App.Info) => Promise<T>) {
2025-06-27 15:29:20 +00:00
return App.provide(input, async (app) => {
2025-08-21 15:22:13 +00:00
await Plugin.init()
2025-06-27 15:29:20 +00:00
Share.init()
Format.init()
ConfigHooks.init()
2025-06-30 20:45:13 +00:00
LSP.init()
Snapshot.init()
2025-06-27 15:29:20 +00:00
return cb(app)
})
}