Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.
domain = "input_semantics_scaffold"
description = "SCAFFOLD_bundle_desc: the cases a descriptor-driven inputs-template projection must get right and the engine's own renderer does not — every authored fact carries a SCAFFOLD_ sentinel so its survival is greppable in every capture"
main_pipe = "scaffold_nesting"
# A structure whose text fields are merely NAMED like URLs. The engine picks a placeholder by
# field name, so it renders these as `https://mock.invalid/<name>` even though the descriptor
# states `kind = "text"` at every one of them. That name heuristic is what misclassified a text
# field as a file position; the projection reads the kind instead.
[concept.Bookmark]
description = "SCAFFOLD_desc_concept_Bookmark: a shelf reference whose text fields are named like links"
[concept.Bookmark.structure]
url = { type = "text", description = "SCAFFOLD_desc_field_url: a required text field merely NAMED url", required = true }
homepage_url = { type = "text", description = "SCAFFOLD_desc_field_homepage_url: an optional text field whose name ENDS in _url" }
label = { type = "text", description = "SCAFFOLD_desc_field_label: ordinary required text beside them", required = true }
shelf_note = { type = "text", description = "SCAFFOLD_desc_field_shelf_note: ordinary optional text beside them" }
# A structure carrying file fields on both sides of the required/optional line. The engine applies
# its optional filter only at the top level of an input's own structure class, so `cover` and
# `attachment` vanish from the template it renders while a nested structure's optional fields survive.
[concept.Dossier]
description = "SCAFFOLD_desc_concept_Dossier: an archive folder holding required and optional attachments"
[concept.Dossier.structure]
title = { type = "text", description = "SCAFFOLD_desc_field_title: required text heading the folder", required = true }
stamp = { type = "concept", concept_ref = "native.Image", description = "SCAFFOLD_desc_field_stamp: a REQUIRED nested image", required = true }
cover = { type = "concept", concept_ref = "native.Image", description = "SCAFFOLD_desc_field_cover: an OPTIONAL nested image" }
attachment = { type = "concept", concept_ref = "native.Document", description = "SCAFFOLD_desc_field_attachment: an OPTIONAL nested document" }
bookmark = { type = "concept", concept_ref = "Bookmark", description = "SCAFFOLD_desc_field_bookmark: the url-named fields one level deeper" }
[pipe.scaffold_nesting]
type = "PipeLLM"
description = "SCAFFOLD_pipe_scaffold_nesting: url-named text fields and optional nested file fields, at two depths"
inputs = { bookmark = "Bookmark", dossier = "Dossier" }
output = "Text"
prompt = """
Consider the bookmark:
@bookmark
And the dossier:
@dossier
"""
[pipe.scaffold_fixed_batch]
type = "PipeLLM"
description = "SCAFFOLD_pipe_scaffold_fixed_batch: a fixed-count list of a structure carrying optional file fields, beside a variable one"
inputs = { dossiers = "Dossier[2]", bookmarks = "Bookmark[]" }
output = "Text"
prompt = """
Exactly two dossiers:
@dossiers
Any number of bookmarks:
@bookmarks
"""
# The natives whose payload shape the descriptor states openly, at slot positions — the one place
# the corpus never reached. `native.Dynamic`, `native.Composite` and `native.Anything` declare no
# pinned structure, so their node is `unknown`, every projection renders the empty object both
# renderers agree on, and the input shaper takes that object back at each of them. `native.JSON` is
# not: its pinned blueprint carries a required `json_obj`, so its explicit template expands like any
# other pinned native's, while its compact template is the bare object with `json_obj` unwrapped.
# That dict is the corpus's first REQUIRED unknown node — the engine invents a sample key there, the
# projection leaves the object empty for whoever fills it in — and the only site where the corpus
# measures `unknown-empty-object`, the class whose whole claim is that the empty object round-trips.
[pipe.scaffold_open_natives]
type = "PipeCompose"
description = "SCAFFOLD_pipe_scaffold_open_natives: a pinned-dict native beside the three structureless ones, each at a slot position"
inputs = { json_in = "JSON", dynamic_in = "Dynamic", composite_in = "Composite", anything_in = "Anything" }
output = "Text"
template = "SCAFFOLD_template_open_natives: $json_in $dynamic_in $composite_in $anything_in"
# A `native.Dynamic` slot read by a PipeLLM prompt, under both markers. Until the prompt analyzers
# stopped reading universal compatibility as identity, this bundle did not validate at all: a dynamic
# input was recorded as a DIRECT image reference and dry-run validation demanded `ImageContent`. It
# renders as text through the prompt like any other variable, which is what makes it a slot the
# corpus can carry — the descriptor states it `unknown` exactly as the PipeCompose above does, so the
# capture holds one open-shaped native at an LLM prompt position beside the same native at a
# template position.
[pipe.scaffold_dynamic_prompt]
type = "PipeLLM"
description = "SCAFFOLD_pipe_scaffold_dynamic_prompt: a structureless native read by an LLM prompt under both markers"
inputs = { dynamic_prompted = "Dynamic", bookmark = "Bookmark" }
output = "Text"
prompt = """
SCAFFOLD_prompt_dynamic_marker_at:
@dynamic_prompted
SCAFFOLD_prompt_dynamic_marker_dollar: $dynamic_prompted
And the bookmark beside it:
@bookmark
"""
# The verdict natives at slot positions. `native.YesNo` is a `boolean` where a caller supplies it,
# so its compact template is the bare verdict; `native.Choice` and `native.Rating` carry optional
# measures beside their verdict, so the descriptor states them as objects and every projection
# keeps their `{concept, content}` envelope, which is the only form the input shaper takes back.
[pipe.scaffold_verdict_natives]
type = "PipeCompose"
description = "SCAFFOLD_pipe_scaffold_verdict_natives: the verdict natives, each at a slot position"
inputs = { approved_in = "YesNo", team_in = "Choice", grade_in = "Rating" }
output = "Text"
template = "SCAFFOLD_template_verdict_natives: $approved_in $team_in $grade_in"