scriptedModel replays responses you write in the source. It demonstrates the runtime. It is not AI inference. The same createRuntime, defineTool, and agent.start calls are what a Cactus agent uses later.
1
Open a runtime
sqlite() with no path stores larkx.db in the application documents directory.2
Define one local tool and a scripted agent
The tool is
pure, so an interrupted attempt may run again. The model asks for read_notes, then returns one sentence.3
Start the run and read the result
Expected output
result.message is "Seal needs service." and result.finish is "stop".
agent.start stores the run and starts its driver. run.result() waits for that driver. It does not start a second one. close() waits for in-flight steps and releases ownership. Do not call close() from an engine hook, and do not use that same runtime object after it resolves.