suppa-mcp-2 1.10.0 → 1.10.1

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
@@ -205,7 +205,7 @@ work normally. Erasing data for good is an admin action in the platform's own UI
205
205
  | `suppa_logout` | Remove stored credentials for a tenant |
206
206
  | `suppa_diagnostics` | Validate the whole multi-tenant setup |
207
207
  | `suppa_health_check` | Config + upstream connectivity check (reports `version`) |
208
- | `suppa_version` | Running build vs newest published, and how to upgrade |
208
+ | `suppa_version` | Running build vs newest published, and how to upgrade |
209
209
  | `suppa_validate_entity_code` | Run the schema gate over an app repo before calling entity code done |
210
210
 
211
211
  ### Tasks
@@ -373,15 +373,16 @@ search. Use the `write_entity_code` MCP prompt to drive it from any client.
373
373
 
374
374
  It also enforces the four **authoring rules** the platform doc does not: a
375
375
  relation property must carry a TypeScript type that agrees with its decorator
376
- (E114/E115/W610; a type naming no class, such as `any`, is the advisory W615),
377
- enum member keys are PascalCase (W611), no field option
378
- may be written at its platform default (W612), and `@Enum`/`@MultiEnum` take a
379
- global name only when the enum is actually shared (W613). Those four, plus
380
- `owner` first in a tabular part's `importKeyFields` (W607) and no `inverse` on
381
- `@ManyToOne`/`@ManyToMany` (W609), are **rule violations**: like errors, they
382
- exit 1, because a rule that only warns is a rule that gets ignored.
383
- `--no-strict` demotes them to warnings for a legacy repo.
384
- Advisory warnings — W601-W606, W608, W614, W615 — never block; they report what
376
+ (E114/E115/W610, and W615 when the type names no class at all — `any`), enum
377
+ member keys are PascalCase (W611), no field option may be written at its
378
+ platform default (W612), and `@Enum`/`@MultiEnum` take a global name only when
379
+ the enum is actually shared (W613). Those, plus `owner` first in a tabular
380
+ part's `importKeyFields` (W607) and no `inverse` on `@ManyToOne`/`@ManyToMany`
381
+ (W609), are the **rule violations** — W607, W609, W610, W611, W612, W613,
382
+ W615 — and like errors they exit 1, because a rule that only warns is a rule
383
+ that gets ignored. `--no-strict` demotes them for a legacy repo, and says so:
384
+ they print as `[rule violation, demoted]` and the summary ends `NOT a clean
385
+ run`. Advisory warnings — W601-W606, W608, W614 — never block; they report what
385
386
  the checker could not see.
386
387
 
387
388
  Tabular parts (owned child sub-tables like checklist items or order lines)
@@ -12,7 +12,7 @@
12
12
  * skills/suppa-entity-code/scripts/validate-suppa-schema.mjs — loaded from the
13
13
  * installed package, never reimplemented — reporting the same codes.
14
14
  */
15
- import { existsSync, statSync } from "node:fs";
15
+ import { existsSync, readFileSync, statSync } from "node:fs";
16
16
  import { dirname, isAbsolute, join, resolve } from "node:path";
17
17
  import { fileURLToPath, pathToFileURL } from "node:url";
18
18
  import { jsonResponse } from "../utils.js";
@@ -84,6 +84,28 @@ export async function validateEntityCode(path, strict = true) {
84
84
  }
85
85
  }
86
86
  else {
87
+ // A named file with no schema in it — a README, a tsconfig, a util — was
88
+ // analyzed and reported passed: true. "Checked and clean" having checked
89
+ // nothing is the one answer a gate must never give. (The CLI refuses the
90
+ // same input with exit 2.)
91
+ const isTypeScript = /\.tsx?$/.test(target) && !/\.d\.ts$/.test(target);
92
+ const looksLikeSchema = isTypeScript &&
93
+ (/\.(entity|seed)\.ts$/.test(target) ||
94
+ (() => {
95
+ try {
96
+ return /EntityModule\.forFeature|@Entity\s*\(|createSeed\s*\(/.test(readFileSync(target, "utf-8"));
97
+ }
98
+ catch {
99
+ return false;
100
+ }
101
+ })());
102
+ if (!looksLikeSchema) {
103
+ return jsonResponse({
104
+ error: `'${target}' contains no schema code, so nothing was analyzed and nothing was verified. ` +
105
+ "Expected *.entity.ts, *.seed.ts, or a .ts file containing EntityModule.forFeature — " +
106
+ "or point this at the application repo's ROOT, which is what it wants anyway.",
107
+ });
108
+ }
87
109
  files = [resolve(target)];
88
110
  }
89
111
  let res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
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": {
@@ -1971,6 +1971,10 @@ if (isMain) {
1971
1971
  // produced "0 error(s) … across 1 file(s)" and exit 0. That reads as "checked
1972
1972
  // and clean" when nothing was checked, which is how a gate lies.
1973
1973
  const schemaless = explicitFiles.filter((p) => {
1974
+ // Not TypeScript at all -> not schema, whatever prose it contains: this
1975
+ // package's own README documents "@Entity(" and so matched the content
1976
+ // sniff below, and the gate reported it clean.
1977
+ if (!/\.tsx?$/.test(p) || /\.d\.ts$/.test(p)) return true;
1974
1978
  if (/\.(entity|seed)\.ts$/.test(p)) return false;
1975
1979
  try {
1976
1980
  const text = readFileSync(p, "utf-8");