suppa-mcp-2 1.40.0 → 1.40.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
@@ -1204,15 +1204,19 @@ export function buildToolTable() {
1204
1204
  .default(null)
1205
1205
  .describe('Field options as a JSON object, e.g. {"searchable": true, "searchPriority": 3}. ' +
1206
1206
  "Keys: searchable, searchPriority (1-4, higher = stronger weight), readOnly, " +
1207
- "canGroup, canSort, showInTable, editFromTable, canFilter. Pass ONLY the ones " +
1208
- "that differ from the defaults the platform already applies — canGroup, canSort, " +
1209
- "showInTable, editFromTable and canFilter are true; readOnly and searchable are " +
1210
- "false (verified on a live tenant 2026-08-17; the Field Options table in " +
1211
- "builder.txt:66-73 lists them as false, which the platform contradicts). So the " +
1212
- "one usually worth passing is searchable (+searchPriority): free-text search " +
1213
- "(suppa_search_records search=...) only covers fields marked searchable. " +
1214
- "Restating a default changes nothing and buries the option that does. Unknown " +
1215
- "keys are refused here (the platform would silently drop them)."),
1207
+ "canGroup, canSort, showInTable, editFromTable, canFilter. The one usually worth " +
1208
+ "passing is searchable (+searchPriority): free-text search " +
1209
+ "(suppa_search_records search=...) only covers fields marked searchable; " +
1210
+ "readOnly and searchable default to false. THE FIVE DISPLAY FLAGS ARE " +
1211
+ "UNSETTLED: reading a field back on a live tenant shows canGroup, canSort, " +
1212
+ "showInTable, editFromTable and canFilter as true (2026-08-17), but the " +
1213
+ "platform's own docs say the backend never defaults them and every consumer " +
1214
+ "reads an absent key as FALSE — which is how agent-created fields ended up " +
1215
+ "non-groupable, unsortable and hidden from tables. The stored shape does look " +
1216
+ "sparse: of 70 Tasks fields, 15 carry no options object at all. So if the new " +
1217
+ "field MUST be visible and sortable, pass the five explicitly rather than " +
1218
+ "trusting a default — it costs nothing — and read the field back afterwards. " +
1219
+ "Unknown keys are refused here (the platform would silently drop them)."),
1216
1220
  max_length: z
1217
1221
  .number()
1218
1222
  .int()
