@projectpac/prompting
v0.6.0
Published
Part of PAC: @projectpac/prompting.
Readme
@projectpac/prompting
How a flow talks to its model through a run, once the kernel stopped doing it for everyone. Functions, not a plugin: nothing here is installed or injected.
The kernel stores a run's payload and hands a turn's output back verbatim; it
composes no prompt and parses no answer. Every flow that asks its model for
JSON to a schema still needs the same four things, and they used to live in
core/intelligence. They live here now, once, so the router, the negotiation
rounds, and the history profiler do not carry three copies.
composePromptputs a flow's instructions, the context it selected, and the shape of the answer into one prompt. The context is delimited and labelled as data, and the delimiters are refused in the caller's text rather than escaped, because escaping would leave the model to interpret the escape.extractOutputandvalidateOutputread the one<pac-output>block out of what the model said and hold its JSON to the schema.readOutputis both.composeCorrectionis the one more turn a flow may spend on an answer that did not fit: what was wrong, and the contract again, with anything quoted from the failure neutralized so it cannot close a block of its own.interpretis the rule the flows share for a settled turn: an executor failure is a failure, a usable answer is the answer, an unusable one gets exactly one correction, and a second unusable one is the run's answer.
