suppa-mcp-2 1.42.2 → 1.42.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/dist/auth.js CHANGED
@@ -124,16 +124,19 @@ export function extractCredentials(body, setCookies) {
124
124
  (typeof b.refresh_token === "string" ? b.refresh_token : "") ||
125
125
  "";
126
126
  }
127
- for (const cookie of setCookies) {
128
- const eq = cookie.indexOf("=");
129
- const name = (eq === -1 ? cookie : cookie.slice(0, eq)).trim();
130
- const rest = eq === -1 ? "" : cookie.slice(eq + 1);
131
- const val = rest.split(";", 1)[0].trim();
127
+ // The auth service answers with more than the two token cookies, in this order: an emptied
128
+ // `accessToken` and `refreshToken` (Max-Age=0 — it expires the other SameSite variant, BSU-3077),
129
+ // the device cookie `suppa_did`, and only then the real `accessToken` and `refreshToken`. So the
130
+ // first cookie of a name is not the token: take the first one that has a value and is not expired.
131
+ for (const { name, value, expired } of setCookies.flatMap(splitSetCookieHeader).map(parseSetCookie)) {
132
+ if (!value || expired) {
133
+ continue;
134
+ }
132
135
  if (name === "accessToken" && !access) {
133
- access = val;
136
+ access = value;
134
137
  }
135
138
  else if (name === "refreshToken" && !refresh) {
136
- refresh = val;
139
+ refresh = value;
137
140
  }
138
141
  }
139
142
  if (access && !aExp) {
@@ -149,6 +152,48 @@ export function extractCredentials(body, setCookies) {
149
152
  refreshExp: rExp,
150
153
  };
151
154
  }
155
+ /**
156
+ * Split a Set-Cookie value that holds several cookies joined with ", " — what `headers.get()`
157
+ * gives on a runtime without `getSetCookie`, or behind a proxy that folds the header — back into
158
+ * one cookie each. A comma starts a new cookie only when a `name=` follows it, so the comma inside
159
+ * `Expires=Thu, 01 Jan 1970 …` stays where it is.
160
+ */
161
+ export function splitSetCookieHeader(value) {
162
+ return value
163
+ .split(/,(?=\s*[!#$%&'*+\-.^_`|~0-9A-Za-z]+=)/)
164
+ .map((part) => part.trim())
165
+ .filter(Boolean);
166
+ }
167
+ /** One Set-Cookie line: its name, its value, and whether it deletes the cookie instead of setting it. */
168
+ function parseSetCookie(line) {
169
+ const [pair, ...attributes] = line.split(";");
170
+ const eq = pair.indexOf("=");
171
+ const name = (eq === -1 ? pair : pair.slice(0, eq)).trim();
172
+ const value = eq === -1 ? "" : pair.slice(eq + 1).trim();
173
+ let expired = false;
174
+ for (const attribute of attributes) {
175
+ const at = attribute.indexOf("=");
176
+ const key = (at === -1 ? attribute : attribute.slice(0, at)).trim().toLowerCase();
177
+ const arg = at === -1 ? "" : attribute.slice(at + 1).trim();
178
+ if (key === "max-age" && Number(arg) <= 0) {
179
+ expired = true;
180
+ }
181
+ else if (key === "expires" && Date.parse(arg) <= Date.now()) {
182
+ expired = true;
183
+ }
184
+ }
185
+ return { name, value, expired };
186
+ }
187
+ /** The cookies a response set, by name only — never a value — for an error that has to say what came. */
188
+ export function describeSetCookies(setCookies) {
189
+ const cookies = setCookies.flatMap(splitSetCookieHeader).map(parseSetCookie);
190
+ if (cookies.length === 0) {
191
+ return "no Set-Cookie at all";
192
+ }
193
+ return cookies
194
+ .map(({ name, value, expired }) => `${name}${!value ? " (empty)" : expired ? " (expired)" : ""}`)
195
+ .join(", ");
196
+ }
152
197
  // ---------------------------------------------------------------------------
153
198
  // Low-level network (auth endpoints only — no tenant auth headers)
154
199
  // ---------------------------------------------------------------------------
@@ -171,9 +216,10 @@ function readSetCookies(headers) {
171
216
  }
172
217
  try {
173
218
  if (typeof h.get === "function") {
219
+ // Without getSetCookie every Set-Cookie line comes back joined into one value.
174
220
  const single = h.get("set-cookie");
175
221
  if (single) {
176
- return [single];
222
+ return splitSetCookieHeader(single);
177
223
  }
178
224
  }
179
225
  }
@@ -527,7 +573,8 @@ export async function doRefresh(baseUrl, host, creds) {
527
573
  }
528
574
  const fresh = extractCredentials(body, cookies);
529
575
  if (!fresh.accessToken) {
530
- recordRefreshFailure(host, `the refresh endpoint returned HTTP 200 with no access token in it (${REFRESH_PATH})`);
576
+ recordRefreshFailure(host, `the refresh endpoint returned HTTP 200 with no access token in it (${REFRESH_PATH}; ` +
577
+ `cookies set: ${describeSetCookies(cookies)})`);
531
578
  throw new ReloginRequired(host);
532
579
  }
533
580
  if (!fresh.refreshToken) {
@@ -784,6 +831,9 @@ export async function login(tenant = "") {
784
831
  if (!creds.accessToken) {
785
832
  return JSON.stringify({
786
833
  error: "Login exchange returned no access token.",
834
+ // Names only, never values: what the platform set tells whether it sent the token at all.
835
+ cookies_set: describeSetCookies(result.cookies),
836
+ node: process.version,
787
837
  host,
788
838
  });
789
839
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.42.2",
3
+ "version": "1.42.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": {
@@ -69,7 +69,7 @@ rules — plus your own reading of the warnings — are what stands between that
69
69
  bind an element instead. Six pairs where both choices validate are in
70
70
  `references/choosing-elements.md`; read it before picking between `date` and `datePicker`,
71
71
  `textarea` and `richText`, `select` and `radio` and `buttonList` and `chips`, `image` and
72
- `files`, `entityList` and `table`, or reaching for `code`.
72
+ `files`, a `table` and the `entity-workspace` composition (`entityList` is gone), or reaching for `code`.
73
73
  5. **The prop table is the options panel, not the runtime.** A prop that validates is not a prop
74
74
  that works: `unknown_prop` catches an invented name, nothing catches a real name that the runtime
75
75
  ignores on that type. Never invent a prop or an option value, and read the type's note before
@@ -179,7 +179,7 @@ Read on demand, never up front — `suppa form-kb --mode ref --topic <name>`.
179
179
  | `references/choosing-elements.md` | Picking between two types that both validate |
180
180
  | `references/layout.md` | Sections, wizards, scroll regions, breakpoints, heights |
181
181
  | `references/binding.md` | `dataSource`, variables, filters, enum values |
182
- | `references/tables.md` | Any `table` or `entityList` |
182
+ | `references/tables.md` | Any `table` |
183
183
  | `references/charts.md` | Any `chart` — the one tall element with no automatic height |
184
184
  | `references/custom-chart.md` | `chartType: 'custom'` — named sources, the widget, `chart.*` |
185
185
  | `references/conditions.md` | `visible`/`readonly`/`required`/`disabled`/`readMode` as rules |
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "source": "suppa-ai-agent/packages/formbuilder-agent",
3
- "sha": "31991c65b88e189ff6b8e3c9fbcec0cb5e5ef815",
4
- "pulledAt": "2026-09-18",
3
+ "sha": "ece894241cc602c2712874158870183d492c08e0",
4
+ "pulledAt": "2026-10-05",
5
5
  "components": 58,
6
- "templates": 7,
7
- "coreBytes": 699440,
6
+ "templates": 8,
7
+ "coreBytes": 825827,
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
  }
@@ -14,7 +14,7 @@
14
14
  {
15
15
  "type": "approvals",
16
16
  "label": "Approvals",
17
- "category": "fields",
17
+ "category": "widgets",
18
18
  "purpose": "the record's approval flow — needs the entity option ON"
19
19
  },
20
20
  {
@@ -84,7 +84,7 @@
84
84
  {
85
85
  "type": "comments",
86
86
  "label": "Comments",
87
- "category": "fields",
87
+ "category": "widgets",
88
88
  "purpose": "the record's comment feed — needs the entity option ON"
89
89
  },
90
90
  {
@@ -120,7 +120,7 @@
120
120
  "type": "entityLayouts",
121
121
  "label": "Entity Layouts",
122
122
  "category": "workspace",
123
- "purpose": "an entityList's view area, decomposed — needs wiring to be useful"
123
+ "purpose": "the saved-views tab strip, their only owner — wire it to a data widget (template entity-workspace)"
124
124
  },
125
125
  {
126
126
  "type": "entityLinks",
@@ -128,17 +128,11 @@
128
128
  "category": "widgets",
129
129
  "purpose": "record-to-record connections"
130
130
  },
131
- {
132
- "type": "entityList",
133
- "label": "Entity List",
134
- "category": "workspace",
135
- "purpose": "a whole entity's records as one element, with its own view switcher"
136
- },
137
131
  {
138
132
  "type": "entityToolbar",
139
133
  "label": "Entity Toolbar",
140
134
  "category": "workspace",
141
- "purpose": "an entityList's toolbar, decomposed — needs wiring to be useful"
135
+ "purpose": "a record list's search / filters / Create strip — wire it to a data widget (template entity-workspace)"
142
136
  },
143
137
  {
144
138
  "type": "entityTree",
@@ -165,7 +159,7 @@
165
159
  {
166
160
  "type": "history",
167
161
  "label": "History",
168
- "category": "fields",
162
+ "category": "widgets",
169
163
  "purpose": "the record's change history — needs the entity option ON"
170
164
  },
171
165
  {
@@ -292,6 +286,12 @@
292
286
  "label": "Tab",
293
287
  "category": "structure"
294
288
  },
289
+ {
290
+ "type": "tasksGantt",
291
+ "label": "Tasks Gantt",
292
+ "category": "widgets",
293
+ "purpose": "the task manager's Gantt — shows the Tasks entity only (dataSource.entity is always 'Tasks')"
294
+ },
295
295
  {
296
296
  "type": "textarea",
297
297
  "label": "Text area",
@@ -323,7 +323,7 @@
323
323
  {
324
324
  "type": "usersOnline",
325
325
  "label": "Users online",
326
- "category": "fields",
326
+ "category": "widgets",
327
327
  "purpose": "who is looking at this record right now"
328
328
  },
329
329
  {