<ExtractPrompt> is not an importable runtime export of smithers-orchestrator.
It ships as an example/pack composition pattern, a component you scaffold into your own
.smithers/components/extract-prompt/ (via init) and import relative to your workflow,
as shown below. Copy and adapt it; it is not available from the published package.
Three modes
- Passthrough:
prompt is provided and ≥ 32 chars. Emits a static-output
task with score: 1.0 and resolved: true. No agent invoked.
- Cache hit: caller resolved a
cached entry by key. Same passthrough behavior:
emits resolved: true, carries over the cached score, and prefixes scoreReason
with cached: .
- Extraction: wraps
<LoopUntilScored> around the drafter task. The drafter
uses the R-C-T-F backbone, picks one Socratic principle per turn, asks the user
via bun .smithers/scripts/ask-user.ts, self-scores, and sets resolved: true
when ready.
Cache I/O is the caller’s responsibility
The component is pure, with no side effects in JSX. Caller does cache getSync /
setSync from inside the smithers (ctx) => function. See the example above.
Drivers shipped:
MarkdownPromptCache (default): .smithers/cache/prompts/{slug}.md with YAML frontmatter
SqlitePromptCache: opt-in single-table store via bun:sqlite
MemoryPromptCache: for tests
Stakes
high → threshold 1.0 (every R-C-T-F slot must be strongly filled)
low → threshold 0.7
Override via the threshold prop. Stakes is for callers who don’t want to
remember exact numbers.
Override semantics
The human always has the final word. If the agent’s score is below threshold
and the human types “ship it” via the ask-user CLI, the agent sets:
resolved: true
overridden: true
overrideReason: "<verbatim>"
The cache records overridden: true for audit; the verbatim overrideReason is
available only on the live output, not in the cache.