@@ -135,6 +135,12 @@ export function defaultValueMayBeSent(unique = false) {
135
135
  // the searchable option participate."). `searchable` (and searchPriority) are
136
136
  // therefore the ones worth setting deliberately; the rest already hold the
137
137
  // value most fields want.
138
+ // The five DISPLAY flags — canGroup, canSort, canFilter, showInTable, editFromTable — are the
139
+ // ones the platform's own client sends on every field it creates (`fieldDraft.DEFAULT_TRUE_OPTIONS`
140
+ // in the entity builder, `setDefaultTrueOptions` in the legacy admin). Whether an omission means
141
+ // "true" or "false" is unsettled — see the decision point in buildFieldDefinition, which leaves
142
+ // the write path alone and says so rather than guessing. No constant here: an exported set with no
143
+ // consumer is how a decision nobody made starts to look like one that was.
138
144
  /** Boolean members of the Field Options object. */
139
145
  export const FIELD_OPTION_BOOLEAN_KEYS = [
140
146
  "searchable", // builder.txt:66 — "Available for search."
@@ -1775,9 +1781,20 @@ export async function buildFieldDef(entityName, fieldName, fieldType, title, opt
1775
1781
  }
1776
1782
  // builder.txt:60 — "options | object | false | Field options configuration."
1777
1783
  // (example body: builder.txt:127-132).
1784
+ //
1778
1785
  if (fieldOptions) {
1779
1786
  fieldDef.options = fieldOptions;
1780
1787
  }
1788
+ else {
1789
+ // UNSETTLED, and it decides whether a new field is visible in tables at all. Our own read-back
1790
+ // (2026-08-05, live) says the platform fills these in; the platform's AI-assistant page says
1791
+ // the opposite — "never defaulted by the backend … every consumer reads an absent key as
1792
+ // false … an agent-created field was silently non-groupable, unsortable and hidden from
1793
+ // tables" — and today's read of the stored shape supports it (15 of 70 Tasks fields carry no
1794
+ // `options` at all). Only a write settles it, so nothing is forced here; the caller is told.
1795
+ // Deliberately NOT reported: an omission is the normal call, and a warning on every one of
1796
+ // them is the noise that teaches people to stop reading warnings.
1797
+ }
1781
1798
  return { fieldDef, notApplicable, resolvedType };
1782
1799
  }
1783
1800
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.40.0",
3
+ "version": "1.40.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": {
@@ -455,6 +455,21 @@ function offKitSpacing(schema, skipIds) {
455
455
  /** Container types whose children are placed in GRID cells and carry their own column count. */
456
456
  const GRID_PARENT_TYPES = new Set(["container", "tabsContainer", "accordionContainer", "stepsContainer"]);
457
457
 
458
+ /**
459
+ * A grid's column count, read the way the rest of this package already reads it.
460
+ *
461
+ * `columnsOf()` and `polishList()` in form-core both require a finite number `>= 1` and floor it,
462
+ * treating anything else as absent. This check used a bare `typeof === "number"`, so a 0, a
463
+ * negative or a 2.5 flowed into both the arithmetic and the advice — and "write width 2.5, which is
464
+ * full width here" is not a remedy an author can follow. Out-of-range counts now read as absent,
465
+ * which is what the normalizer does with them.
466
+ *
467
+ * @returns {number|null} a usable count, or null when none was declared (the grid then holds 1)
468
+ */
469
+ function gridColumns(v) {
470
+ return typeof v === "number" && Number.isFinite(v) && v >= 1 ? Math.floor(v) : null;
471
+ }
472
+
458
473
  /**
459
474
  * A grid child cannot span more columns than its parent grid has.
460
475
  *
@@ -465,13 +480,15 @@ const GRID_PARENT_TYPES = new Set(["container", "tabsContainer", "accordionConta
465
480
  * is precisely the shape this check now refuses. Rare in the wild, so it reads as a defect and not
466
481
  * a convention: 7 occurrences across 4 of the 103 dev forms that have a `schema` column.
467
482
  */
468
- function spanOverflow(schema, settings, skipIds) {
483
+ function spanOverflow(schema, settings, skipIds, presentation = "schema") {
469
484
  const out = [];
470
485
  const list = Array.isArray(schema) ? schema : [];
471
486
  const byId = new Map();
472
487
  for (const el of list) if (el && typeof el === "object" && el.id !== undefined) byId.set(el.id, el);
473
- const rootCols = settings && typeof settings === "object" && typeof settings.columnsNumber === "number"
474
- ? settings.columnsNumber : null;
488
+ const rootCols = gridColumns(settings && typeof settings === "object" ? settings.columnsNumber : undefined);
489
+ // The mobile presentation is laid out against the SAME root count: form-core hands its own
490
+ // `formColumns` to both lists (`normalizeSchemaList(draft.mobileSchema, formColumns, …)`).
491
+ const where0 = presentation === "mobileSchema" ? "mobileSchema — " : "";
475
492
 
476
493
  for (const el of list) {
477
494
  if (!el || typeof el !== "object") continue;
@@ -494,17 +511,18 @@ function spanOverflow(schema, settings, skipIds) {
494
511
  const parent = byId.get(pid);
495
512
  if (!parent || typeof parent !== "object") continue; // dangling parents are reported elsewhere
496
513
  if (!GRID_PARENT_TYPES.has(parent.type)) continue; // a flex parent places by `order`
497
- cols = typeof parent.columnsNumber === "number" ? parent.columnsNumber : 1;
498
- where = typeof parent.columnsNumber === "number"
499
- ? `\`${parent.name || parent.id}\` (columnsNumber: ${parent.columnsNumber})`
500
- : `\`${parent.name || parent.id}\`, whose \`columnsNumber\` is unset and therefore 1`;
514
+ const declared = gridColumns(parent.columnsNumber);
515
+ cols = declared === null ? 1 : declared;
516
+ where = declared === null
517
+ ? `\`${parent.name || parent.id}\`, whose \`columnsNumber\` is unset and therefore 1`
518
+ : `\`${parent.name || parent.id}\` (columnsNumber: ${declared})`;
501
519
  }
502
520
  if (width > cols) {
503
521
  out.push({
504
522
  code: "span_exceeds_parent_columns",
505
523
  elementId: el.name || el.id || el.type,
506
524
  detail:
507
- `layout.${bp}.width is ${width} but its parent grid has ${cols} column${cols === 1 ? "" : "s"} — ` +
525
+ `${where0}layout.${bp}.width is ${width} but its parent grid has ${cols} column${cols === 1 ? "" : "s"} — ` +
508
526
  `${where}. Column count is per grid and defaults to 1: set the count you intend on the grid ` +
509
527
  `FIRST, then span against it. Either raise that grid's column count to ${width} (1-12) and ` +
510
528
  `re-span its other children in the same turn, or write width ${cols}, which is full width here.`,
@@ -801,6 +819,16 @@ export async function validateForm(input, { baseline = null, normalize = false }
801
819
  // missing breakpoint records) and none for what it does not.
802
820
  const docErrors = [
803
821
  ...spanOverflow(draft.schema, draft.settings, baselineIds),
822
+ // The mobile presentation is a component set of its own, and it was passing unchecked: a
823
+ // mobileSchema element spanning 12 in a 4-column grid returned ok:true with zero findings,
824
+ // while the identical shape on the desktop schema was an error. Both lists are laid out
825
+ // against the same `settings.columnsNumber`, so the same check applies to both.
826
+ //
827
+ // Swept over all 217 live dev forms: NONE carries a non-empty `mobileSchema`, so this branch
828
+ // adds zero findings to anything on the tenant today. That is coverage, not evidence — unlike
829
+ // the desktop branch (7 hits on 4 forms), it rests on the shared column model above and on the
830
+ // same documented invariant, not on a measurement of forms that exercise it.
831
+ ...spanOverflow(draft.mobileSchema, draft.settings, baselineIds, "mobileSchema"),
804
832
  ...crossPresentationIds(draft.schema, draft.mobileSchema),
805
833
  ...connectionsWithoutId(draft.connections),
806
834
  ];