Commit 1de165a
committed
feat(tdpilot_API): Tier 1+2 port — official docs + TD 2025 + introspect + memory advanced + validate (66→88 tools)
Adds 22 tools the CLI had exclusively. Standalone now covers ~85% of the
CLI surface. Schema cost: ~33% growth (~4KB) — almost entirely absorbed
by DeepSeek's auto-cache (~0.5% real per-turn cost increase).
New modules:
- tdpilot_api_official_docs.py — 8 tools routing through the existing
knowledge_search/knowledge_get BM25 with smart filters. Five Tier 1
lookups (search_official_docs, get_operator_doc, get_param_help,
lookup_snippets, lookup_palette_component) + three Tier 2 LLM-flavored
recommenders (recommend_official_component, find_official_example,
explain_better_way). Without the derivative corpus on disk, returns
structured hints rather than failing.
- tdpilot_api_td2025.py — 7 read-only TD-runtime probes:
python_env_status, threading_status, logger_status, tdresources_inspect,
color_pipeline, component_standardize (per-COMP standards audit),
audit_project (recursive subtree audit aggregating errors + warnings
+ standards-compliance issues, capped at max_depth).
- tdpilot_api_introspect.py — 3 server-side introspection tools:
get_server_metrics (uptime + RSS + CPU + thread count + runtime
counters via optional psutil), describe_surface (categorised tool
list, both built-in + user-pluggable), get_capabilities (feature
flags derived from module-import success).
Extensions to existing modules:
- tdpilot_api_memory.py: memory_export (full JSON dump), memory_import
(with overwrite=False default to preserve local edits), memory_favorite
(frontmatter flag + 0-5 rating).
- tdpilot_api_recipes.py: td_validate_recipe — pre-save sanity check
validating replay JSON shape + that every step's tool name is in the
live TOOL_TO_HANDLER (built-in or user-pluggable).
Wired into:
- tdpilot_api_extension.py — three new modules added to
_ensure_module_path + handler_modules list
- build_tdpilot_api_tox.py — three new entries in _SOURCE_FILES so the
rebuilt .tox bakes them as textDATs
- tdpilot_api_schema_defs.py — 22 new TOOL_SCHEMAS entries (input_schemas
with required fields + descriptions)
- tdpilot_api_schema_map.py — 22 new TOOL_TO_HANDLER mappings
Tests (49 new, 930 total — was 881):
- tests/test_tdpilot_api_official_docs.py — 18 tests with patched
knowledge_search/knowledge_get to verify the routing layer (filter
application, fallback paths, hint surfaces) without needing a real
corpus on disk.
- tests/test_tdpilot_api_td2025.py — 11 tests covering Python env +
threading probes (no TD needed) and the structured "outside TD" error
path for TD-specific probes.
- tests/test_tdpilot_api_introspect.py — 6 tests verifying uptime,
surface description, capability reporting work outside TD.
- tests/test_tdpilot_api_memory.py — 8 new tests for export/import/
favorite (export round-trip, import skip-vs-overwrite semantics,
favorite frontmatter writes, rating validation, missing-name error).
- tests/test_tdpilot_api_recipes.py — 6 new tests for td_validate_recipe
covering the happy path + every issue type (unknown tool, non-dict
step, missing tool field, non-dict args, non-list replay).
Docs updated:
- README.md: tools badge 66 → 88; comparison table; "what CLI exclusively
has" trimmed to the durable gap (15 tools); "now in BOTH" callout for
the ported categories.
- docs/MANUAL.md: tool surface 66→88, capability matrix re-categorized
(15 rows moved from CLI-only to BOTH; new memory-advanced row notes
partial coverage), tools table grows 13→16 categories with the new
ones listed.
Performance: all 22 new tools execute in single-digit milliseconds
(BM25 lookup, sys.* probe, or dict construction). No streaming, no
polling, no cook-thread blocking. handle_audit_project is the heaviest
(O(N) walk over project subtree) and is bounded by max_depth.
NOTE: tdpilot_API.tox needs rebuilding inside TouchDesigner before the
new tools are live. The .tox-source-hash gate only watches the dpsk4
.tox sources, so CI passes — but the standalone .tox loaded in TD won't
have the three new textDATs baked until rebuild. Use the standalone
build snippet from the README.1 parent 1d7a820 commit 1de165a
16 files changed
Lines changed: 2075 additions & 24 deletions
File tree
- docs
- td_component
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 179 | + | |
| 180 | + | |
185 | 181 | | |
186 | 182 | | |
187 | 183 | | |
188 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
189 | 187 | | |
190 | 188 | | |
191 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | | - | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
256 | 259 | | |
257 | 260 | | |
258 | 261 | | |
259 | | - | |
| 262 | + | |
260 | 263 | | |
261 | 264 | | |
262 | 265 | | |
| |||
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
276 | | - | |
277 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | 288 | | |
280 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
202 | 208 | | |
203 | 209 | | |
204 | 210 | | |
| |||
0 commit comments