@mindcraft-lang/bridge-app
v0.2.0
Published
App-side client for the Mindcraft bridge
Downloads
495
Maintainers
Readme
@mindcraft-lang/bridge-app
App-side client for the Mindcraft bridge.
Wraps @mindcraft-lang/bridge-client with app-role-specific behavior: automatic join code
management and the "app" WebSocket path. Apps that connect to the bridge should depend on
this package rather than using bridge-client directly.
Usage
import { createAppBridge } from "@mindcraft-lang/bridge-app";
import { createCompilationFeature } from "@mindcraft-lang/bridge-app/compilation";
const bridge = createAppBridge({
appName: "My App",
bridgeUrl: "ws://localhost:6464",
workspace: myWorkspaceAdapter,
features: [createCompilationFeature({ compiler })],
});
bridge.start();The bridge facade supports:
start()/stop()-- lifecycle managementrequestSync()-- request a full workspace sync from the VS Code extensionsnapshot()-- current connection status and join codeonStateChange(...)/onRemoteChange(...)-- event subscriptions
Optional features (like compilation) attach through the features array and receive
a AppBridgeFeatureContext with workspace access, sync hooks, and diagnostic/status
publication helpers.
Install
npm install @mindcraft-lang/bridge-appLicense
MIT
