* feat(managed): generate WPF's known BAML type and property IDs
BAML names WPF's own types, properties and strings by negative IDs. The
table is generated from KnownTypes.cs and Baml2006KnownTypes.cs at a
pinned dotnet/wpf commit, with the source digests recorded and the MIT
license preserved.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(managed): describe the BAML document report and its read budgets
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(managed): decode BAML record streams into their element tree
Read the BAML 0.96 records WPF's Baml2006Reader reads, without loading
any type: the element tree with names, keys and code-behind connection
IDs; property values with their converters, markup extensions and known
binary serializers; dictionary keys and their static resources from the
deferred key section; bindings and resource references. WPF's own types,
properties and strings are named from the generated known-type table.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(analysis): summarize retained BAML documents
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(managed): read BAML files through an identity-checked provider
The provider reads one bounded regular file and decodes it; a refusal at
max_records, max_elements or max_file_bytes names the budget to raise.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(managed): add the inspect_baml tool
CLI inspect-baml and MCP inspect_baml decode a WPF BAML document, such as
a view extracted from <Assembly>.g.resources, without loading WPF or the
document's assemblies. Large reports return the retained summary within
the agent budget.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(artifacts): point .NET resource sets with BAML views at inspect_baml
A resource set now proposes extraction, and inspect_baml when it holds
.baml members.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* docs(managed): describe WPF BAML document inspection
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* docs(skill): route extracted BAML views to inspect_baml
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* ci: scope the BAML reader with the managed formats
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* build: expose the BAML provider and its identity as dotnet entry files
Composition constructs the provider and the capability declarations name
its identity, as they do for the managed static provider.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* refactor(managed): fold BAML coverage through the coverage accumulator
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* refactor(managed): refuse oversized BAML files through the shared parse-limit owner
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* chore(schemas): record the advertised inspect_baml catalog summary
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* build: fetch the pinned WPF sources for the BAML known-type table
The generator now downloads KnownTypes.cs and Baml2006KnownTypes.cs at the
pinned dotnet/wpf commit and checks their recorded digests, instead of
reading a caller-supplied checkout, and runs as
npm run generate:wpf-baml-known-types. The regenerated table is unchanged.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* test(managed): cover inspect-baml through the CLI and declare its conformance case
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(artifacts): recognise BAML documents and route them to inspect_baml
A file that starts with the MSBAML FormatVersion header is a standalone
baml artifact; inspect_artifact proposes inspect_baml for it, as it does
for other formats a dedicated tool reads.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(managed): add a max_text_bytes budget for reported BAML text
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(managed): bound BAML expansion and validate its nesting and dictionaries
- Every reported copy of a declared name counts against max_text_bytes,
so repeated references to one long name cannot expand without bound.
- The nearest open element is kept on its own stack, and a property or
constructor scope must open directly inside an element.
- Deferred content must fit its document and enclosing section; each
dictionary key's value position must start a value element.
- Bindings inside MultiBinding or PriorityBinding report the container's
target property.
- A test names WPF's known IDs by the literal numbers of the pinned source.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* docs(managed): describe BAML recognition and the text budget
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* chore(schemas): record the inspect_baml max_text_bytes input
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(managed): inherit BAML binding targets instead of walking ancestors
Each element records the binding target it inherits, so a binding inside
nested MultiBinding or PriorityBinding containers resolves its target in
constant time. TemplateBinding and resource-extension elements now also
charge their reported copies against max_text_bytes.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(managed): count declared BAML type and assembly names against the text budget
Every declared type reports its assembly's name, so many types can repeat
one long assembly name; those copies now count against max_text_bytes too.
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
---------
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>