Commit 1ba0abe
authored
flet-mcp: token-efficient get_api, ranked icon search, agent tool fixes (#6654)
* flet-mcp: token-efficient, correct get_api + Google-metadata icon search
get_api:
- default response is compact signature-style text (~44% smaller than
JSON, tokenizes better); format="json" escape hatch
- member docstrings trimmed to first sentence; member=<name> drill-down
returns full docs; query=<substring> filters members, walking base
classes (TextField border props live on FormFieldControl)
- event handler types unwrapped (Optional[EventHandler[TapEvent[...]]]
-> on_tap(TapEvent)); Optional[X] -> X?; field(...) defaults unwrapped
- "fields" member section (dataclass types, event payloads) now included
- name collisions resolved by ranked candidates instead of last-wins:
Text/Image/Rect no longer shadowed by canvas shapes; dotted names
(canvas.Text, flet_map.Camera) select alternates; response notes them
- Sphinx :attr:/:class: roles stripped from all rendered docstrings
get_example pages large examples per file; get_doc capped with a
narrowing hint; search_enum_members ranked (exact/prefix/substring)
with Material style variants collapsed.
Icon search rebuilt on Google's fonts.google.com icon metadata (tags +
popularity, Apache-2.0), committed as data/icons.json and refreshed via
`python -m flet_mcp.build.icons`; hand-curated icons.yml and the pyyaml
dependency removed. IconStore no longer imports the flet package
(find_icon was broken on runtime-only installs) and ranks by
tags/popularity with golden-query regression tests.
* Inject web-only app.zip assets in flet build instead of Jinja-in-comments pubspec
The build template's pubspec.yaml guarded the web-only `assets:` section
(app/app.zip, app/app.zip.hash) with Jinja tags hidden in YAML comments.
Any tooling that round-trips the file with a YAML parser — like the CI
release patch script — strips comments, making the assets unconditional
and failing native builds on the missing app/app.zip.
Move the conditionality into flet build: the template pubspec is now
plain YAML, and build_base.py injects flutter.assets into the rendered
pubspec when config_platform is "web", in the same post-cookiecutter
patching pass as the local-dev and test-mode overrides. Native platforms
get no assets entry, as before — serious_python places the app inside
the bundle.
Also remove the vestigial flet_geolocator Jinja block: its dependencies
were themselves commented out, so it could never take effect.
* Drop __init__.py from flet-mcp tests
A second top-level `tests` package collides with packages/flet/tests
under pytest's prepend import mode — whichever imports first owns
`tests` in sys.modules and the other's modules fail collection. Without
the __init__.py, pytest names the modules by file (unique basenames),
which is what `pytest packages/*/tests` in CI needs.1 parent 401182b commit 1ba0abe
15 files changed
Lines changed: 85966 additions & 2237 deletions
File tree
- sdk/python
- packages
- flet-cli/src/flet_cli/commands
- flet-mcp
- src/flet_mcp
- build
- data
- tests
- templates/build/{{cookiecutter.out_dir}}
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1589 | 1589 | | |
1590 | 1590 | | |
1591 | 1591 | | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1592 | 1603 | | |
1593 | 1604 | | |
1594 | 1605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
0 commit comments