crivo-web / src /decisions /model-runtime.ts
dizyann's picture
feat: expose typed decide brick and terminal CLI
3f7a9b2
Raw History Blame Contribute Delete
511 Bytes
import type { DecideInput, Decision, DecisionResults } from './types.js'
/** A runtime owns the resources it allocates and releases them before settling. */
export interface DecisionRuntime {
decide(input: DecideInput): Promise<DecisionResults<readonly Decision[]>>
}
export class InputTooLongError extends Error {
constructor(
readonly tokens: number,
readonly limit: number,
readonly decisionId = ''
) {
super(`Decision needs ${tokens} tokens, exceeding the limit of ${limit}.`)
}
}