Documentation
¶
Overview ¶
Package scriptcallsite names where in a managed script a host call was made (#1907), so a run's calls can be drawn on the card of the Flow diagram (#1906) that makes them.
A call site is the source position of every call on the script's stack when the call was made, outermost first, each written "line:col" at the call's opening parenthesis: the top-level call of main() and every function call on the way down to the platform.* call itself. That is what the Starlark thread reports (Thread.CallStack) and what the flow graph records on each card, so the two meet on equality: a helper called from two places is two call sites and two cards.
It travels three ways. Inside a run it rides the call's context (With, From). Across the in-process MCP session to the server it rides the request's _meta under MetaKey, which the audit middleware records on the call's audit row. And a failed run's backtrace names the site it failed at (FromBacktrace).
Index ¶
Constants ¶
const MetaKey = "mcp-data-platform/call_site"
MetaKey is the _meta key a script's tool call carries its call site under.
Variables ¶
This section is empty.
Functions ¶
func FromBacktrace ¶
FromBacktrace is the call site a failed run's backtrace names: the script frames it lists, outermost first. The last is the call the run failed in.
func FromMeta ¶
FromMeta reads a call site from a request's _meta, or nil when it carries none or carries something that is not one.
func Of ¶
Of is the call site of the call being made on thread: the positions of the script's frames, outermost first, leaving out the builtin being called. A builtin's frame has no position, which is how it is told from the script's; the script's own frames carry whatever name the script runs under.
Types ¶
This section is empty.