Documentation
¶
Overview ¶
Package exportrefs is platform.export's references= argument (#1834): what it may hold, the manage_asset call that declares it on the asset an export wrote, and the reading of a document, and of a script's source, for the references nothing declares.
A document a script publishes names a managed resource or another asset by its reference, and the viewing surfaces rewrite a reference into a working URL only when the asset declares it. The declaration is made through manage_asset rather than here, so the author-can-read check and the grant notice are the ones an agent's save gets. It is its own package, as internal/platform/exporttable is, for scriptrun's size budget.
Index ¶
Constants ¶
const ( Tool = "manage_asset" Call = Tool + " action=update" )
Tool is the tool a declaration is made through, the one an agent declares an asset's references with, and Call is how the write reads in a draft's list.
const Keyword = "references"
Keyword is the platform.export argument a declaration is passed as.
Variables ¶
var ErrNotADocument = errors.New("references are declared on a portal document, the output of a string body " +
"written to \"portal\"; this output has no markup to reference anything from")
ErrNotADocument refuses a declaration on an output that has no markup to reference anything from: a bucket object or a library file has no references to record, and a tabular output is serialized by the platform.
Functions ¶
Types ¶
type Literal ¶
Literal is one reference string a script's source writes that no export declares, and the line it is written on.
func InSource ¶
InSource returns each reference string the source writes as a literal that no platform.export declares in references=, once, at its first line. exportMember and callMember are the platform module's export and call members.
The string is read wherever it is written, because the usual shape assigns it to a name first (LOGO = "mcp://...") and formats it into the markup later, where no static read can follow it. A literal is not proof the string reaches a document, so three readings return nothing rather than guess. A script with no export writes no document, so a URI in it is handed to a tool. An export whose references= is computed declares a list this read cannot see; a name bound once to a string literal is read as that string. And a literal inside a platform.call is an argument to that tool, not markup, and is not read.