CJackHwang/Succinix--packages-engine ↗★ 6

@succinix/engine

在WebContainer中嵌入类Unix沙箱引擎 适合需要在浏览器中管理文件系统、执行Node/Python命令的开发。

套件
@succinix/engine
相容性
待驗證
Cordis 依賴範圍
^4.0.1
版本
0.7.0
授權
MIT
最近更新
2026年8月19日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@succinix/engine

简体中文

@succinix/engine is the Cordis plugin for embedding Succinix in an application. It provides a browser project workspace that manages files, command execution, terminal sessions, and session persistence.

What It Is For

You do not need to build a filesystem, command router, terminal, and persistence layer yourself. Once connected to WebContainer, Node, Python, and Unix commands use the same workspace.

How To Use It

Install the package and publish its assets as static files:

npm install @succinix/engine@0.7.0 @deepseek-ai/cordis @webcontainer/api
mkdir -p public/engine
cp -R node_modules/@succinix/engine/assets/. public/engine/
import { Context } from '@deepseek-ai/cordis'
import engine from '@succinix/engine'
import { WebContainer } from '@webcontainer/api'

const ctx = new Context()
const fiber = ctx.plugin(engine, {
  hostJsUrl: '/engine/host.js',
  lifoCoreUrl: '/engine/lifo-core.js',
  pythonAssetsUrl: '/engine/pyodide/',
  container: { mode: 'external' },
})
await fiber

const host = ctx.get('succinix', false)!
await host.attach(await WebContainer.boot())
await host.ensureInstance('default', { executor: {} })
await host.executor.exec('npm run dev')

await host.shutdown()
await fiber.dispose()

Application plugins needing files, confinement, terminals, or session persistence declare:

export const inject = ['fs', 'sandbox', 'terminals', 'sessionPersistence']

Use ctx.get('succinix', false) for host lifecycle, instances, ports, and executor management; use the four services for daily plugin work.

Check Before Integrating

  • Peer dependencies are @deepseek-ai/cordis ^4.0.1 and @webcontainer/api ^1.6.4.
  • Chromium only; the page needs COOP/COEP.
  • Ports are browser previews, not public services.

See Integration for fields and lifecycle and Migration for older versions.