Calculate what matters.
Express pricing, discounts, tax, and operational metrics as named Functions. Declare their inputs and result types so consumers know exactly what they receive.
Define typed queries and computations over your business data. Reuse their results in applications, workflows, and agents.
Adjust the terms of a quote and follow the calculation from inputs to its typed result.
20% sample tax. Amounts are calculated in integer cents; discount and tax round to the nearest cent.
Calculated total, including tax.
Express pricing, discounts, tax, and operational metrics as named Functions. Declare their inputs and result types so consumers know exactly what they receive.
Check whether evidence is complete or a request has reached a terminal state. Reuse the result in an application, a Workflow, or declared Action preparation.
Combine governed queries, bounded product code, model calls, and admitted external reads. The Function contract describes its dependencies and execution limits.
A calculated quote or extracted document is a result. Accepting it is a separate Action, where current business conditions and proposed effects are checked.
An exact excerpt from the repository, with the complete source file available to inspect and download.
async function acceptCurrentQuote() { if (local === null || isAcceptanceInFlight.current) return; isAcceptanceInFlight.current = true; setIsAccepting(true); const revision = inputRevision.current; const input = { request_id: requestId, unit_price_minor: BigInt(unitPrice), units: BigInt(units), discount_bps: BigInt(discount), tax_bps: BigInt(tax), }; try { setOperationError(null); const plan = await acceptBookingQuote.plan(client, input, { targetKey: requestId }); if (inputRevision.current !== revision) return; await acceptBookingQuote.execute(client, plan, { planHash: plan.hash }); if (inputRevision.current !== revision) return; setAccepted(true); } catch (cause) { if (inputRevision.current !== revision) return;Model-backed Functions may be nondeterministic. A browser calculation is useful for feedback; it does not authorize a change. Acceptance still uses the authoritative Action path.
Read the capability referenceA business process, the systems it touches, and the rules it needs to follow.