(ctx)
| 2008 | // instead of as "declined by the user", which nobody did. |
| 2009 | let unanswerable: ElicitationRequest | undefined; |
| 2010 | const onElicitation: ElicitationHandler = (ctx) => { |
| 2011 | // Every invoke is advertised as destructive, so the client's native |
| 2012 | // approval covers the selected ID and arguments, even if policy changed. |
| 2013 | // Tool-raised prompts still require their own response below. |
| 2014 | if (ctx.source === "policy") { |
| 2015 | return Effect.succeed({ action: "accept" as const, content: {} }); |
| 2016 | } |
| 2017 | // Anything the tool itself asked for goes to the client natively |
| 2018 | // when it can take it; the native bridge already turns a URL |
| 2019 | // request into a form for form-only clients. |
| 2020 | if (supportsForm || (supportsUrl && Predicate.isTagged(ctx.request, "UrlElicitation"))) { |
| 2021 | return native(ctx); |
| 2022 | } |
| 2023 | unanswerable = ctx.request; |
| 2024 | return Effect.succeed({ action: "decline" as const }); |
| 2025 | }; |
| 2026 | const outcome = yield* engine.execute(passthroughCallCode(address, args), { |
| 2027 | onElicitation, |
| 2028 | }); |
no outgoing calls