@devflow-tools/provider-runtime
v0.18.36
Published
Bounded execution boundary for optional semantic and retrieval providers.
Readme
@devflow-tools/provider-runtime
Shared execution boundary for optional semantic, Memory, Knowledge, embedding, and reranking providers.
Install
npm install @devflow-tools/provider-runtimeThe runtime preserves ready, empty_valid, invalid, unavailable, timeout, and cancelled as distinct outcomes. It applies bounded timeouts, abort propagation, reentrancy protection, cooldown after provider failures, validation before receipt finalization, and privacy-safe execution receipts.
This package owns no task semantics, lifecycle transitions, retrieval eligibility, action authorization, persistence, or terminal decisions. Providers return untrusted values; the owning domain validates and compiles them.
import { ProviderExecutionEnvelope } from '@devflow-tools/provider-runtime';
const envelope = new ProviderExecutionEnvelope();
const result = await envelope.run({
requestHash: 'sha256:request',
providerId: 'host-sampling',
providerVersion: '1',
capability: 'semantic_claims',
scopeKey: 'project/session/turn',
timeoutMs: 3_000,
execute: async signal => {
const proposals = await provider.sample(signal);
return {
status: proposals.length > 0 ? 'ready' : 'empty_valid',
value: proposals,
proposalCount: proposals.length,
};
},
});