mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
feat(sandbox): route host-shell surfaces into microVM via shell wrapper
This commit is contained in:
1 parent
aa3fb48a62
commit
ae117d6a78
57 files changed
+711
-784
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import path from 'path'
|
||||
import { writeFileAtomic } from '../../utils/fs-safe'
|
||||
import { buildGhEnvPluginSource } from '../opencode-gh-env-plugin'
|
||||
import { buildSandboxPluginSource } from '../opencode-sandbox-plugin'
|
||||
|
||||
export type ManagedOpenCodePlugin = {
|
||||
filename: string
|
||||
buildSource: () => string
|
||||
}
|
||||
|
||||
export const MANAGED_OPENCODE_PLUGINS: readonly ManagedOpenCodePlugin[] = [
|
||||
{ filename: 'ocm-gh-env.js', buildSource: buildGhEnvPluginSource },
|
||||
{ filename: 'ocm-sandbox.js', buildSource: buildSandboxPluginSource },
|
||||
]
|
||||
|
||||
export const TRUSTED_OPENCODE_PLUGIN_FILENAMES: readonly string[] = MANAGED_OPENCODE_PLUGINS.map((plugin) => plugin.filename)
|
||||
|
||||
export function getOpenCodePluginDir(configHome: string): string {
|
||||
return path.join(configHome, 'opencode', 'plugin')
|
||||
}
|
||||
|
||||
export async function installManagedPlugins(configHome: string): Promise<void> {
|
||||
const dir = getOpenCodePluginDir(configHome)
|
||||
for (const plugin of MANAGED_OPENCODE_PLUGINS) {
|
||||
await writeFileAtomic(path.join(dir, plugin.filename), plugin.buildSource())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user