Repository navigation
sercon v0.5.27
Adds api.ai — run one-shot prompts through a coding-assistant
CLI (claude / codex / copilot / gemini). os/exec (stdlib), no new
dependency.
Added
api.ai.providers()lists detected CLIs on PATH (preference
order);api.ai.send(opts)runs a prompt through one.opts:
{ prompt (required), provider?, system?, context?, timeout? }.
system/contextare prepended (portable across CLIs with
different flags). Returns{ provider, output, exitCode };
non-zero exit is data, missing provider + deadline throw.- Chose the options-object shape over the rhai-style builder chain
— the idiomatic JS equivalent, and it avoids threading a mutable
builder handle through goja. buildAIArgvis a pure function (unit-testable without the CLIs).
6 tests: argv builder per provider, prompt composition,
send via a fake on-PATH provider script, no-provider throws,
missing-prompt throws, provider detection.examples/scripts/ai.tsgracefully degrades without a provider
(in the CI offline subset); MANUAL §5 ts block + prose.
Changed
OUT-OF-SCOPE.md'sai::requestentry resolved. The Moderate
bucket is now empty — every binding-side and protocol item has
shipped; only the library-internal items (PathResolver, robust
import parsing, watch module-graph) remain.