suppa-mcp-2 1.43.2 → 1.43.4

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/README.md CHANGED
@@ -540,9 +540,11 @@ extension table is created outside that check and is not subject to it.
540
540
  | `suppa_add_field_to_form` | Add a field element to a form (confirm-gated) |
541
541
  | `suppa_list_form_field_types` | List form element types |
542
542
 
543
- The seven above are **Suppa 1.0** forms: they read and write `data.formShema` (the platform's
544
- misspelling) and the v1 field types. A **Suppa 2.0** entity-builder form is a different product —
545
- the `schema` column on the row since 2.1, 58 component types — and is served by the six below plus the bundled
543
+ Of the seven above, `suppa_get_form` reads both generations: since 1.43.3 a 2.x form comes back as
544
+ the builder reads it (schema, variables, localizations, the Code Form's files). The other six are
545
+ **Suppa 1.0** forms: they read and write `data.formShema` (the platform's misspelling) and the v1
546
+ field types. A **Suppa 2.0** entity-builder form is a different product —
547
+ the `schema` column on the row since 2.1, 57 component types — and is served by the six below plus the bundled
546
548
  `skills/suppa-form-v2` skill. The first two touch no tenant: they read files inside the package.
547
549
 
548
550
  | Tool | Description |
package/dist/server.js CHANGED
@@ -2456,18 +2456,23 @@ export function buildToolTable() {
2456
2456
  annotations: _READ,
2457
2457
  }, async (a) => text(await forms.listForms(a.entity_name, a.form_type, a.limit)));
2458
2458
  reg("suppa_get_form", {
2459
- description: "Get a SUPPA 1.0 form by ID (data.formShema, settings). A 2.x form's draft is the schema\n" +
2460
- " COLUMN: read Forms or FormVersions (snapshot) with suppa_search_records.",
2461
- inputSchema: { form_id: z.number().int() },
2459
+ description: "Get a form by ID. 2.x: the builder's read — schema, settings, variables, localizations, the\n" +
2460
+ " Code Form's files (`code`), `revision`; saved to a file, the gate's baseline and a\n" +
2461
+ " suppa_write_form_draft draft. Suppa 1.0: the row's `data` (formShema).",
2462
+ inputSchema: {
2463
+ form_id: z.number().int(),
2464
+ version: z.enum(["draft", "published"]).default("draft").describe("2.x: published = what THIS user sees, read-only."),
2465
+ include_artifact: z.boolean().default(false).describe("2.x: also the compiled JS of `code`."),
2466
+ },
2462
2467
  annotations: _READ,
2463
- }, async (a) => text(await forms.getForm(a.form_id)));
2468
+ }, async (a) => text(await forms.getForm(a.form_id, a.version ?? "draft", a.include_artifact ?? false)));
2464
2469
  reg("suppa_create_form", {
2465
2470
  description: "Create a new form. Provide schema_json (array of fields or {formShema}), or set\n" +
2466
2471
  " generate_from_entity=true WITH entity_name to auto-build fields from the entity\n" +
2467
2472
  " (without entity_name it is refused, rather than creating an empty form).\n" +
2468
2473
  " Form names are UNIQUE platform-wide — a duplicate name fails; pick a distinct one.\n" +
2469
2474
  "\n SUPPA 1.0 FORM. This writes data.formShema and the v1 field types. A Suppa 2.0\n" +
2470
- " (entity-builder) form is a different product — the `schema` column, 56 types:\n" +
2475
+ " (entity-builder) form is a different product — the `schema` column, 57 types:\n" +
2471
2476
  " use suppa_form_kb and suppa_validate_form_schema.",
2472
2477
  inputSchema: {
2473
2478
  name: z.string(),
@@ -2646,7 +2651,7 @@ export function buildToolTable() {
2646
2651
  " kit the look of every record card, create form, window: the card kit's\n" +
2647
2652
  " patterns (topic='p_block,…' = their elements); rules: ref card-kit\n" +
2648
2653
  " note dynamicComponent = the widget contract (sandbox, formAPI, styles, translations)\n\n" +
2649
- " No mode returns all 56 prop tables: they are ~14,200 tokens stripped, and not carrying\n" +
2654
+ " No mode returns all 57 prop tables: they are ~14,200 tokens stripped, and not carrying\n" +
2650
2655
  " them is what this skill is for. Full skill: skills/suppa-form-v2/SKILL.md.",
2651
2656
  inputSchema: {
2652
2657
  mode: z
package/dist/toolTable.js CHANGED
@@ -6,9 +6,9 @@ export const PROFILES = {
6
6
  schema: ["create_entity", "add_field", "update_field", "change_field_type", "update_entity_options", "set_title_field", "create_tabular_part", "list_tabular_parts", "list_field_types", "add_enum_values", "add_custom_field", "add_custom_fields_batch", "remove_custom_field", "restore_custom_field", "resolve_custom_fields", "link_custom_field", "apply_custom_fields", "validate_entity_code", "migrate_entities_from_v1", "read_v1_entities", "read_v1_entity_props", "read_v1_enum"],
7
7
  docs: ["create_doc", "get_doc", "list_docs", "update_doc", "delete_doc", "create_page", "get_page", "list_pages", "read_page", "update_page", "delete_page", "create_blocks", "get_blocks", "insert_block", "update_block", "delete_block", "reorder_blocks"],
8
8
  // Two form PRODUCTS live in this group, and the split is the thing to know before reading the
9
- // list. The first seven are Suppa 1.0: they read and write `data.formShema` (the platform's
10
- // misspelling) and the v1 field types. `form_kb` and `validate_form_schema` serve the 2.0
11
- // entity-builder canvas — the `schema` COLUMN on the row since 2.1, 56 component
9
+ // list. Of the first seven, get_form reads both (a 2.x form as the builder reads it); the other six
10
+ // are Suppa 1.0: they read and write `data.formShema` (the platform's misspelling) and the v1 field types. `form_kb` and `validate_form_schema` serve the 2.0
11
+ // entity-builder canvas — the `schema` COLUMN on the row since 2.1, 57 component
12
12
  // types — and share nothing with them.
13
13
  forms: ["create_form", "get_form", "list_forms", "update_form", "add_field_to_form", "generate_form_schema", "list_form_field_types", "form_kb", "validate_form_schema",
14
14
  "write_form_draft", "create_form_v2", "form_versions", "form_lifecycle"],
@@ -37,10 +37,9 @@ export function skillFile(...parts) {
37
37
  * exists never looks for it — measured: given "зроби форму для клієнтів", agents with the CLI and
38
38
  * agents with all 96 tools both reached for suppa_create_form, which writes the v1 blob.
39
39
  */
40
- export const FORM_V2_INSTRUCTION_LINE = "FORMS — TWO PRODUCTS: the *_form tools write `data.formShema`, the Suppa 1.0 form. A Suppa 2.x " +
41
- "(entity-builder) form is the `schema` COLUMN, 56 types (pre-2.1: `data.formSchema`) — use " +
42
- "suppa_form_kb and suppa_validate_form_schema (skills/suppa-form-v2/SKILL.md). Publish only " +
43
- "on the user's yes.";
40
+ export const FORM_V2_INSTRUCTION_LINE = "FORMS — TWO PRODUCTS: suppa_create_form/update_form write `data.formShema` (Suppa 1.0). A Suppa 2.x form " +
41
+ "is the `schema` COLUMN, 57 types (pre-2.1: `data.formSchema`): suppa_get_form reads it; suppa_form_kb, " +
42
+ "suppa_validate_form_schema (skills/suppa-form-v2/SKILL.md). Publish only on the user's yes.";
44
43
  /**
45
44
  * Is the vendored core actually USABLE, not merely present?
46
45
  *
@@ -270,7 +269,7 @@ export async function formKb(mode, types, topic) {
270
269
  if (!list.length) {
271
270
  return jsonResponse({
272
271
  error: "types is required for mode='api' — name the element types you are about to author, e.g. ['input','select'].",
273
- note: `There is deliberately no way to fetch all 56 at once: stripped of prose they are ~14,200 tokens, and the point of this tool is not to carry them. At most ${MAX_API_TYPES} per call.`,
272
+ note: `There is deliberately no way to fetch all 57 at once: stripped of prose they are ~14,200 tokens, and the point of this tool is not to carry them. At most ${MAX_API_TYPES} per call.`,
274
273
  });
275
274
  }
276
275
  // The cap is what makes the sentence above TRUE. Without it, listing all 58 in `types` returned
@@ -279,7 +278,7 @@ export async function formKb(mode, types, topic) {
279
278
  if (list.length > MAX_API_TYPES) {
280
279
  return jsonResponse({
281
280
  error: `types names ${list.length} types; the cap is ${MAX_API_TYPES} per call.`,
282
- note: "Name the types you are about to author — another call is free. Asking for all 56 is ~16,300 tokens, which is the cost this tool exists to avoid, not a shortcut.",
281
+ note: "Name the types you are about to author — another call is free. Asking for all 57 is ~16,300 tokens, which is the cost this tool exists to avoid, not a shortcut.",
283
282
  cap: MAX_API_TYPES,
284
283
  asked: list.length,
285
284
  });
@@ -886,6 +885,17 @@ function staleAnswer(message, id) {
886
885
  current_revision: current,
887
886
  };
888
887
  }
888
+ /**
889
+ * A suppa_get_form version='published' answer is what this user sees, not the draft. For a child form it
890
+ * is the MERGED tree with no `parent` (the published read carries none), so writing it as the draft would
891
+ * turn the parent's elements and variables into the child's own layer; for any form it would revert the
892
+ * draft's later edits. It is read-only — the published version comes back through rollback.
893
+ */
894
+ const isPublishedRead = (v) => Boolean(v && typeof v === "object" && !Array.isArray(v) && v.generation === "2.x" && v.read === "published");
895
+ const PUBLISHED_READ_REFUSAL = "this file is a suppa_get_form version='published' read — the version users see (a child form's MERGED tree, " +
896
+ "without its own layer), not the draft. Saved as the draft it would revert the draft's later edits and turn a " +
897
+ "child's inherited elements into its own. Read the draft (suppa_get_form without version) to edit it; to bring a " +
898
+ "published version back use suppa_form_lifecycle action='rollback'.";
889
899
  export async function writeFormDraft(formId, path, confirm = false, normalize = false, expectedRevision = null) {
890
900
  const id = Number(formId);
891
901
  const target = String(path ?? "").trim();
@@ -926,6 +936,10 @@ export async function writeFormDraft(formId, path, confirm = false, normalize =
926
936
  const peek = readJson(target);
927
937
  if (peek.error)
928
938
  preview = `the draft could not be read yet: ${peek.error}`;
939
+ else if (isPublishedRead(peek.value)) {
940
+ preview = "not a draft: a published read";
941
+ gateLines = [`the confirmed call will REFUSE this file: ${PUBLISHED_READ_REFUSAL}`];
942
+ }
929
943
  else {
930
944
  draftVars = sentVariables(peek.value);
931
945
  const s = skillFile("scripts", "validate-form-schema.mjs");
@@ -1047,6 +1061,8 @@ export async function writeFormDraft(formId, path, confirm = false, normalize =
1047
1061
  const read = readJson(target);
1048
1062
  if (read.error)
1049
1063
  return jsonResponse({ error: `the draft could not be read: ${read.error}` });
1064
+ if (isPublishedRead(read.value))
1065
+ return jsonResponse({ written: false, error: PUBLISHED_READ_REFUSAL });
1050
1066
  // 1. NOTHING UNCHECKED IS EVER WRITTEN. The gate runs on the same file, with the same rules, and
1051
1067
  // a refusal or any error stops the write. An envelope it cannot read at all is refused before
1052
1068
  // the tenant is touched; everything else is judged against the form as the tenant holds it.
@@ -386,12 +386,123 @@ export async function listForms(entityName = null, formType = null, limit = 50)
386
386
  const results = await searchEntity(ENTITY_FORMS, filters, FORM_LIST_FIELDS, limit);
387
387
  return jsonResponse(results);
388
388
  }
389
- /** Get a form by ID including its full schema (data.formShema) and settings. */
390
- export async function getForm(formId) {
391
- const result = await selectEntity(ENTITY_FORMS, [makeFilter("id", formId)], FORM_DETAIL_FIELDS);
389
+ // The Form Builder 2 kinds. A Suppa 1.0 form is elementForm / createForm / customForm / moreButtonForm /
390
+ // selectForm, and its layout is the `data` blob; measured on dev 2026-10-21, 286 of 409 rows carry
391
+ // `settings.isFormBuilderV2` and 240 a Code Form — while form 378, an `update` with code, has no flag.
392
+ const V2_FORM_TYPES = new Set(["create", "update", "custom", "workspace", "dashboard", "workspaceModule"]);
393
+ const isObj = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
394
+ const isEmpty = (v) => v == null || (Array.isArray(v) && v.length === 0);
395
+ const nonEmpty = (v) => Array.isArray(v) && v.length > 0;
396
+ /**
397
+ * What only a 2.x form has: elements in the schema column, a Code Form or its build, a mobile layout, the
398
+ * builder's flag, a parent (a child's own layer can be empty — its settings, elements and code inherited),
399
+ * or overrides of a parent's elements, settings, connections or texts.
400
+ */
401
+ function hasV2Evidence(a) {
402
+ const schema = isObj(a.schema) ? a.schema : {};
403
+ return (nonEmpty(schema.components) ||
404
+ nonEmpty(schema.overrides) ||
405
+ nonEmpty(a.code) ||
406
+ a.codeArtifact != null ||
407
+ a.mobileSchema != null ||
408
+ (isObj(a.settings) && a.settings.isFormBuilderV2 === true) ||
409
+ a.parentForm != null ||
410
+ nonEmpty(a.settingsOverrides) ||
411
+ nonEmpty(a.connectionOverrides) ||
412
+ nonEmpty(a.localizationOverrides));
413
+ }
414
+ /** An FB2 kind alone is weaker evidence: `Forms.type` is free text, and a 1.0 form can carry one. */
415
+ const hasV2Kind = (a) => typeof a.type === "string" && V2_FORM_TYPES.has(a.type);
416
+ /** A compiled bundle by its stamp and size — it is the build of `code`, ~the same size again. */
417
+ function artifactSummary(art) {
418
+ if (!isObj(art))
419
+ return art ?? null;
420
+ const { code, ...stamp } = art;
421
+ return { ...stamp, bytes: typeof code === "string" ? code.length : 0 };
422
+ }
423
+ /**
424
+ * The 2.x answer: the builder's own read, shaped as the { schema, settings, variables } draft the
425
+ * gate and suppa_write_form_draft take as they are — saved to a file it is an edit's baseline.
426
+ * Empty lists and nulls are dropped; the compiled bundle is summarized unless asked for.
427
+ */
428
+ function v2FormAnswer(a, version, includeArtifact) {
429
+ const { schema, mobileSchema, settings, variables, localizations, code, codeArtifact, codeArtifacts, dataSources, updatedAt, ...meta } = a;
430
+ const notes = [];
431
+ const parent = isObj(meta.parentForm) ? meta.parentForm : null;
432
+ if (parent && version === "draft") {
433
+ const pinned = meta.parentVersion != null ? `, pinned to its FormVersions row ${meta.parentVersion}` : "";
434
+ notes.push(`a child form: \`schema\` is its OWN layer over form ${parent.id ?? "?"}${pinned} — ` +
435
+ "`schema.overrides`, settingsOverrides and connectionOverrides — not what renders; " +
436
+ "version='published' is the merged form this user sees.");
437
+ }
438
+ if (version === "published") {
439
+ // The published read leaves the sources out (entity-builder form-publish.service: code, inheritedCode,
440
+ // rawLayer are stripped) and names no parent — so it is neither a Code Form read nor a draft.
441
+ notes.push("a published read: the version THIS user sees, for reading only — suppa_write_form_draft refuses it. " +
442
+ "It carries no Code Form sources (only the compiled codeArtifact) and no parent; read the draft for those.");
443
+ }
444
+ if (!includeArtifact && isObj(codeArtifact)) {
445
+ notes.push("codeArtifact is the compiled build of `code`, summarized — include_artifact=true for its JS.");
446
+ }
447
+ const out = { generation: "2.x", read: version };
448
+ for (const [k, v] of Object.entries(meta))
449
+ if (!isEmpty(v))
450
+ out[k] = v;
451
+ if (typeof updatedAt === "string")
452
+ out.revision = updatedAt;
453
+ if (notes.length)
454
+ out.notes = notes;
455
+ out.settings = settings ?? {};
456
+ out.variables = variables ?? [];
457
+ if (!isEmpty(localizations))
458
+ out.localizations = localizations;
459
+ if (version === "draft")
460
+ out.code = code ?? [];
461
+ if (codeArtifact != null)
462
+ out.codeArtifact = includeArtifact ? codeArtifact : artifactSummary(codeArtifact);
463
+ const inherited = Array.isArray(codeArtifacts) ? codeArtifacts.filter((c) => isObj(c) && c.formId !== a.id) : [];
464
+ if (inherited.length)
465
+ out.inheritedCodeArtifacts = includeArtifact ? inherited : inherited.map(artifactSummary);
466
+ out.schema = schema ?? { components: [] };
467
+ if (mobileSchema != null)
468
+ out.mobileSchema = mobileSchema;
469
+ return out;
470
+ }
471
+ /**
472
+ * Get a form by ID. A Suppa 2.x form comes from the builder's own read (GET /core/forms/:id/schema):
473
+ * schema, mobileSchema, settings, variables, localizations and the Code Form's files — the draft, or
474
+ * with version='published' the version users see. A Suppa 1.0 form is its row with the `data` blob
475
+ * (formShema / formSettings / formModul).
476
+ */
477
+ export async function getForm(formId, version = "draft", includeArtifact = false) {
478
+ let assembled = null;
479
+ try {
480
+ const got = await makeRequest("GET", `/api/core/forms/${formId}/schema`, null, version === "published" ? { query: { mode: "published" } } : undefined);
481
+ assembled = isObj(got) ? got : null;
482
+ }
483
+ catch (e) {
484
+ if (e?.status !== 404)
485
+ throw e;
486
+ if (version === "published") {
487
+ return jsonResponse({
488
+ error: `Form ${formId} has no published version this user sees (or does not exist). version='draft' reads the draft.`,
489
+ });
490
+ }
491
+ }
492
+ // A published version exists only for a 2.x form: whatever it holds, it is that form.
493
+ if (assembled && (version === "published" || hasV2Evidence(assembled))) {
494
+ return jsonResponse(v2FormAnswer(assembled, version, includeArtifact));
495
+ }
496
+ const result = (await selectEntity(ENTITY_FORMS, [makeFilter("id", formId)], FORM_DETAIL_FIELDS));
497
+ // An FB2 kind and nothing else: the row decides — a 1.0 layout in `data.formShema` is a 1.0 form, an
498
+ // empty one a 2.x form nobody has laid out yet.
499
+ const formShema = result && isObj(result.data) ? result.data.formShema : undefined;
500
+ if (assembled && hasV2Kind(assembled) && !nonEmpty(formShema)) {
501
+ return jsonResponse(v2FormAnswer(assembled, version, includeArtifact));
502
+ }
392
503
  if (result === null)
393
504
  return notFoundAnswer(ENTITY_FORMS, formId, "form");
394
- return jsonResponse(result);
505
+ return jsonResponse({ generation: "1.0", ...result });
395
506
  }
396
507
  /**
397
508
  * Create a new form.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.43.2",
3
+ "version": "1.43.4",
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": {
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: suppa-form-v2
3
- description: Author a Suppa 2.0/2.1 (entity-builder) FORM — the element canvas with 56 component types, grid/flex layout, data binding and conditions — and write it to a tenant. Use whenever the user wants to build, edit or lay out a form, a workspace, a dashboard or a record card in Suppa 2.0, or asks about form elements, form layout, binding a field to entity data, or a form's settings. NOT for Suppa 1.0 forms — those are suppa_create_form and the `formShema` blob, a different product. Trigger phrases (English) — "build a form", "create a form", "edit the form", "form layout", "add a field to the form", "record card", "workspace form", "dashboard", "bind this field"; (Ukrainian / Українська) — "зроби форму", "створи форму", "додай поле у форму", "виправ форму", "картка запису", "робочий простір", "дашборд", "прив'яжи поле".
3
+ description: Author a Suppa 2.0/2.1 (entity-builder) FORM — the element canvas with 57 component types, grid/flex layout, data binding and conditions — and write it to a tenant. Use whenever the user wants to build, edit or lay out a form, a workspace, a dashboard or a record card in Suppa 2.0, or asks about form elements, form layout, binding a field to entity data, or a form's settings. NOT for Suppa 1.0 forms — those are suppa_create_form and the `formShema` blob, a different product. Trigger phrases (English) — "build a form", "create a form", "edit the form", "form layout", "add a field to the form", "record card", "workspace form", "dashboard", "bind this field"; (Ukrainian / Українська) — "зроби форму", "створи форму", "додай поле у форму", "виправ форму", "картка запису", "робочий простір", "дашборд", "прив'яжи поле".
4
4
  ---
5
5
 
6
6
  # Suppa 2.x forms (the entity-builder canvas)
7
7
 
8
- A form is a **flat array of elements**, rendered from 56 component types. Nesting, geometry and
8
+ A form is a **flat array of elements**, rendered from 57 component types. Nesting, geometry and
9
9
  every layout decision live inside each element's `layout` map, not in the array's order.
10
10
 
11
11
  **Where it is stored changed in 2.1.** The live form is first-class columns on the `Forms` row —
@@ -48,14 +48,14 @@ record's card → `flat`. The gate judges it by the form's type.
48
48
  | 7 | Write it | `suppa write-form-draft --form-id <id> --path <abs>` — see **The write path** |
49
49
  | 8 | Look at it | `/form/<id>?version=draft` at 1600, 1366, 1000, 760, 600 and 375 px: every tab and accordion section open, each control hovered and Tab-focused. No sideways scroll, control rows ≥ 8px apart, no clipped focus ring. The gate sees none of this. |
50
50
 
51
- Steps 2 and 3 are not optional reading. The catalog is 56 types and the prop tables are ~14,200
51
+ Steps 2 and 3 are not optional reading. The catalog is 57 types and the prop tables are ~14,200
52
52
  tokens in total — which is exactly why they are fetched per type instead of carried. Skipping them
53
53
  produces a form built out of `input` and `html` that passes every check and is the wrong form.
54
54
 
55
- **Reading a form.** `suppa_get_form` is the 1.0 blob. The 2.x draft is `suppa_search_records` on
56
- `Forms` (filter `id`; fields `schema`, `settings`, `updatedAt`, `lockedBy {id fullName}`), the
57
- published one `FormVersions` (filter `form.id`, `isDefault: true`; field `snapshot`). Save the answer
58
- to a file: it is the baseline the gate takes as it is, and the copy to restore an unpublished draft.
55
+ **Reading a form.** `suppa_get_form` is the builder's own read of the 2.x draft: schema, settings,
56
+ variables, localizations, the Code Form's `code` and `revision` (`version='published'`: what this user
57
+ sees, read-only). Save the answer to a file: it is the baseline the gate takes as it is, and the copy to
58
+ restore an unpublished draft. Who has it open is `lockedBy` on `Forms` (`suppa_search_records`).
59
59
 
60
60
  ## Rules
61
61
 
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "source": "suppa-ai-agent/packages/formbuilder-agent",
3
- "sha": "77266d1a41e8ae45120a2396f7c750bacf2ebe61",
4
- "pulledAt": "2026-10-20",
5
- "components": 56,
3
+ "sha": "821ee77fd96bb0510913f9c5824f1b14b4c91d2f",
4
+ "pulledAt": "2026-10-21",
5
+ "components": 57,
6
6
  "templates": 8,
7
- "coreBytes": 1209545,
7
+ "coreBytes": 1259259,
8
8
  "why": "Vendored, not depended on. Re-run scripts/sync-formbuilder.mjs after every frontend release: the manifest is a snapshot, and drift in the ACCEPT direction is silent."
9
9
  }
@@ -92,6 +92,11 @@
92
92
  "label": "Container",
93
93
  "category": "structure"
94
94
  },
95
+ {
96
+ "type": "customFields",
97
+ "label": "Custom fields",
98
+ "category": "widgets"
99
+ },
95
100
  {
96
101
  "type": "date",
97
102
  "label": "Date",
@@ -2261,6 +2261,16 @@
2261
2261
  "control": "unit",
2262
2262
  "group": "style"
2263
2263
  },
2264
+ {
2265
+ "path": "sectionStyle",
2266
+ "control": "segmented",
2267
+ "group": "style",
2268
+ "options": [
2269
+ "list",
2270
+ "cards"
2271
+ ],
2272
+ "default": "list"
2273
+ },
2264
2274
  {
2265
2275
  "path": "borderWidth",
2266
2276
  "control": "unit",
@@ -2331,6 +2341,12 @@
2331
2341
  "path": "filterBy",
2332
2342
  "control": "elementSelect",
2333
2343
  "group": "state"
2344
+ },
2345
+ {
2346
+ "path": "hideWhenEmpty",
2347
+ "control": "checkbox",
2348
+ "group": "state",
2349
+ "default": false
2334
2350
  }
2335
2351
  ],
2336
2352
  "avatar": [
@@ -3074,11 +3090,12 @@
3074
3090
  "control": "segmented",
3075
3091
  "group": "data",
3076
3092
  "options": [
3093
+ "auto",
3077
3094
  "local",
3078
3095
  "publish",
3079
3096
  "off"
3080
3097
  ],
3081
- "default": "publish"
3098
+ "default": "auto"
3082
3099
  },
3083
3100
  {
3084
3101
  "path": "recordForm",
@@ -3583,6 +3600,41 @@
3583
3600
  "group": "data"
3584
3601
  }
3585
3602
  ],
3603
+ "customFields": [
3604
+ {
3605
+ "path": "label",
3606
+ "control": "localizedText",
3607
+ "group": "content"
3608
+ },
3609
+ {
3610
+ "path": "showAllFields",
3611
+ "control": "checkbox",
3612
+ "group": "main",
3613
+ "default": true
3614
+ },
3615
+ {
3616
+ "path": "fieldColumns",
3617
+ "control": "segmented",
3618
+ "group": "layout",
3619
+ "options": [
3620
+ 1,
3621
+ 2,
3622
+ 3
3623
+ ],
3624
+ "default": 1
3625
+ },
3626
+ {
3627
+ "path": "filterBy",
3628
+ "control": "elementSelect",
3629
+ "group": "state"
3630
+ },
3631
+ {
3632
+ "path": "hideWhenEmpty",
3633
+ "control": "checkbox",
3634
+ "group": "state",
3635
+ "default": false
3636
+ }
3637
+ ],
3586
3638
  "approvals": [
3587
3639
  {
3588
3640
  "path": "label",
@@ -3995,7 +4047,7 @@
3995
4047
  "path": "settings.style.outerBorder",
3996
4048
  "control": "checkbox",
3997
4049
  "group": "style",
3998
- "default": true
4050
+ "default": false
3999
4051
  },
4000
4052
  {
4001
4053
  "path": "settings.style.rounded",
@@ -4383,7 +4435,7 @@
4383
4435
  "none",
4384
4436
  "zebra"
4385
4437
  ],
4386
- "default": "grid"
4438
+ "default": "rows"
4387
4439
  },
4388
4440
  {
4389
4441
  "path": "dataSource.showUnsavedBar",
@@ -1,6 +1,6 @@
1
1
  # Choosing between element types that both validate
2
2
 
3
- *Open when more than one of the 56 types could carry what the user asked for, or before authoring `date`, `code`, `buttonList`, `chips`, `comments`, `history`, `approvals`, `checklist`, or a decomposed workspace.*
3
+ *Open when more than one of the 57 types could carry what the user asked for, or before authoring `date`, `code`, `buttonList`, `chips`, `comments`, `history`, `approvals`, `checklist`, or a decomposed workspace.*
4
4
 
5
5
  **`textarea` / `richText` / `html`** — plain multi-line notes → `textarea`; formatted text the *user* edits → `richText` (value is an HTML string, bindable only to a string field); markup *you* author → `html`. `html` interpolates `{{path}}` tokens but is never a home for record data — bind an element instead. `richText.collapseAfterLines` is inert once the element has a definite height (`heightMode` `fixed`/`fill`, or any pinned height): pin the height or collapse, never both.
6
6
 
@@ -34,4 +34,4 @@ Four types hold a value and get **no** automatic key: `table` (its edited rows),
34
34
 
35
35
  ## A type you have not met
36
36
 
37
- `suppa form-kb --mode components` lists all 56 with their purpose; `--mode api --types <type> --types <type>` gives the prop tables (a list flag repeats — it takes no JSON array), `--mode note --topic <type>` the behaviour note. Never assemble something out of `input` + `html` because no type came to mind.
37
+ `suppa form-kb --mode components` lists all 57 with their purpose; `--mode api --types <type> --types <type>` gives the prop tables (a list flag repeats — it takes no JSON array), `--mode note --topic <type>` the behaviour note. Never assemble something out of `input` + `html` because no type came to mind.
@@ -27,7 +27,14 @@ The live form is first-class columns on the `Forms` row:
27
27
  | `suppa form-versions --form-id <id>` | `GET /core/forms/:id/versions`, `…/versions/:v/diff?from=`, `…/change-sets` | Read-only. The diff is component ids added and removed. |
28
28
  | `suppa form-lifecycle --form-id <id> --action <a>` | `POST /core/forms/:id/publish` · `rollback/:v` · `discard` · `promote/:v` | publish freezes the EFFECTIVE schema as the new default version. **rollback restores the version over the draft AND publishes it.** **discard overwrites the draft with the live version and writes no change-set — unrecoverable.** promote changes which version users see. rollback and promote check the version against the form in the URL: a version of another form answers **404 `Version <v> is not a version of form <id>`** (entity-builder `form-publish.service.ts` `loadVersion`, since 167db88a, 2026-09-18), and the tool refuses one before sending. publish and rollback are gated against the live version. |
29
29
 
30
- **Reading the form** goes through the same server: `suppa_search_records` on `Forms` filtered by `id`, fields `schema`, `settings`, `updatedAt`, `lockedBy { id fullName }`, `lockedAt` (the draft, who holds it, and the revision), and on `FormVersions` filtered by `form.id` and `isDefault: true`, field `snapshot` (what users see). Save the answer to a file: the gate reads it as it is — a one-record `records` answer or a `snapshot` — as the baseline of an edit, and it is the only copy of an unpublished draft you are about to overwrite (a draft write leaves no version). `suppa_get_form` is the Suppa 1.0 `data` blob and shows nothing of a 2.x form.
30
+ **Reading the form** goes through the same server. `suppa_get_form` is the builder's own read (`GET /core/forms/:id/schema`):
31
+ - the draft's `schema`, `mobileSchema`, `settings`, `variables`, `localizations` and the Code Form's files (`code`);
32
+ - `revision` (the `expected_revision` of a write);
33
+ - with `version='published'`, the version this user sees (for a child form, the merged tree). It is for reading only: it carries no Code Form sources (only the compiled `codeArtifact`) and no parent, and `suppa_write_form_draft` refuses it. A published version comes back through `suppa_form_lifecycle` rollback.
34
+
35
+ The compiled bundle comes only with `include_artifact=true`. The answer is a `{ schema, settings, variables }` draft, so the gate and `suppa_write_form_draft` read it as it is. Who has the form open is `lockedBy` / `lockedAt` on `Forms` (`suppa_search_records`, filtered by `id`).
36
+
37
+ A one-record `suppa_search_records` answer and a FormVersions `snapshot` are read as they are too. Save the read to a file. It is the baseline of an edit, and it is the only copy of an unpublished draft you are about to overwrite (a draft write leaves no version). A Suppa 1.0 form answers `generation: "1.0"` with its row's `data` blob.
31
38
 
32
39
  ## Writing by hand: the generic update replaces whatever column it names
33
40