mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-03 23:11:00 +02:00
Squashed 'ai-context/trustgraph-templates/' content from commit 42a5fd1b
git-subtree-dir: ai-context/trustgraph-templates git-subtree-split: 42a5fd1b678f32be378062e30451e2052ccb95dd
This commit is contained in:
commit
74cc8a4685
1216 changed files with 116347 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
// Interface Builder Module
|
||||
// Processes flow class interfaces with parameter substitution
|
||||
// Handles both string interfaces and nested object interfaces
|
||||
|
||||
local param_processor = import "parameter-processor.jsonnet";
|
||||
|
||||
{
|
||||
// Builds interfaces for a specific flow class and instance
|
||||
// Processes the 'interfaces' section of flow classes
|
||||
build_interfaces: function(flow_classes, class_name, flow_id, parameters)
|
||||
local interface_spec = flow_classes[class_name].interfaces;
|
||||
{
|
||||
[interface.key]:
|
||||
if std.isString(interface.value) then
|
||||
// Simple string interface - apply all substitutions
|
||||
local class_replaced = std.strReplace(interface.value, "{class}", class_name);
|
||||
local id_replaced = std.strReplace(class_replaced, "{id}", flow_id);
|
||||
param_processor.substitute_parameters(id_replaced, parameters)
|
||||
else
|
||||
// Complex object interface - process nested fields
|
||||
{
|
||||
[field.key]:
|
||||
local class_replaced = std.strReplace(field.value, "{class}", class_name);
|
||||
local id_replaced = std.strReplace(class_replaced, "{id}", flow_id);
|
||||
param_processor.substitute_parameters(id_replaced, parameters)
|
||||
for field in std.objectKeysValuesAll(interface.value)
|
||||
}
|
||||
for interface in std.objectKeysValuesAll(interface_spec)
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue