stop-runtime
v0.1.0
Published
STOP Protocol runtime — manifest loader, assertion runner, trace emitter
Maintainers
Readme
@stop-protocol/runtime
Runtime SDK for STOP — Skill Transparency & Observability Protocol.
Install
npm install @stop-protocol/runtimeUsage
import { loadManifest, runAssertions, createTracer } from '@stop-protocol/runtime';
// Load manifest
const manifest = loadManifest('./skill.yaml');
// Run pre-checks
const preResults = runAssertions(manifest.assertions.pre, {
env: process.env,
tools: ['exec', 'read'],
}, 'pre');
// Create tracer (L1+)
const tracer = createTracer(manifest);
const spanId = tracer.startSpan('tool.call', 'exec: python3 publish.py');
// ... do work ...
tracer.endSpan(spanId, 'ok');
// Run post-checks
const postResults = runAssertions(manifest.assertions.post, {
outputs: { article_url: 'https://juejin.cn/post/123' },
}, 'post');
// Finish and write trace
tracer.finish('ok');
tracer.writeTo(); // writes to .sop/traces/API
loadManifest(path)— Parse a skill.yaml fileparseManifest(yamlStr)— Parse YAML stringrunAssertions(rules, context, phase)— Run pre/post assertionscreateTracer(manifest)— Create a trace emitter
License
MIT
