Docs Join alpha
Build

Reactive loop

Your home agent reacts to Sprout-pushed events: approve a screen-time request by rule, defer the ambiguous ones to the parent through a skill. Push twin of Autonomous loop.

What you'll build

Sprout pushes an event to your home agent. Your agent decides what to do based on rules you set, then acts: approve a screen-time request that fits the kid's plan, reject one that doesn't, defer to the parent through a skill when the call isn't clear-cut.

This is the push twin of Autonomous loop. Autonomous fires on your agent's clock; Reactive fires on Sprout's events. Same shape (read, decide, act), different trigger.

Pieces you'll combine

Build it

Four movements:

1. Subscribe to a channel. Pick the resource URI that matches the event you want to react to.

Shell
resources/subscribe sprout://child/{kidId}/screentime/requests
# Open SSE stream; events arrive whenever the kid requests screen time.
# See /docs/reference/subscriptions for the full channel list.

2. On each event, evaluate. Your agent's rules: kid's earned gems, today's plan, time of day, what's still on the schedule. Make the decision local; don't round-trip a model call for every event if you don't have to.

3a. Act directly if the call is clear.

Shell
// Auto-approve a 15-min request when the kid still has budget.
screentime.review_request({
requestId: "<event.requestId>",
approve: true,
note: "auto-approved: within today's budget"
})

3b. Defer to the parent if it's ambiguous. Wrap the question in a skill so the parent sees it in the family inbox and decides in-app.

Shell
skill.invoke({
skillId: "<parent-decision-skill>",
input: {
question: "Alex is asking for 30 more minutes after dinner. Budget is at 80%. Approve?",
options: ["Approve", "Approve 15min only", "Reject"],
callbackTool: "screentime.review_request",
callbackArgs: { requestId: "<event.requestId>" }
}
})
# The skill posts a card via skill.post_result; the parent taps in-app.
# Sprout's in-app agent calls the callback tool with the parent's choice.

4. Keep the loop open. SSE streams stay open; your agent stays subscribed. Reconnect on drop. Idempotency keys on action calls protect against duplicate events.

When to use it

Tools touched

Recommended skills

No skills in the catalog pair with this pattern yet. Browse the catalog.

Roadmap

Seen in walkthroughs

Not yet. A "screentime auto-approver" walkthrough is on the list.

Was this page helpful?