suppa-mcp-2 1.42.1 → 1.42.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -1023,7 +1023,9 @@ export function buildToolTable() {
1023
1023
  " Runs with the caller's read permissions; deleted rows are excluded. A missing LIMIT\n" +
1024
1024
  " is added and a bigger literal one clamped, so at most `limit` rows come back, with\n" +
1025
1025
  " `truncated` and `columns` — the result keys, nested ones as dot paths\n" +
1026
- " (owner.firstName), which is what sqlValueColumns[].key and table columns must use.",
1026
+ " (owner.firstName): a TABLE column's key. A CHART's sqlCategoryColumn and\n" +
1027
+ " sqlValueColumns[].key take the alias, else the last segment (firstName); a dot path\n" +
1028
+ " there matches nothing and the chart shows demo data.",
1027
1029
  inputSchema: {
1028
1030
  query: z
1029
1031
  .string()
@@ -1031,7 +1033,7 @@ export function buildToolTable() {
1031
1033
  bind_params_json: z
1032
1034
  .string()
1033
1035
  .optional()
1034
- .describe('JSON object of bind values for $name / $1 / = ANY($arr), e.g. {"owner": 479}. $current-user is set by the server.'),
1036
+ .describe('JSON object of bind values for $name / $1 / = ANY($arr), e.g. {"owner": 479}. $current-user is set by the server, but not in an FB2 widget; $now / $current_date never are (use NOW()).'),
1035
1037
  limit: z
1036
1038
  .number()
1037
1039
  .int()
@@ -183,7 +183,11 @@ export function prepareQuery(query, limit = QUERY_DEFAULT_LIMIT) {
183
183
  limitNote: `LIMIT ${raw} was clamped to ${cap}: this tool shows at most ${limit} rows (limit can go to ${QUERY_MAX_LIMIT}).`,
184
184
  };
185
185
  }
186
- /** The keys a SQL table column or `sqlValueColumns[].key` must use: nested objects as dot paths. */
186
+ /**
187
+ * The result keys, nested objects as dot paths — what a SQL TABLE column's key must use (FE
188
+ * sqlSourceColumns.ts keys a column by where its value sits). A CHART key is the alias or the
189
+ * path's last segment instead (FE suppaSql/analyzer.ts), which is not derived here.
190
+ */
187
191
  function resultColumns(row, prefix = "") {
188
192
  if (!row || typeof row !== "object" || Array.isArray(row))
189
193
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.42.1",
3
+ "version": "1.42.2",
4
4
  "description": "MCP server for the Suppa platform (modern.suppa.me) — Tasks, Docs/Pages, Entities & Schema, Forms, Automations, and file attachments, with multi-tenant Google auth. Node port of PyPI suppa-mcp.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -55,10 +55,10 @@ rules — plus your own reading of the warnings — are what stands between that
55
55
  **Every element needs an explicit `layout[bp]` for every key in `settings.breakpoints` — there
56
56
  is no fallback**: the form switches only to a breakpoint every element has, so one missing
57
57
  record turns that layout off for the whole form.
58
- 2. **`layout[bp].height` is a row span, and the only thing that makes an element taller.**
59
- `containerSettings.size.heightMode` (`auto` | `fixed` | `fill`) is scroll behaviour. `fill` on a
60
- table or a leaf field does not enlarge it; it makes it share leftover height with its siblings.
61
- Both keys are legal on the same element, so nothing can flag the mix-up.
58
+ 2. **Height is `containerSettings.size.height` (px, `heightMode: 'fixed'`); `layout[bp].height`
59
+ only places.** Grid rows are `min-content`: a longer span adds no pixels, a chart with no
60
+ height is 0px. `fill` shares leftover height with siblings, it does not grow. Both keys are
61
+ legal together, so nothing flags the mix-up.
62
62
  3. **A grid child spans its parent's columns, not the form's.** Inside a 12-column section, full
63
63
  width is `width: 12`; inside a 2-column container it is `width: 2`. **Column count defaults to
64
64
  1, and 1 is a real count, not an "unset" flag** — the root grid reads `settings.columnsNumber`,
@@ -5,9 +5,11 @@ draws is a CUSTOM chart (`chartType: 'custom'`: named sources + a widget) — `-
5
5
 
6
6
  ## Size it yourself — nothing else will
7
7
 
8
- `chart` is the only large widget with **no automatic full width and no minimum row span**. `table`, `cards`, `calendar`, `kanban`, `entityLinks` are force-widened to the row and floored at 6 rows; `chart` is deliberately excluded (a KPI tile is a 3-column cell and dashboards place charts 2-up). So `layout.lg.height: 1` ships as one row, widened only to the ~3-column minimum readable width. Write `height: 6`–`8` and a real `width` on every non-KPI chart.
8
+ `chart` has **no automatic full width**: `table`, `cards`, `calendar`, `kanban`, `entityLinks` are force-widened to the row; `chart` is deliberately excluded (a KPI tile is a 3-column cell and dashboards place charts 2-up). Write a real `width` on every chart.
9
9
 
10
- `containerSettings` is seeded **only while you leave it unwritten** — 400px for the canvas types, 140px + `widthMode: 'fill'` for `chartType: 'kpi'`. A `containerSettings.size` you author is kept verbatim and nothing re-sizes it, so a hand-written 400px KPI ships 2.9× the design height. On a KPI: omit the key, or write exactly `{ size: { widthMode: 'fill', heightMode: 'fixed', height: '140px' } }`. The px height is never converted into row span; the two are independent.
10
+ A chart's height is **`containerSettings.size.height` in px with `heightMode: 'fixed'`**, and nothing else. `layout.lg.height` only places it: grid rows are `min-content` (FE `canvasGridResolver.ts:62`), so a 6-row span adds no pixels, and `layout.lg.height: 1` is fine. With no size height the chart draws an auto-height canvas, which collapses to 0px (FE `ChartElementRuntime.ts:696`).
11
+
12
+ `containerSettings` is seeded **only by the builder** — a palette drop or its own AI draft (FE `materializeDraftSchema.ts`) — at 400px for the canvas types and 140px + `widthMode: 'fill'` for `chartType: 'kpi'`. Nothing seeds it for a form written through this server, so write it: `{ size: { heightMode: 'fixed', height: '320px' } }` or so on a canvas chart, and on a KPI exactly `{ size: { widthMode: 'fill', heightMode: 'fixed', height: '140px' } }` (an unwritten KPI is as tall as its content). A `containerSettings.size` you author is kept verbatim and nothing re-sizes it, so a hand-written 400px KPI ships 2.9× the design height.
11
13
 
12
14
  ## Real data
13
15
 
@@ -17,7 +19,7 @@ An **incomplete source renders the built-in DEMO series with no error** — inve
17
19
 
18
20
  Several series and a breakdown are mutually exclusive: multiple `values[]` rows = multiple named series; `dataSource.seriesField` = one measure split per distinct value, and with it set **only the first `values` row is aggregated**. Won/Lost is one entity, two rows, a per-row `filter`. A cross-entity row needs its own `entity` **and** its own `categoryField` — one without the other is silently not fetched.
19
21
 
20
- Writing a SuppaSQL query means `kind: 'suppaSql'` too; an entity source ignores every `sql*` key. Run the query with `suppa_query` before writing it. The `columns` in its answer are the keys `sqlCategoryColumn` and `sqlValueColumns[].key` must name.
22
+ Writing a SuppaSQL query means `kind: 'suppaSql'` too; an entity source ignores every `sql*` key. Run the query with `suppa_query` before writing it. `sqlCategoryColumn` and `sqlValueColumns[].key` name the FE analyzer's key: the alias, else the path's last segment (`"owner.firstName"` → `firstName`; FE `suppaSql/analyzer.ts:230-232`). The dot paths in `suppa_query`'s `columns` are table keys — on a chart one matches no column and the chart shows demo data (`suppaSqlChartDataProvider.ts:88`).
21
23
 
22
24
  The gate enforces "complete" as **`chart_source_incomplete`**. It is an error, or a warning when the live form's own chart is already incomplete, and it mirrors the frontend's own readiness check:
23
25
  - **SuppaSQL source:** `sqlQuery`, `sqlCategoryColumn`, and at least one `sqlValueColumns[].key`.
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Height is two unrelated keys
6
6
 
7
- `layout[bp].height` is a grid ROW SPAN and the only thing that makes an element taller; `containerSettings.size.heightMode` (`'auto' | 'fixed' | 'fill'`) is scroll/fill behaviour only. Both are legal on one element, so nothing flags the mix-up.
7
+ Height is `containerSettings.size.height` (px) with `heightMode: 'fixed'`. `layout[bp].height` is a grid ROW SPAN for placement only: canvas and container rows are `min-content` (FE `canvasGridResolver.ts:62`, `containerLayout.ts:67`; `SizeResolver.ts`: "a row span is never the author's height lever"), so a longer span adds no pixels. `heightMode: 'fill'` shares leftover height and collapses the span to one growable track. Both are legal on one element, so nothing flags the mix-up.
8
8
 
9
9
  Row height is not pixels: `settings.gridAutoRows` defaults to `'min-content'`, so a row is as tall as its content. A workspace that must fill the viewport sets `settings.gridAutoRows: '1fr'`.
10
10
 
@@ -12,7 +12,7 @@
12
12
  - **`suppaSql`** — `sqlQuery` + `sqlParams`. Run the query with `suppa_query` first: the `columns` in its answer are the nested dot-path keys a column's `key` must be. The chart keys `sqlCategoryColumn`/`sqlValueColumns` do nothing here. A column's `key` is **where its value is, not what the analyzer called it**: a relation path is keyed by the whole dotted read path (`SELECT "owner.firstName"` → `key: "owner.firstName"`), because the backend answers it nested — a leaf-keyed `firstName` column reads a key that does not exist and renders **permanently blank**. An alias on a relation path renames the *last segment* (`"owner.firstName" AS "fn"` → `owner.fn`); a flat alias stays flat. The query must select an **`id`**, must not use `SELECT *` (the star column is dropped with an `starColumnDropped` warning), and needs its relation paths quoted. One silent one: a **multi-statement paste keeps statement 1** and drops the rest with nothing said. Sorting is honest now: only the query's own flat result keys can be ordered by, and a dotted, relation or synthetic column gets **no sort control** in the header (FE `useSuppaTable.ts` `applySortability`).
13
13
  - **`aggregation`** — `entity` + `values: [{ id, field, aggregation: 'sum'|'count'|'avg'|'min'|'max' }]`; `categoryField` optional (without it, one row of totals). Columns are **derived**, keyed `g:category` and `m:<index>` **by measure position**. Restyle one with a `settings.columns` entry keyed exactly that: every column prop it carries wins over the derived one — `title`, `renderer`, `rendererParams`, `style`, width, alignment, cell style rules, `visibleWhen` — and an absent prop keeps the derived value (FE `aggregationColumns.ts` `applyAggregationColumnOverrides`). Never set `dataType`, `computed` or `tileFields` there. A `dataType` in the entry wins over the derived `'number'`, so the measure stops being a numeric column. An entry carrying `computed` or `tileFields` is not an override at all: it is a synthetic column of its own, appended after the derived set under the same `m:<i>` key — the retitle is lost and the key appears twice (FE `aggregationColumns.ts`, `TableLayoutController.ts`). Keyed `amount` instead of `m:0` the entry matches nothing and is dropped on read — no column, no error, the retitle lost.
14
14
 
15
- **Both read-only kinds have no grouping and no hierarchy**, and row drag-reorder is forced off — by design, Stage 1; the source declares `supportsGrouping: false`, which is what takes the Group control away (FE `TableSourceModel.ts` `sourceCapabilities`). Do not author grouping onto one. **Both do have a footer** over the WHOLE result, not the loaded page — for the metrics each can compute. `aggregation` holds its full set and aggregates it locally, so every metric works there, `median`, `range` and the date ranges included. `suppaSql` answers the footer through the same wrapped query (`getSummary`, FE `sqlTableDataSource.ts`, 2026-09-28), which serves only what a backend aggregate can express: `median`, `range` and `date_range_*` get no server value, so the cell computes them over the rows it has loaded — **a page-local number shown as a total** (FE `SummaryCell.vue` → `computeColumnSummary`) — and when they are the only metrics the whole footer is hidden (`summaryStrategy.ts` `hasServerSummaryMetric`). The builder does not offer them on a server-side table; do not write them on a `suppaSql` one.
15
+ **Both read-only kinds have no grouping and no hierarchy**, and row drag-reorder is forced off — by design, Stage 1; the source declares `supportsGrouping: false`, which is what takes the Group control away (FE `TableSourceModel.ts` `sourceCapabilities`). Do not author grouping onto one. **Both do have a footer** over the WHOLE result, not the loaded page — for the metrics each can compute. `aggregation` holds its full set and aggregates it locally, so every metric works there, `median`, `range` and the date ranges included. `suppaSql` answers the footer through the same wrapped query (`getSummary`, FE `sqlTableDataSource.ts`, 2026-09-28), which serves only what a backend aggregate can express: `median`, `range` and `date_range_*` get no server value, so the cell computes them over the rows it has loaded — **a page-local number shown as a total** (FE `SummaryCell.vue` → `computeColumnSummary`) — and when they are the only metrics the whole footer is hidden (`summaryStrategy.ts` `hasServerSummaryMetric`). The builder does not offer them on a server-side table; do not write them on a `suppaSql` one. A `suppaSql` footer also aggregates only flat, non-relation columns: its whitelist is the sort one, so a dotted or relation column's footer cell stays empty (`sqlTableDataSource.ts` `allowed`).
16
16
 
17
17
  `dataSource.entityFrom: 'formScope'` binds the host form's entity at runtime: then no `entity`, no `parentEntity`, `settings.columns: []` (an authored set outranks per-entity derivation forever), no `filter`/`requestFields`. The `'field'` + `entityField` mode was **removed 2026-09-15** — a table authored that way binds to nothing. `loadOnMount` is ON when absent; `realtime` is an entity record subscription, inert on `suppaSql`/`aggregation`.
18
18
 
@@ -14,7 +14,7 @@
14
14
  export const FORM_RULES_DIGEST = `WRITING A SUPPA 2.0 FORM (the entity-builder canvas — NOT suppa_create_form)
15
15
  1. suppa_create_form / suppa_update_form / suppa_add_field_to_form write \`data.formShema\` — the Suppa 1.0 form. The 2.x builder reads the \`schema\` COLUMN on the Forms row (\`{components, connections, overrides}\`; \`data.formSchema\` is the pre-2.1 blob, empty on every migrated row) and a DIFFERENT set of 58 element types. Use the suppa-form-v2 skill and its commands; the v1 tools cannot author a 2.0 form at all.
16
16
  2. The schema is a FLAT array. Nesting lives in \`layout[breakpoint].parentId\` = the parent element's \`id\` (its uuid, never its name). A grid child writes {x,y,width,height} in 1-based CELLS; a flex child writes {order}. Give every element a \`layout[bp]\` record for EVERY key in \`settings.breakpoints\` — there is no fallback: the form switches only to a breakpoint EVERY element carries, so one element without \`md\` turns the \`md\` layout off for the whole form.
17
- 3. \`layout[bp].height\` is a ROW SPAN and is the only thing that makes an element taller. \`containerSettings.size.heightMode\` ('auto'|'fixed'|'fill') is scroll behaviour, never a sizer — 'fill' on a table or a leaf field makes it share leftover height, not grow.
17
+ 3. Height is \`containerSettings.size.height\` (px) with heightMode 'fixed'. \`layout[bp].height\` is a ROW SPAN for placement only: grid rows are content-sized (min-content), so a longer span adds no pixels, and a chart with no size height renders at 0px. 'fill' on a table or a leaf field makes it share leftover height, not grow.
18
18
  4. A grid child spans its PARENT container's columns, not the form's. Column count DEFAULTS TO 1 and 1 is a real count: write the count you intend (\`settings.columnsNumber\` for the root grid, a container's own \`columnsNumber\`, range 1-12) BEFORE laying out spans — a width of 12 inside a 1-column grid overflows its parent.
19
19
  5. There are 58 DEDICATED element types. Never build something out of \`input\` + \`html\` because no type came to mind — read the component index first. \`html\` is author-written markup and is never a home for record data.
20
20
  6. The prop table is the options PANEL, not the runtime: a prop that validates is not a prop that works. Never invent a prop name or an option value, and read a type's note before setting a behavioural prop.