pub struct ScriptBinding {
pub path: PathBuf,
pub point: String,
pub entry: String,
pub timeout_ms: Option<u64>,
pub calls_per_turn: Option<u32>,
}Expand description
One script, bound to one extension point.
"scripts": [
{ "path": ".agix/scripts/prompt.js", "point": "prompt.assemble", "entry": "onAssemble" }
]The point is a catalog id — see base::interface::catalog and
docs/extension_points.md. A binding naming a point the engine does not
have, or one scripts may not use, is refused at startup with a message
saying which; it is not silently ignored, because a script that quietly
never runs is worse than one that fails to load.
Authority follows the file’s location, not the configuration: a script inside the project is the operator’s own and may rewrite anything, while one that arrived with a plugin may add. Nothing in this struct can change that, which is deliberate — it would otherwise be a field a plugin could set for itself.
Fields§
§path: PathBufPath to the script, relative to the project root or absolute.
point: StringWhich extension point, by its catalog id.
entry: StringThe function the script exports.
timeout_ms: Option<u64>Wall clock for one call. Defaults to the carrier’s own budget.
calls_per_turn: Option<u32>How many times it may run in a turn. Defaults to the carrier’s.
Trait Implementations§
Source§impl Clone for ScriptBinding
impl Clone for ScriptBinding
Source§impl Debug for ScriptBinding
impl Debug for ScriptBinding
Source§impl<'de> Deserialize<'de> for ScriptBinding
impl<'de> Deserialize<'de> for ScriptBinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ScriptBinding
impl JsonSchema for ScriptBinding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more