feat(spec): llm() accepts optional instructions

This commit is contained in:
pj committed 2026-07-13 07:02:17 +05:30
1 parent 25ddf7d29e
commit 5fb01af59c
2 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ export type GeneratorNode =
| { kind: "weighted"; branches: ReadonlyArray<readonly [number, GeneratorNode]> }
| { kind: "actions"; generate: () => ActionDescriptor[] }
| { kind: "builtin"; verb: BuiltinVerb }
| { kind: "llm"; config: { model: string } };
| { kind: "llm"; config: { model: string; instructions?: string } };
// Candidate is one host-enumerated target for a builtin verb. The host
// resolves geometry (and a native selector) so no element handle crosses into
+4 -2
View File
@@ -38,9 +38,11 @@ export function actions(generator: () => Action[]): GeneratorNode {
// random candidate, Go drives an OpenAI-compatible model that chooses which
// candidate to act on from the screenshot + the candidate list. The returned
// marker is inert on the JS picker (pick.ts walks it to null); Go reads its
// config.model off globalThis.actions. API key comes from OPENROUTER_API_KEY
// config off globalThis.actions. API key comes from OPENROUTER_API_KEY
// (OpenRouter) or OPENAI_API_KEY (OpenAI); OpenRouter wins when both are set.
export function llm(config: { model: string }): GeneratorNode {
// Optional `instructions` are appended to the model's prompt as generic
// bug-hunting guidance for this spec; the model still only ranks candidates.
export function llm(config: { model: string; instructions?: string }): GeneratorNode {
return { kind: "llm", config };
}