local-agent-runtime
v0.1.1
Published
Run registered structured-output skills through local Codex and Claude Code CLIs.
Readme
local-agent-runtime
Server-side runtime for executing registered, structured-output skills through local Codex and Claude Code CLIs.
The browser never supplies commands, arguments, working directories, schemas, or tool permissions. Products register trusted skills on the server and submit only skillId, engine, and validated input.
Usage
import { CodexAdapter, LocalAgentRuntime } from 'local-agent-runtime'
const runtime = new LocalAgentRuntime({
cwd: process.cwd(),
adapters: [new CodexAdapter()],
})
runtime.registry.register({
id: 'example/summarize',
version: '1.0.0',
inputSchema: {
type: 'object',
required: ['text'],
properties: { text: { type: 'string' } },
},
outputSchema: {
type: 'object',
required: ['summary'],
properties: { summary: { type: 'string' } },
},
policy: {
timeoutMs: 15 * 60_000,
maxOutputBytes: 2_000_000,
network: 'none',
filesystem: 'none',
},
buildPrompt: ({ text }) => `Summarize: ${text}`,
normalize: (raw) => raw,
})
const result = await runtime.run({
engine: 'codex',
skillId: 'example/[email protected]',
input: { text: '...' },
})AgentJobManager provides in-memory start/get/cancel lifecycle support for products that expose asynchronous HTTP jobs. FakeAgentAdapter is exported from local-agent-runtime/testing for unit tests.
Security defaults
- Child processes use
shell: falseand fixed argument arrays. - Skills own schemas, model capabilities and time/output limits.
- Only a small authentication/runtime environment allowlist is inherited.
- Codex runs with a read-only sandbox; Claude tools are explicitly restricted by skill policy.
- User input cannot set executable paths, CLI arguments, cwd or environment variables.
