Registry / web-framework / soclaw-middleware-anything

soclaw-middleware-anything

JSON →
library1.0.4jsnpmunverified

Gateway middleware node runtime v1.0.4 that embeds Express health endpoints and routes remote WebSocket commands to a local command-registry. Supports Node modules, Python/ESM subprocesses, and CLI-scripted execution. Manifest-driven command loading from built-in JSON, environment variables, or runtime API injection. Requires Node.js ≥18. Built with esbuild to produce dist/ entry points. Key differentiator: dynamic command injection without modifying the core package, via external manifest files, env vars, or programmatic applyManifestLayer. Includes a CLI binary for debugging/scripting. Uses cross-env for Windows compatibility. Release cadence: unknown, single published version.

npm install soclaw-middleware-anything
INSTALL
IMPORT
SIG · SOCLAW-MIDDLEWARE-
S
soclaw-middleware-anything
web-frameworkjavascriptv1.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import soclaw from 'soclaw-middleware-anything'
Package is CJS, named exports may not be available via ESM
GatewayClient
const { GatewayClient } = require('soclaw-middleware-anything')
import { GatewayClient } from 'soclaw-middleware-anything'
Package is CJS, named exports may not be available via ESM
bootstrapCommandRegistry
const { bootstrapCommandRegistry } = require('soclaw-middleware-anything/dist/command')
const { bootstrapCommandRegistry } = require('soclaw-middleware-anything')
Internal module, not exported from package root
applyManifestLayer
const { applyManifestLayer } = require('soclaw-middleware-anything/dist/command')
Internal module, not exported from package root

Initialize GatewayClient to connect to a WebSocket gateway, listen for messages, and handle commands.

const { GatewayClient } = require('soclaw-middleware-anything'); const client = new GatewayClient({ gateway: process.env.GATEWAY_URL ?? 'ws://localhost:8080', nodeId: process.env.NODE_ID ?? 'node-1' }); client.on('message', (msg) => { console.log('Received:', msg); }); client.connect();
soclaw-middleware-anything --version
Debug
Known issues
breakingInternal module paths: require('soclaw-middleware-anything/dist/...') required for submodules; package root exports only limited API
fix
Use correct paths like require('soclaw-middleware-anything/dist/command')
affects: >=1.0.0
gotchaBuild step required for development: npm run build must be run before first test or local link to generate dist/
fix
Run npm run build after cloning repository
affects: >=1.0.0
deprecatedopenMacApp field in manifest is deprecated and will be ignored with a warning; use modules instead
fix
Replace openMacApp with modules array in manifest JSON
affects: >=1.0.0
gotchaWindows subprocess support: .bat/.cmd files run as subprocess on Windows only; on non-Windows they are skipped with a warning
fix
Use cross-platform scripts (Python or Node) instead of .bat/.cmd
affects: >=1.0.0
gotchaDynamic require of command handlers fails if bundled; command index must be external in esbuild config
fix
Keep src/command/index.js as external in build script
affects: >=1.0.0
gotchaPath resolution in manifests: moduleRoot is relative to manifest file location, not CWD
fix
Place manifest files carefully or use absolute paths
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'soclaw-middleware-anything/dist/index.js'
dist/ not built (only when using from git clone)
fix
Run npm run build in the package directory
Error: Cannot find module './command/index'
Command index bundled incorrectly; runtime expects separate file
fix
Ensure esbuild external: ['./command/index'] or equivalent
Warning: 'openMacApp' field is deprecated, please use 'modules' instead
Manifest JSON uses deprecated openMacApp
fix
Replace openMacApp with modules array
SyntaxError: Unexpected token '.' (Windows path separator)
Node.js version <18 does not support certain syntax
fix
Upgrade Node.js to >=18
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
expressoptionalHTTP health check and service endpoints
wsoptionalWebSocket client (GatewayClient)
Agent activity
17 hits · last 30 days
node
15
OpenAI (training)
1
Resources
soclaw-middleware-anything — npm install soclaw-middleware-anything · libregistry