suppa-mcp-2 1.12.0 → 1.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.12.0",
3
+ "version": "1.12.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": {
@@ -39,16 +39,26 @@ import {
39
39
 
40
40
  const SCHEMA_NAME_RE = /\.(entity|seed)\.tsx?$/;
41
41
 
42
- /** Does this path hold schema code? Name first; content only if it exists. */
42
+ /**
43
+ * Does this path hold schema code?
44
+ *
45
+ * Decided by NAME, deliberately. A content sniff for `@Entity(` /
46
+ * `forFeature` also matches every file that merely talks about schema — this
47
+ * checker's own tests, a doc, a template — and firing the rules at an agent
48
+ * editing a test about entities is noise that teaches it to ignore them. The
49
+ * one non-`*.entity.ts` file that genuinely carries schema is the module doing
50
+ * the registration, so that name is included and nothing else is.
51
+ */
43
52
  function isSchemaPath(p) {
44
53
  if (!p || typeof p !== "string") return false;
45
54
  const norm = p.replace(/\\/g, "/");
55
+ if (/\.(test|spec)\.tsx?$/.test(norm) || norm.endsWith(".template.ts")) return false;
46
56
  if (SCHEMA_NAME_RE.test(norm)) return true;
47
- if (!/\.tsx?$/.test(norm) || /\.d\.ts$/.test(norm)) return false;
57
+ if (!/\.module\.tsx?$/.test(norm)) return false;
48
58
  try {
49
- return /EntityModule\.forFeature|@Entity\s*\(|createSeed\s*\(/.test(readFileSync(p, "utf-8"));
59
+ return /EntityModule\.forFeature/.test(readFileSync(p, "utf-8"));
50
60
  } catch {
51
- return false; // a file not written yet is judged by its name alone
61
+ return true; // a module not written yet: judged when the gate runs on it
52
62
  }
53
63
  }
54
64
 
@@ -1498,10 +1498,10 @@ function analyzeModules(ts, sf, model) {
1498
1498
  * an installed application, or created before this package. The sanctioned
1499
1499
  * shape is a STUB: `@Entity({ name: 'X', key: 'X' }) export class X extends
1500
1500
  * SystemBaseEntity {}` with an EMPTY body, one stub per file, registered in
1501
- * forFeature() alongside the created entities. MR 28 shipped the alternative:
1502
- * bare classes with no decorator at all, which satisfied the thunk at compile
1503
- * time and were invisible to every rule here — E101/E301 cannot see a class
1504
- * that never became an entity. So a target that is not among the analyzed
1501
+ * forFeature() alongside the created entities. The alternative that keeps
1502
+ * getting written is a bare class with no decorator at all, which satisfies the
1503
+ * thunk at compile time and is invisible to every rule here — E101/E301 cannot
1504
+ * see a class that never became an entity. So a target that is not among the analyzed
1505
1505
  * entities is CHASED through its import: the file that declares it is parsed,
1506
1506
  * its @Entity classes join the model (and answer to every entity rule,
1507
1507
  * E101/E301 included), and a class with no @Entity at all is E116.
@@ -1896,7 +1896,7 @@ function chaseRelationTargets(ts, model, findings, parsedByCanonical, rootDir) {
1896
1896
  /**
1897
1897
  * One stub, one file. A field-less entity class is an existing-entity stub;
1898
1898
  * sharing a file with any other entity class turns that file into a dumping
1899
- * ground — which is how four stand-ins ended up in one relation-targets.ts,
1899
+ * ground — which is how several stand-ins end up in one relation-targets.ts,
1900
1900
  * none of them registered. W616, a house rule: it blocks the strict gate.
1901
1901
  */
1902
1902
  function checkStubFiles(ts, model, findings) {