suppa-mcp-2 1.16.0 → 1.17.0

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.
@@ -434,7 +434,12 @@ export async function searchEntity(entity, filters = null, fields = null, limit
434
434
  offset: Math.max(0, offset),
435
435
  orderBy: orderBy !== null ? orderBy : [{ field: "createdAt", order: "desc" }],
436
436
  searchValue,
437
- getAccessByFields: true,
437
+ // data.txt:72 — "Adds $readAccess and $updateAccess to each record". Those
438
+ // arrays are the same field names on every row of an entity, and NOTHING in
439
+ // this server reads them: a token audit over 104 transcripts put them at a
440
+ // third of everything suppa tools ever returned. The platform omits them
441
+ // unless asked, and asking was inherited from the v1 client.
442
+ getAccessByFields: false,
438
443
  // data.txt:75 — includeDeletedRelations "Keep related records that are
439
444
  // soft-deleted. Defaults to true." This client used to hard-code false,
440
445
  // which silently dropped soft-deleted relations from every read: a deleted
@@ -451,7 +456,7 @@ export async function selectEntity(entity, filters, fields = null, deletedScope
451
456
  const body = {
452
457
  conditions: { operator: "and", filters },
453
458
  fields: fields || { id: true },
454
- getAccessByFields: true,
459
+ getAccessByFields: false, // data.txt:72 — see searchEntity
455
460
  includeDeletedRelations, // data.txt:75 (platform default true; was hard-coded false)
456
461
  deletedScope, // data.txt:76
457
462
  };
@@ -492,7 +497,10 @@ export async function validateSelect(entity, payload) {
492
497
  : null;
493
498
  }
494
499
  export async function insertEntity(entity, fieldsList, returning = null) {
495
- const body = { fields: fieldsList };
500
+ // data.txt:325 — on insert the flag "Defaults to TRUE", so a write answers
501
+ // with the access arrays unless it is told not to. Same reasoning as the read
502
+ // path: nothing here reads them.
503
+ const body = { fields: fieldsList, getAccessByFields: false };
496
504
  if (returning) {
497
505
  body.returning = returning;
498
506
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
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": {
@@ -175,8 +175,10 @@ function gateRoots(roots) {
175
175
  const notes = [];
176
176
  for (const root of [...new Set(roots)]) {
177
177
  const r = runGate(root);
178
- if (r.toolchain) notes.push(`${root}: ${r.toolchain}`);
179
- else if (r.skipped) notes.push(`${root}: ${r.skipped}`);
178
+ // "could not run" and "nothing to run on" are not the same answer, and the
179
+ // two layers that decide what LANDS have to tell them apart.
180
+ if (r.toolchain) notes.push({ kind: "toolchain", root, text: `${root}: ${r.toolchain}` });
181
+ else if (r.skipped) notes.push({ kind: "skipped", root, text: `${root}: ${r.skipped}` });
180
182
  else if (!r.ok) failures.push({ root, lines: r.lines });
181
183
  }
182
184
  return { failures, notes };
@@ -268,7 +270,7 @@ function postToolUse() {
268
270
  if (notes.length) {
269
271
  emitHookJson(
270
272
  "PostToolUse",
271
- `The entity-code gate could not run: ${notes.join("; ")}. Run it yourself before reporting ` +
273
+ `The entity-code gate could not run: ${notes.map((n) => n.text).join("; ")}. Run it yourself before reporting ` +
272
274
  `this file done — suppa_validate_entity_code(path=<app-root>).`,
273
275
  );
274
276
  }
@@ -293,10 +295,39 @@ function stop() {
293
295
  return 2;
294
296
  }
295
297
 
298
+ /**
299
+ * A gate that could not run must never answer "clean".
300
+ *
301
+ * The checker parses with the TypeScript OF THE REPO it is checking, and a repo
302
+ * without one makes validateSchema throw. That arrived here as a note, was
303
+ * dropped, and the commit hook printed "suppa entity-code gate: clean" over
304
+ * schema code nothing had looked at. The hooks stay fail-open on purpose — they
305
+ * advise an agent mid-edit and must not wall off every write — but the two
306
+ * layers that decide what LANDS refuse instead.
307
+ */
308
+ function toolchainRefusal(notes) {
309
+ const broken = notes.filter((n) => n.kind === "toolchain");
310
+ if (!broken.length) return null;
311
+ return (
312
+ "suppa entity-code gate: COULD NOT RUN — " +
313
+ broken.map((n) => n.text).join("; ") +
314
+ "\nNothing was checked, so nothing can be called clean. The checker parses with the " +
315
+ "application repo's own TypeScript: install it there (npm i -D typescript@5) and try again."
316
+ );
317
+ }
318
+
296
319
  function preCommit() {
297
320
  const files = stagedSchemaFiles(process.cwd()).filter((f) => !isIgnored(appRootFor(f), f));
298
321
  if (!files.length) return 0;
299
- const { failures } = gateRoots(files.map(appRootFor));
322
+ const { failures, notes } = gateRoots(files.map(appRootFor));
323
+ const broken = toolchainRefusal(notes);
324
+ if (broken) {
325
+ process.stderr.write(
326
+ `${broken}\nCommit refused. Pass --no-verify only if you mean to commit schema code that ` +
327
+ `nothing verified.\n`,
328
+ );
329
+ return 1;
330
+ }
300
331
  if (!failures.length) {
301
332
  process.stdout.write("suppa entity-code gate: clean\n");
302
333
  return 0;
@@ -311,7 +342,12 @@ function preCommit() {
311
342
  function ci(args) {
312
343
  const roots = args.length ? args.map((p) => resolve(p)) : [process.cwd()];
313
344
  const { failures, notes } = gateRoots(roots);
314
- for (const n of notes) process.stdout.write(`note: ${n}\n`);
345
+ for (const n of notes) process.stdout.write(`note: ${n.text}\n`);
346
+ const broken = toolchainRefusal(notes);
347
+ if (broken) {
348
+ process.stdout.write(`${broken}\n`);
349
+ return 1;
350
+ }
315
351
  if (!failures.length) {
316
352
  process.stdout.write("suppa entity-code gate: clean\n");
317
353
  return 0;