tft: MCP tool build_tft, skill note, sample generator, notes for the next types

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Fable 5.2 committed 2026-11-16 18:25:18 +01:00
1 parent 99a5240af0
commit 0532a59120
7 files changed
+1194 -1

No files matched your search

+16
View File
@@ -158,6 +158,17 @@ def t_add_picture(path, image_path, quality=100):
return {"picture_id": pid}
def t_build_tft(path, tft_path, editor_dir=None):
from . import tft_build
try:
out = tft_build.build_tft(_load(path), editor_dir or tft_build.DEFAULT_EDITOR_DIR)
except tft_build.Unsupported as e:
raise ValueError("cannot compile this project yet: %s" % e)
with open(tft_path, "wb") as f:
f.write(out)
return {"tft": tft_path, "bytes": len(out)}
def t_add_font(path, height, ttf_path=None, encoding="ascii", chars=None):
from . import fonts
h = _load(path)
@@ -248,6 +259,11 @@ TOOLS = {
"(then give chars, and a ttf_path that has those characters; the project's encoding "
"should match).",
{"path": S, "height": {"type": "integer"}, "ttf_path": S, "encoding": S, "chars": S}, ["path", "height"]),
"build_tft": (t_build_tft, "Compile the project to a .tft firmware file. Research stage: model NX4832T035 only; "
"pages, hotspots, int variables, timers, pictures, fonts and plain script; anything else is "
"refused with the reason. Needs a Nextion Editor installation (editor_dir) for the firmware "
"files. The output has never been tried on a real display.",
{"path": S, "tft_path": S, "editor_dir": S}, ["path", "tft_path"]),
"verify": (t_verify, "Check every checksum in the project.", {"path": S}, ["path"]),
"list_kinds": (t_kinds, "Component kinds that can be added.", {}, []),
"schema": (t_schema, "Attributes of a component kind: names, types, defaults, allowed values.", {"kind": S}, ["kind"]),