(core) Improving custom widget integration from the assistant and MCP server
Summary:
- Widgets can now declare their columns in the manifest, not only in grist.ready(). What
grist.ready() sends still wins if both are set.
- This lets the server know what a widget needs before the widget runs. Old widgets keep working
as before.
- Removed the copy of the column list that the plugin API kept in memory. It read stale data once
columns could come from the manifest.
- mapColumnNames() no longer returns null when a required column is not mapped. It now returns the
record without that field. The `columns` option is gone from mapColumnNames() and
mapColumnNamesBack().
- Added two tools: get_custom_widget_settings and set_custom_widget_settings. They read and write
a widget's access level and column mapping.
- The tools check the values: the access level must be a real one, a mapped column must have the
type the widget asked for, and a column that allows several values needs a list. This is the same
rule the creator panel uses.
- Added two more tools: get_custom_widget_options and set_custom_widget_options. They read and
write the widget's own options. A set merges, so one key can change without dropping the rest;
pass null to clear everything.
Smaller fixes:
- Help docs said to write `Ref:Table` as a column type. The correct form is type `Ref` plus
reference_table_id.
- Doc-scoped tools lost `additionalProperties`, so a misspelled key passed validation and only
showed as "missing doc_id".
- Better doc_id errors: missing, malformed, or wrong parameter name.
- Write tools returned a bare `null`. They now return {ok: true}.
- grist_create_table takes skip_page, and reports the page it creates.
- Tool hints: page_id null always makes a new page; widget linking is not the same as Reference
columns; a custom widget needs settings after you add it.
- Raised the assistant tool call limit from 10 to 20. Building a page needs about 14 steps and used
to stop half way.
Bot assistant work
Test Plan: Updated and added new
Reviewers: paulfitz
Reviewed By: paulfitz
Differential Revision: https://phab.getgrist.com/D5027 J
Jarosław Sadziński committed
dadcb24771a762e2e1918fad12f137f716a69878
Parent: 3d57aa6