suppa-mcp-2 1.45.0 → 1.45.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 +10 -5
- package/dist/bin.js +32 -1
- package/dist/cli/api.js +102 -21
- package/dist/cli/run.js +5 -2
- package/dist/server.js +2 -1
- package/dist/startupRepair.js +1 -1
- package/dist/tools/entity.js +33 -0
- package/package.json +1 -1
- package/skills/suppa-cli/SKILL.md +12 -6
- package/skills/suppa-form-v2/code-form/SOURCE.json +3 -3
- package/skills/suppa-form-v2/scripts/code-form/code-form-core.mjs +8 -8
- package/skills/suppa-form-v2/scripts/form-core.mjs +24 -24
- package/skills/suppa-form-v2/scripts/validate-form-schema.mjs +42 -15
package/README.md
CHANGED
|
@@ -59,11 +59,16 @@ refused or not fully done (`passed: false`, `created: false`, a non-zero
|
|
|
59
59
|
For an endpoint no command covers there is `suppa api <METHOD> <path>` — the raw
|
|
60
60
|
call, with the CLI's session and tenant resolution. It exists only in the CLI,
|
|
61
61
|
never as an MCP tool, and it is gated because it skips every check the commands
|
|
62
|
-
make.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
make. Every call names its tenant with `--tenant` — reads too: on Windows,
|
|
63
|
+
`suppa.cmd` runs through cmd.exe, which ends the command at an `&`, so a flag after
|
|
64
|
+
a `?a=1&b=2` path never arrived and the read went to the remembered tenant. Query
|
|
65
|
+
parameters go as `--query key=value`, or the whole call as `--args-file`
|
|
66
|
+
{method, path, query, body, tenant}. Reads (GET, and POST to `…/select`,
|
|
67
|
+
`…/search`, `…/query`, `…/count`, and the register reads `registers/<name>/balance`,
|
|
68
|
+
`turnovers`, `balance-and-turnovers`, `movements`, `slice-last`, `slice-first`,
|
|
69
|
+
`registers/recorders/status`) are sent at once; what was sent is said on stderr.
|
|
70
|
+
Anything else prints the request and sends nothing until `--confirm`. The permanent
|
|
71
|
+
delete stays refused. `suppa help api` has the flags. In Git Bash, leave off the path's leading slash (`core/schema`): MSYS
|
|
67
72
|
rewrites an argument that starts with `/` into a Windows path, and the command
|
|
68
73
|
refuses that path and says why.
|
|
69
74
|
|
package/dist/bin.js
CHANGED
|
@@ -41,10 +41,41 @@ process.on("uncaughtException", (err) => {
|
|
|
41
41
|
* process at once, since no answer can arrive anyway.
|
|
42
42
|
*/
|
|
43
43
|
const DRAIN_MS = 30_000;
|
|
44
|
+
/**
|
|
45
|
+
* How long after its last answer the process waits before it is ended even though something still
|
|
46
|
+
* holds the event loop (the reason this exit exists: a Windows npx parent that never lets go).
|
|
47
|
+
*/
|
|
48
|
+
const EXIT_GRACE_MS = 1_000;
|
|
49
|
+
/**
|
|
50
|
+
* End the process — never with a process.exit() in the same breath as a fetch. On Windows,
|
|
51
|
+
* process.exit() right after a fetch aborts Node with 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN, libuv's
|
|
52
|
+
* assert on an async handle undici is still closing). Measured 2026-11-16, Node 26, ten children each,
|
|
53
|
+
* two fetches then exit: at 0 ms 10/10 crashed, at 50 ms 9/10, at 250 ms 0/10, at 1000 ms 0/10; a
|
|
54
|
+
* natural exit 0/10. A user reported the crash ("the suppa processes die with 0xC0000409"), and the
|
|
55
|
+
* in-flight test hit it as soon as one call made two requests. So: the exit code is set and stdin let go,
|
|
56
|
+
* the event loop ends the process when nothing holds it, and the hard exit — unref'd, so it never keeps
|
|
57
|
+
* the process alive itself — comes only after the grace.
|
|
58
|
+
*/
|
|
59
|
+
function endProcess() {
|
|
60
|
+
process.exitCode = 0;
|
|
61
|
+
try {
|
|
62
|
+
process.stdin.destroy();
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
/* already gone */
|
|
66
|
+
}
|
|
67
|
+
setTimeout(() => process.exit(0), EXIT_GRACE_MS).unref();
|
|
68
|
+
}
|
|
44
69
|
function exitWhenClientIsGone(transport) {
|
|
45
70
|
const inFlight = new Set();
|
|
46
71
|
let leaving = false;
|
|
47
|
-
|
|
72
|
+
let ended = false;
|
|
73
|
+
const done = () => {
|
|
74
|
+
if (ended)
|
|
75
|
+
return;
|
|
76
|
+
ended = true;
|
|
77
|
+
endProcess();
|
|
78
|
+
};
|
|
48
79
|
const deliver = transport.onmessage;
|
|
49
80
|
transport.onmessage = (message, extra) => {
|
|
50
81
|
if (message && message.method !== undefined && message.id !== undefined)
|
package/dist/cli/api.js
CHANGED
|
@@ -8,11 +8,15 @@
|
|
|
8
8
|
* there). So the user's decision (2026-09-29) is the gate:
|
|
9
9
|
*
|
|
10
10
|
* - CLI only. There is no MCP tool for it.
|
|
11
|
-
* - Reads run at once: GET,
|
|
12
|
-
* `resolve` is NOT one —
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* - Reads run at once: GET, a POST whose last segment is select / search / query / count, and the
|
|
12
|
+
* register reads listed in READ_POST_PATHS. `resolve` is NOT one —
|
|
13
|
+
* `/forms/:id/inheritance-issues/:id/resolve` writes.
|
|
14
|
+
* - Anything else prints the request and sends nothing. With `--confirm` it is sent.
|
|
15
|
+
* - EVERY call names its tenant (`--tenant`, or `tenant` in --args-file) — since 2026-11-16, reads
|
|
16
|
+
* too. A Windows shell cuts a command at an `&`: through `suppa.cmd` (cmd.exe), PowerShell's
|
|
17
|
+
* `suppa api GET "core/x?a=1&b=2" --tenant t` arrives as `api GET core/x?a=1` — the `--tenant` is
|
|
18
|
+
* gone and the read went to the remembered tenant without a word (reported 2026-11-16). A call
|
|
19
|
+
* that must name its tenant is refused instead, and the refusal says why.
|
|
16
20
|
* - The platform's permanent delete is refused whatever is passed (the same block the HTTP
|
|
17
21
|
* client enforces on every request, checked here first so it is never offered as a preview).
|
|
18
22
|
*/
|
|
@@ -22,32 +26,57 @@ import { pointAtTenant } from "./tenantPoint.js";
|
|
|
22
26
|
import { readOnlyProblem } from "../tools/query.js";
|
|
23
27
|
export const API_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
24
28
|
export const READ_POST_SUFFIXES = ["select", "search", "query", "count"];
|
|
25
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* POST endpoints that only read, by their exact shape — read in entity-builder (develop, 2026-11-16)
|
|
31
|
+
* registers.controller.ts: `recorders/status` (RegisterRecorderService.statuses) and the register
|
|
32
|
+
* reads `:name/balance | turnovers | balance-and-turnovers | movements | slice-last | slice-first`
|
|
33
|
+
* (RegisterQueryService — SELECTs through engineRead). NOT here, because they write or start work:
|
|
34
|
+
* `:name/balance/job` (a background job), `recorders/:e/:id/repost`, `repost`, `:name/check`,
|
|
35
|
+
* `:name/totals/rebuild`, `:name/held/release`, `violations/:id/resolve`, the jobs' pause / resume / cancel.
|
|
36
|
+
*/
|
|
37
|
+
export const READ_POST_PATHS = [
|
|
38
|
+
/^\/api\/core\/registers\/recorders\/status$/,
|
|
39
|
+
/^\/api\/core\/registers\/[^/]+\/(balance|turnovers|balance-and-turnovers|movements|slice-last|slice-first)$/,
|
|
40
|
+
];
|
|
41
|
+
/** A read is sent at once; a write is shown first. Decided from the method and the path. */
|
|
26
42
|
export function classify(method, path) {
|
|
27
43
|
const m = method.toUpperCase();
|
|
28
44
|
if (m === "GET")
|
|
29
45
|
return "read";
|
|
30
46
|
if (m !== "POST")
|
|
31
47
|
return "write";
|
|
32
|
-
const
|
|
48
|
+
const bare = path.split("?")[0];
|
|
49
|
+
if (READ_POST_PATHS.some((re) => re.test(bare)))
|
|
50
|
+
return "read";
|
|
51
|
+
const last = bare.split("/").filter(Boolean).pop() ?? "";
|
|
33
52
|
return READ_POST_SUFFIXES.includes(last) ? "read" : "write";
|
|
34
53
|
}
|
|
54
|
+
/** What the refusal says when no tenant arrived — the `&` cut is the likely reason, so it is named. */
|
|
55
|
+
export const NO_TENANT_REFUSAL = "a raw call names its tenant: add --tenant <alias> (or `tenant` in --args-file). If you DID pass " +
|
|
56
|
+
"--tenant, the shell cut the command before it: through suppa.cmd (cmd.exe — PowerShell runs it too) " +
|
|
57
|
+
"an `&` ends the command, so `core/x?a=1&b=2 --tenant t` arrives as `core/x?a=1`. Pass parameters with " +
|
|
58
|
+
"--query key=value, or the whole call with --args-file.";
|
|
35
59
|
export const API_HELP = "suppa api <METHOD> <path> — a raw call to the platform API, with this CLI's session and tenant.\n\n" +
|
|
36
60
|
" METHOD GET POST PUT PATCH DELETE\n" +
|
|
37
61
|
" path /api/core/… or /core/… (a ?query in it is moved into --query); the\n" +
|
|
38
62
|
" leading slash is optional — in Git Bash leave it off (core/schema)\n" +
|
|
39
|
-
" --
|
|
63
|
+
" --tenant <alias> the tenant for this call — REQUIRED, reads included\n" +
|
|
64
|
+
" --query <k=v> a query parameter; repeat the flag per parameter — never `&` in the path\n" +
|
|
65
|
+
" on Windows: cmd.exe (suppa.cmd) cuts the command there\n" +
|
|
40
66
|
" --body-file <json> the request body, from a file\n" +
|
|
41
67
|
" --body-stdin the request body, from standard input\n" +
|
|
68
|
+
" --args-file <json> the call as one JSON object {method, path, query, body, tenant} — the way\n" +
|
|
69
|
+
" past a shell that cuts at `&` or garbles non-ASCII; flags win over it\n" +
|
|
42
70
|
" --confirm send a write (see below)\n" +
|
|
43
|
-
" --tenant <alias> the tenant for this call — REQUIRED to send a write\n" +
|
|
44
71
|
" --pretty re-indent the JSON answer\n\n" +
|
|
45
|
-
"Reads — GET,
|
|
46
|
-
"
|
|
47
|
-
"
|
|
72
|
+
"Reads — GET, POST to …/select, …/search, …/query, …/count, and the register reads (registers/\n" +
|
|
73
|
+
"recorders/status, registers/<name>/balance | turnovers | balance-and-turnovers | movements |\n" +
|
|
74
|
+
"slice-last | slice-first) — are sent at once. Anything else is a write: without --confirm it\n" +
|
|
75
|
+
"prints the request and sends nothing. What was sent is said on stderr (→ METHOD url). A raw call\n" +
|
|
48
76
|
"skips every check the operation commands make — prefer one when it exists (suppa help <group>).\n" +
|
|
49
77
|
"The platform's permanent delete (/core/data/<entity>/delete) is refused always; /remove is the\n" +
|
|
50
78
|
"reversible delete.\n";
|
|
79
|
+
const ARGS_FILE_KEYS = ["method", "path", "query", "body", "tenant"];
|
|
51
80
|
export async function runApi(argv, io) {
|
|
52
81
|
const { out, err, stdin } = io;
|
|
53
82
|
const refuse = (...lines) => {
|
|
@@ -59,6 +88,7 @@ export async function runApi(argv, io) {
|
|
|
59
88
|
const query = {};
|
|
60
89
|
let bodyFile = null;
|
|
61
90
|
let bodyStdin = false;
|
|
91
|
+
let argsFile = null;
|
|
62
92
|
let confirm = false;
|
|
63
93
|
let tenant = null;
|
|
64
94
|
let pretty = false;
|
|
@@ -110,6 +140,9 @@ export async function runApi(argv, io) {
|
|
|
110
140
|
case "--body-stdin":
|
|
111
141
|
bodyStdin = bare();
|
|
112
142
|
break;
|
|
143
|
+
case "--args-file":
|
|
144
|
+
argsFile = value();
|
|
145
|
+
break;
|
|
113
146
|
case "--confirm":
|
|
114
147
|
confirm = bare();
|
|
115
148
|
break;
|
|
@@ -120,14 +153,55 @@ export async function runApi(argv, io) {
|
|
|
120
153
|
pretty = bare();
|
|
121
154
|
break;
|
|
122
155
|
default:
|
|
123
|
-
problems.push(`unknown flag ${flag} — this command takes --query, --body-file, --body-stdin, --
|
|
156
|
+
problems.push(`unknown flag ${flag} — this command takes --tenant, --query, --body-file, --body-stdin, --args-file, --confirm, --pretty`);
|
|
124
157
|
}
|
|
125
158
|
}
|
|
126
159
|
if (problems.length)
|
|
127
160
|
return refuse(...problems);
|
|
161
|
+
// ---- --args-file: the whole call as JSON, for what a shell cannot carry -------------------
|
|
162
|
+
// Command-line values win, as in every other command: the file fills only what the line left out.
|
|
163
|
+
let fileBody = undefined;
|
|
164
|
+
if (argsFile !== null) {
|
|
165
|
+
let parsed;
|
|
166
|
+
try {
|
|
167
|
+
const text = readFileSync(argsFile, "utf-8");
|
|
168
|
+
parsed = JSON.parse(text.charCodeAt(0) === 0xfeff ? text.slice(1) : text);
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
return refuse(`--args-file ${argsFile}: ${e instanceof Error ? e.message : String(e)}`);
|
|
172
|
+
}
|
|
173
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
174
|
+
return refuse(`--args-file ${argsFile} must hold a JSON object: {"method": "GET", "path": "core/…", "tenant": "…"}`);
|
|
175
|
+
}
|
|
176
|
+
const obj = parsed;
|
|
177
|
+
const unknown = Object.keys(obj).filter((k) => !ARGS_FILE_KEYS.includes(k));
|
|
178
|
+
if (unknown.length) {
|
|
179
|
+
return refuse(`unknown key${unknown.length > 1 ? "s" : ""} ${unknown.join(", ")} in --args-file — it takes ${ARGS_FILE_KEYS.join(", ")}; --confirm stays on the command line`);
|
|
180
|
+
}
|
|
181
|
+
for (const k of ["method", "path", "tenant"]) {
|
|
182
|
+
if (obj[k] !== undefined && typeof obj[k] !== "string")
|
|
183
|
+
return refuse(`--args-file: "${k}" must be a string`);
|
|
184
|
+
}
|
|
185
|
+
if (obj.query !== undefined) {
|
|
186
|
+
if (!obj.query || typeof obj.query !== "object" || Array.isArray(obj.query))
|
|
187
|
+
return refuse('--args-file: "query" must be an object of key → value');
|
|
188
|
+
for (const [k, v] of Object.entries(obj.query)) {
|
|
189
|
+
if (!(k in query))
|
|
190
|
+
query[k] = typeof v === "string" ? v : JSON.stringify(v);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (positional.length === 0 && typeof obj.method === "string")
|
|
194
|
+
positional.push(obj.method);
|
|
195
|
+
if (positional.length === 1 && typeof obj.path === "string")
|
|
196
|
+
positional.push(obj.path);
|
|
197
|
+
if (tenant === null && typeof obj.tenant === "string")
|
|
198
|
+
tenant = obj.tenant;
|
|
199
|
+
if (obj.body !== undefined)
|
|
200
|
+
fileBody = obj.body;
|
|
201
|
+
}
|
|
128
202
|
const [rawMethod, rawPath, ...extra] = positional;
|
|
129
203
|
if (!rawMethod || !rawPath)
|
|
130
|
-
return refuse("give a METHOD and a path: suppa api GET
|
|
204
|
+
return refuse("give a METHOD and a path: suppa api GET core/schema --tenant <alias>");
|
|
131
205
|
if (extra.length)
|
|
132
206
|
return refuse(`unexpected argument${extra.length > 1 ? "s" : ""}: ${extra.join(" ")}`);
|
|
133
207
|
const method = rawMethod.toUpperCase();
|
|
@@ -186,14 +260,21 @@ export async function runApi(argv, io) {
|
|
|
186
260
|
return refuse(`the body is not valid JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
187
261
|
}
|
|
188
262
|
}
|
|
263
|
+
else if (fileBody !== undefined) {
|
|
264
|
+
if (method === "GET")
|
|
265
|
+
return refuse("a GET carries no body — put it in \"query\" in --args-file, or use POST");
|
|
266
|
+
body = fileBody;
|
|
267
|
+
}
|
|
189
268
|
// ---- the tenant, and the gate -----------------------------------------
|
|
269
|
+
if (tenant === null)
|
|
270
|
+
return refuse(NO_TENANT_REFUSAL);
|
|
190
271
|
const point = await pointAtTenant(tenant, err);
|
|
191
272
|
if (!point.ok)
|
|
192
273
|
return 2;
|
|
193
274
|
let kind = classify(method, path);
|
|
194
275
|
// `…/query` is a read only for what suppa_query itself would send. The engine is SELECT-only,
|
|
195
|
-
// but "read" here means "sent at once
|
|
196
|
-
//
|
|
276
|
+
// but "read" here means "sent at once" — so a statement suppa_query would refuse is shown and
|
|
277
|
+
// gated like any write instead.
|
|
197
278
|
let readRefusedBecause = null;
|
|
198
279
|
if (kind === "read" && path === "/api/core/data/query") {
|
|
199
280
|
const statement = body && typeof body === "object" ? body.query : undefined;
|
|
@@ -214,17 +295,17 @@ export async function runApi(argv, io) {
|
|
|
214
295
|
out(JSON.stringify({
|
|
215
296
|
status: "confirmation_required",
|
|
216
297
|
message: "NOT sent. A raw write skips every check the operation commands make. Show this request to " +
|
|
217
|
-
"the user; to send it, re-run with --confirm
|
|
218
|
-
"remembered tenant by default.",
|
|
298
|
+
"the user; to send it, re-run with --confirm.",
|
|
219
299
|
would_send: request,
|
|
220
300
|
...(readRefusedBecause ? { read_refused_because: readRefusedBecause } : {}),
|
|
221
301
|
}, null, pretty ? 2 : undefined) + "\n");
|
|
222
302
|
return 0;
|
|
223
303
|
}
|
|
224
|
-
if (kind === "write" && !point.explicit) {
|
|
225
|
-
return refuse(`a raw write names its tenant: add --tenant <alias>. Without it this would go to the remembered tenant, ${point.host}.`);
|
|
226
|
-
}
|
|
227
304
|
// ---- send -------------------------------------------------------------
|
|
305
|
+
// Said on stderr, so it never mixes into the JSON answer: the tenant and the query that really
|
|
306
|
+
// went — a parameter a shell cut off is visible here rather than as a silently shorter answer.
|
|
307
|
+
const qs = Object.keys(query).length ? `?${new URLSearchParams(query).toString()}` : "";
|
|
308
|
+
err(`→ ${method} https://${point.host}${path}${qs}\n`);
|
|
228
309
|
let answer;
|
|
229
310
|
try {
|
|
230
311
|
answer = await makeRequest(method, path, body, { raw: true, ...(Object.keys(query).length ? { query } : {}) });
|
package/dist/cli/run.js
CHANGED
|
@@ -106,10 +106,13 @@ function parseArgsObject(text, source) {
|
|
|
106
106
|
* (migrate: 2 done, 3 failed used to exit 0). A nested `error` is NOT a
|
|
107
107
|
* refusal: create_entity answers {entity, title_field: {error}} when the
|
|
108
108
|
* entity exists and only a sub-step failed. {status: "confirmation_required"}
|
|
109
|
-
* exits 0 deliberately — it is a prompt, not a failure.
|
|
109
|
+
* exits 0 deliberately — it is a prompt, not a failure. An `error` that is null, false or "" is the
|
|
110
|
+
* ABSENCE of one: set_title_field answers `error: null` on success, and the key alone made a done call
|
|
111
|
+
* exit 1 (reported 2026-11-16).
|
|
110
112
|
*/
|
|
111
113
|
export function answerFailed(answer) {
|
|
112
|
-
|
|
114
|
+
const e = answer.error;
|
|
115
|
+
if (e !== undefined && e !== null && e !== false && e !== "")
|
|
113
116
|
return true;
|
|
114
117
|
for (const key of ["passed", "created", "applied", "ok", "success"]) {
|
|
115
118
|
if (answer[key] === false)
|
package/dist/server.js
CHANGED
|
@@ -912,7 +912,8 @@ export function buildToolTable() {
|
|
|
912
912
|
// Entity tools
|
|
913
913
|
// =========================================================================
|
|
914
914
|
reg("suppa_list_entities", {
|
|
915
|
-
description: "List all entities (database tables) on the platform
|
|
915
|
+
description: "List all entities (database tables) on the platform, tabular parts too (type\n" +
|
|
916
|
+
" 'tabular-part', with their owner). Optionally filter by name.",
|
|
916
917
|
inputSchema: {
|
|
917
918
|
search: z
|
|
918
919
|
.string()
|
package/dist/startupRepair.js
CHANGED
|
@@ -57,7 +57,7 @@ export function missingModule(err) {
|
|
|
57
57
|
export function npxCacheDir(fromPath) {
|
|
58
58
|
if (!fromPath)
|
|
59
59
|
return null;
|
|
60
|
-
// A file:// URL is not a path, and its percent-encoding (
|
|
60
|
+
// A file:// URL is not a path, and its percent-encoding (JOHNDO%7E1) does
|
|
61
61
|
// not name a real directory. Passing one here once produced a confident
|
|
62
62
|
// "Removed the broken cache directory file:///C:/..." for a removal that
|
|
63
63
|
// never happened, so this refuses rather than guesses: callers convert with
|
package/dist/tools/entity.js
CHANGED
|
@@ -679,8 +679,41 @@ export async function listEntities(search = "", full = false) {
|
|
|
679
679
|
return e;
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
|
+
if (Array.isArray(result))
|
|
683
|
+
result = [...result, ...(await _tabularPartRows(result, search, full))];
|
|
682
684
|
return jsonResponse(result);
|
|
683
685
|
}
|
|
686
|
+
/**
|
|
687
|
+
* The tabular parts, for the end of the listing. GET /core/schema leaves them out by design — it lists
|
|
688
|
+
* only entities with no `relationEntity` (entity-builder schema.controller getEntities), so a tenant's
|
|
689
|
+
* `OrderItems` never showed in suppa_list_entities (reported 2026-11-16). The platform lists them apart:
|
|
690
|
+
* GET /core/schema/tabular-parts → `{ id, name, type: 'tabular-part', relationEntity: { id, name } }`.
|
|
691
|
+
* Each comes back as `{ id, name, type: "tabular-part", owner }`. A stand that does not answer that
|
|
692
|
+
* route lists as it did before; a part the main listing already has is not repeated.
|
|
693
|
+
*/
|
|
694
|
+
async function _tabularPartRows(listed, search, full) {
|
|
695
|
+
let parts;
|
|
696
|
+
try {
|
|
697
|
+
parts = await makeRequest("GET", "/api/core/schema/tabular-parts");
|
|
698
|
+
}
|
|
699
|
+
catch {
|
|
700
|
+
return [];
|
|
701
|
+
}
|
|
702
|
+
if (!Array.isArray(parts))
|
|
703
|
+
return [];
|
|
704
|
+
const have = new Set(listed.filter(isPlainObject).map((e) => String(e.name ?? "")));
|
|
705
|
+
const needle = search.toLowerCase();
|
|
706
|
+
return parts
|
|
707
|
+
.filter(isPlainObject)
|
|
708
|
+
.map((p) => {
|
|
709
|
+
const row = p;
|
|
710
|
+
const owner = isPlainObject(row.relationEntity) ? row.relationEntity.name ?? null : null;
|
|
711
|
+
return { row, owner: typeof owner === "string" ? owner : null };
|
|
712
|
+
})
|
|
713
|
+
.filter(({ row, owner }) => typeof row.name === "string" && !have.has(row.name))
|
|
714
|
+
.filter(({ row, owner }) => !needle || String(row.name).toLowerCase().includes(needle) || (owner ?? "").toLowerCase().includes(needle))
|
|
715
|
+
.map(({ row, owner }) => (full ? row : { id: row.id, name: row.name, type: "tabular-part", owner }));
|
|
716
|
+
}
|
|
684
717
|
/**
|
|
685
718
|
* The searchable text of a title. Titles are localized objects ({en, uk, ...});
|
|
686
719
|
* String() on one is "[object Object]", so no localized title ever matched and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suppa-mcp-2",
|
|
3
|
-
"version": "1.45.
|
|
3
|
+
"version": "1.45.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": {
|
|
@@ -17,7 +17,10 @@ Never ask the user for a token: `suppa login` is the way in.
|
|
|
17
17
|
|
|
18
18
|
JSON, non-ASCII text or typed numbers go through `--args-file <path>` (a JSON
|
|
19
19
|
object of arguments) or `--args-stdin` — never through quoted inline JSON, which
|
|
20
|
-
PowerShell rewrites silently.
|
|
20
|
+
PowerShell rewrites silently. On Windows `suppa` from PowerShell or cmd runs
|
|
21
|
+
`suppa.cmd`, and cmd.exe ENDS the command at an `&` — every flag after it is lost
|
|
22
|
+
— and may garble non-ASCII: keep both in `--args-file`, or run from Git Bash.
|
|
23
|
+
`--tenant <alias>` points one call elsewhere
|
|
21
24
|
without remembering it; `--pretty` re-indents the answer. Exit codes: `0` done,
|
|
22
25
|
`1` the tool or the platform refused, or the answer says the work is not done
|
|
23
26
|
(`passed: false`, `created: false`, a non-zero `failed`), `2` refused before
|
|
@@ -28,11 +31,14 @@ next flag is refused.
|
|
|
28
31
|
Writes are gated — an update, move, close or delete does nothing without
|
|
29
32
|
`--confirm`. Show the user what will change, get their word, then re-run with it.
|
|
30
33
|
|
|
31
|
-
For an endpoint no command covers, `suppa api <METHOD> <path
|
|
32
|
-
call with this session
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
For an endpoint no command covers, `suppa api <METHOD> <path> --tenant <alias>`
|
|
35
|
+
makes the raw call with this session — every call names its tenant, reads too.
|
|
36
|
+
Reads (GET; POST to …/select, …/search, …/query, …/count, and the register reads
|
|
37
|
+
such as registers/<name>/balance and registers/recorders/status) go at once.
|
|
38
|
+
Anything else only prints the request; `--confirm` sends it. Query parameters go
|
|
39
|
+
as `--query key=value`, never `&` in the path; the whole call fits in
|
|
40
|
+
`--args-file` as {method, path, query, body, tenant}. It skips every check the
|
|
41
|
+
commands make, so prefer a command when one exists.
|
|
36
42
|
In Git Bash write the path without its leading slash (`core/schema`): MSYS
|
|
37
43
|
rewrites an argument that starts with `/` into a Windows path.
|
|
38
44
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": "platform-front (suppa front)",
|
|
3
|
-
"ref": "
|
|
3
|
+
"ref": "41a0f90a2e426b8a745353cf29685feab24202aa",
|
|
4
4
|
"commit": "41a0f90a2e426b8a745353cf29685feab24202aa",
|
|
5
5
|
"committed": "2026-11-12",
|
|
6
|
-
"pulledAt": "2026-11-
|
|
6
|
+
"pulledAt": "2026-11-16",
|
|
7
7
|
"files": {
|
|
8
8
|
"code-form/sdk/index.d.ts": {
|
|
9
9
|
"from": "src/formBuilderV2/codeForm/virtualProject/generatedSdkDts.ts (CODE_FORM_SDK_DTS)",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"scripts/code-form/code-form-core.mjs": {
|
|
14
14
|
"from": "codeForm/typeGen, codeForm/virtualProject, codeForm/diagnostics, codeForm/files, chart/custom/customChartSchema, shared/dynamicWidget/widgetApiKeys",
|
|
15
|
-
"bytes":
|
|
15
|
+
"bytes": 22269
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"why": "Vendored, not depended on. The backend builds a form's code against ITS OWN SDK copy, so a check against a stale snapshot can pass here and fail on save (or the reverse) — re-run scripts/sync-code-form.mjs after every front release that touches Code Form."
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// VENDORED from the front (
|
|
1
|
+
// VENDORED from the front (41a0f90a2e426b8a745353cf29685feab24202aa 41a0f90a2e, 2026-11-12) by scripts/sync-code-form.mjs — do not edit.
|
|
2
2
|
// The Code Form editor's own generators and rules: what suppa_form_code types a form's code with.
|
|
3
3
|
export const FRONT_COMMIT = "41a0f90a2e426b8a745353cf29685feab24202aa";
|
|
4
4
|
export const FORBIDDEN_IMPORT_TEXT = "Only relative imports, “{'@'}suppa/frontend-sdk” and shared modules (“{'@'}shared/…”) are allowed in Code Form.";
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// src/formBuilderV2/codeForm/typeGen/CodeFormTypeGenerator.ts
|
|
7
7
|
var PRESENTATION_TYPE_NAMES = {
|
|
8
8
|
desktop: { elements: "DesktopFormElements", api: "DesktopFormAPI" },
|
|
9
9
|
mobile: { elements: "MobileFormElements", api: "MobileFormAPI" }
|
|
@@ -156,7 +156,7 @@ function variableApiType(variable) {
|
|
|
156
156
|
return `VariableApiFor<'${escapeStringLiteral(variable.type)}'>`;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
//
|
|
159
|
+
// src/formBuilderV2/elements/chart/custom/customChartSchema.ts
|
|
160
160
|
var PROTOTYPE_NAMES = new Set(Object.getOwnPropertyNames(Object.prototype));
|
|
161
161
|
function measureKeyOf(measure) {
|
|
162
162
|
return measure.key || measure.id;
|
|
@@ -171,7 +171,7 @@ function customSourcesOfSchema(schema) {
|
|
|
171
171
|
return Object.entries(sources).map(([name, source]) => ({ name, measures: measureKeysOf(source) }));
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
//
|
|
174
|
+
// src/formBuilderV2/shared/dynamicWidget/widgetApiKeys.ts
|
|
175
175
|
var DEFINE_API = "defineApi";
|
|
176
176
|
var MEMBER_KEY = /^(?:(get|set)\s+)?(?:async\s+)?\*?\s*(?:(['"])((?:[^'"\\]|\\.)+)\2|([\p{ID_Start}_$][\p{ID_Continue}$]*))\s*(\(|:)?/u;
|
|
177
177
|
var VALUE_LITERAL = /^(?:-?\d|['"`[{/]|true\b|false\b|null\b|undefined\b|new\b)/;
|
|
@@ -376,7 +376,7 @@ function parseMember(part) {
|
|
|
376
376
|
return { name, kind: "method" };
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
//
|
|
379
|
+
// src/formBuilderV2/codeForm/virtualProject/CodeFormVirtualProject.ts
|
|
380
380
|
var SDK_LIB_PATH = "file:///node_modules/@suppa/frontend-sdk/index.d.ts";
|
|
381
381
|
var USER_FILE_SCHEME = "file:///";
|
|
382
382
|
var CODE_FORM_LIB = ["es2023"];
|
|
@@ -492,7 +492,7 @@ export {};
|
|
|
492
492
|
`.trimStart();
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
-
//
|
|
495
|
+
// src/formBuilderV2/codeForm/runtime/moduleSyntax.ts
|
|
496
496
|
var SHARED_PREFIX = "@shared/";
|
|
497
497
|
var SHARED_MODULE_NAME = /^[A-Za-z0-9_][A-Za-z0-9._-]*$/;
|
|
498
498
|
function sharedModuleName(specifier) {
|
|
@@ -501,7 +501,7 @@ function sharedModuleName(specifier) {
|
|
|
501
501
|
return SHARED_MODULE_NAME.test(name) ? name : null;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
//
|
|
504
|
+
// src/formBuilderV2/codeForm/diagnostics/CodeFormDiagnostics.ts
|
|
505
505
|
var FORBIDDEN_IMPORT_MESSAGE_KEY = "formBuilder.code.forbiddenImport";
|
|
506
506
|
var STATIC_IMPORT_RE = /(?:\bimport\b|\bexport\b)(?:[^'"();]*?\bfrom\b)?\s*(['"])([^'"]+)\1/g;
|
|
507
507
|
var DYNAMIC_IMPORT_RE = /\bimport\s*\(\s*(['"])([^'"]+)\1\s*\)/g;
|
|
@@ -545,7 +545,7 @@ function collectForbidden(code, regex, found) {
|
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
|
|
548
|
-
//
|
|
548
|
+
// src/formBuilderV2/codeForm/files/CodeFormFileUtils.ts
|
|
549
549
|
var ENTRY_PATH = "src/index.ts";
|
|
550
550
|
export {
|
|
551
551
|
CODE_FORM_LIB,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/generated/v2-component-manifest.js
|
|
2
2
|
var rawV2Manifest = {
|
|
3
3
|
"version": 2,
|
|
4
4
|
"basePropMeta": [
|
|
@@ -1513,7 +1513,7 @@ var rawV2Manifest = {
|
|
|
1513
1513
|
};
|
|
1514
1514
|
var v2_component_manifest_default = rawV2Manifest;
|
|
1515
1515
|
|
|
1516
|
-
//
|
|
1516
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/manifest.js
|
|
1517
1517
|
var V2_ELEMENT_TYPES = [
|
|
1518
1518
|
// base 12 (post-2.1; `dateView` removed)
|
|
1519
1519
|
"input",
|
|
@@ -1684,7 +1684,7 @@ function v2ReadModeOptInTypes(m) {
|
|
|
1684
1684
|
}
|
|
1685
1685
|
var v2ComponentManifest = loadV2Manifest(v2_component_manifest_default);
|
|
1686
1686
|
|
|
1687
|
-
//
|
|
1687
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/util.js
|
|
1688
1688
|
function isObj(v) {
|
|
1689
1689
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
1690
1690
|
}
|
|
@@ -1695,7 +1695,7 @@ function deepEqualJson(a, b) {
|
|
|
1695
1695
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
//
|
|
1698
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/customChart.js
|
|
1699
1699
|
var CUSTOM_NAME_PATTERN = /^[a-z][A-Za-z0-9_]*$/;
|
|
1700
1700
|
var PROTOTYPE_NAMES = new Set(Object.getOwnPropertyNames(Object.prototype));
|
|
1701
1701
|
function isCustomCodeName(name) {
|
|
@@ -1783,7 +1783,7 @@ function deriveCodeName(text, taken, fallback) {
|
|
|
1783
1783
|
return `${base}${n}`;
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
//
|
|
1786
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/generated/v2-icon-registry.js
|
|
1787
1787
|
var V2_ICON_NAMES = ["add", "addChat", "addPlan", "addUser", "agents", "ai", "alert", "alignCenter", "alignEnd", "alignStart", "alignStretch", "analytics", "arrow", "arrowLeft", "arrowRight", "arrowSide", "back", "bag", "barChart", "binoculars", "bold", "bookmark", "box", "briefcase", "building", "bullet", "cake", "calendar", "calendarUpload", "call", "cart", "centerView", "chats", "checkboxCircle", "checkboxSquare", "checkboxSquareChecked", "checkmark", "chevronDoubleRight", "chevronDown", "chevronLeft", "chevronRight", "chevronUp", "clapperboard", "clock", "close", "closeFolder", "closedTickets", "code", "codeFile", "coin", "cold", "collapse", "collapseSideways", "collection", "color", "colorSwatch", "columns", "connection", "connections", "copy", "copySimple", "database", "deadline", "delete", "density", "desktop", "development", "discard", "dislike", "doubleScreen", "download", "dragIndicator", "duplicate", "edit", "editUser", "editorImage", "editorLink", "email", "emoji", "eraser", "events", "expand", "expandDiagonal", "expandSideways", "fileAttach", "fileBookmark", "fileTypeCode", "fileTypeDocs", "fileTypeExe", "fileTypeImage", "fileTypeJson", "fileTypeOther", "fileTypePdf", "fileTypeTxt", "fileTypeVideo", "fileTypeZip", "fileUpload", "filebox", "filesNotes", "film", "filter2", "filters", "flag", "flow", "fold", "foldItems", "folder", "folderOpen", "fullScreen", "furniture", "gannt", "gem", "goals", "groups", "growStats", "heart", "help", "hide", "highPriority", "highestPriority", "home", "image", "import", "indentDecrease", "indentIncrease", "installation", "italic", "justifyBetween", "justifyCenter", "justifyEnd", "kanban", "keyboard", "knowledgeBase", "lightningBolt", "like", "link", "list", "list1", "listSquare", "loader", "loaderArc", "loaderRing", "location", "lock", "lockOpen", "logout", "lowPriority", "lowestPriority", "magicWand", "map", "meetings", "mention", "message", "messageRead", "messageSent", "microphone", "microphoneMute", "midPriority", "minus", "minusCircle", "money", "moneyStack", "moneysign", "more", "muteNotifications", "note", "notes", "notifications", "numberList", "paint", "paperclip", "pause", "photo", "pin", "pinActive", "play", "playCircle", "plug", "plus", "plusCircle", "print", "priority", "puzzle", "qRCode", "quote", "radioEmpty", "reaction", "replace", "reply", "report", "save", "search", "searchTab", "security", "sendMessage", "service", "settings", "settings2", "shipping", "shop", "shoppingBag", "shuffle", "sideLayout", "sidebar", "sidebarCollapse", "smartphone", "sorting", "sound", "sounds", "stack", "stats", "status", "statusDotBlue", "statusDotCrimson", "statusDotGreen", "statusDotOrange", "statusDotPink", "statusDotRed", "statusDotYellow", "strikethrough", "subtasks", "support", "swipe", "table", "tag", "tasks", "text", "textColor", "ticket", "time", "timeflow", "toDoList", "translate", "twoArrowsLeft", "twoArrowsRight", "type", "underline", "unfold", "unpin", "upload", "user", "userCancel", "userCheck", "userDelete", "userRound", "users", "video", "view", "warm", "warning", "web", "wifiConnection"];
|
|
1788
1788
|
var V2_ICON_ALIASES = {
|
|
1789
1789
|
"AccessRequest": "taskTypeAccessRequest",
|
|
@@ -2618,7 +2618,7 @@ var V2_ICON_ALIASES = {
|
|
|
2618
2618
|
};
|
|
2619
2619
|
var V2_BACKEND_OWNED_ICONS = ["taskTypeAccessRequest", "taskTypeBug", "taskTypeDeal", "taskTypeDefect", "taskTypeDesignTask", "taskTypeDevelopmentTask", "taskTypeEpic", "taskTypeProject", "taskTypeSalesRequest", "taskTypeService", "taskTypeSubTask", "taskTypeSuggestion", "taskTypeTask"];
|
|
2620
2620
|
|
|
2621
|
-
//
|
|
2621
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/iconRegistry.js
|
|
2622
2622
|
var BUNDLED = new Set(V2_ICON_NAMES);
|
|
2623
2623
|
var BACKEND_OWNED = new Set(V2_BACKEND_OWNED_ICONS);
|
|
2624
2624
|
function isAuthorableIcon(name) {
|
|
@@ -2655,7 +2655,7 @@ function nearestIcons(wrong, limit = 4) {
|
|
|
2655
2655
|
return scored.sort((a, b) => a.score - b.score || a.name.length - b.name.length || a.name.localeCompare(b.name)).slice(0, limit).map((s) => s.name);
|
|
2656
2656
|
}
|
|
2657
2657
|
|
|
2658
|
-
//
|
|
2658
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/cellWidgetKeys.js
|
|
2659
2659
|
var CELL_WIDGET_RENDERER = "@dynamic";
|
|
2660
2660
|
var WIDGET_COLUMN_KEY_RE = /^widget_[0-9a-f]{10}$/;
|
|
2661
2661
|
function cellWidgetKindOf(col) {
|
|
@@ -2681,7 +2681,7 @@ function columnCodeKeys(col) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
var CELL_WIDGET_ENTRY_KEYS = /* @__PURE__ */ new Set(["template", "script", "style", "compiledRender", "translations"]);
|
|
2683
2683
|
|
|
2684
|
-
//
|
|
2684
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/validator.js
|
|
2685
2685
|
var V2_BASE_PROPS = [
|
|
2686
2686
|
// `dataSource` being base-allowlisted is load-bearing and has ONE known blind spot worth naming here so it
|
|
2687
2687
|
// is not rediscovered a third time (audit contract-4, 2026-09-16): because the key is allowed on EVERY
|
|
@@ -5588,10 +5588,10 @@ function hasImageBinding(ds) {
|
|
|
5588
5588
|
return str(ds.fieldPath) || str(ds.variable);
|
|
5589
5589
|
}
|
|
5590
5590
|
|
|
5591
|
-
//
|
|
5591
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/uxVerify.js
|
|
5592
5592
|
var READ_MODE_OPT_IN_TYPES = new Set(v2ReadModeOptInTypes(v2ComponentManifest));
|
|
5593
5593
|
|
|
5594
|
-
//
|
|
5594
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/requiredConfig.js
|
|
5595
5595
|
var KIND_SENSITIVE_TYPES = /* @__PURE__ */ new Set(["select", "table", "chips"]);
|
|
5596
5596
|
var SQL_INFERRED_SOURCE_TYPES = /* @__PURE__ */ new Set(["chart", "table"]);
|
|
5597
5597
|
function inferDataSourceKind(el) {
|
|
@@ -5632,7 +5632,7 @@ var GLOBAL_SYSTEM_RECORD_CARD_ENTITIES = new Set([
|
|
|
5632
5632
|
"AutomationCredentials"
|
|
5633
5633
|
].map((name) => name.toLowerCase()));
|
|
5634
5634
|
|
|
5635
|
-
//
|
|
5635
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/entitySpec.js
|
|
5636
5636
|
var BASE_FIELD_NAMES = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt", "deletedAt", "createdBy", "removedBy"]);
|
|
5637
5637
|
var PLATFORM_RESERVED_FIELD_NAMES = [
|
|
5638
5638
|
"parent",
|
|
@@ -5678,7 +5678,7 @@ var HIERARCHY_DEPTH_LIMIT_MIN = 1;
|
|
|
5678
5678
|
var HIERARCHY_DEPTH_LIMIT_MAX = 20;
|
|
5679
5679
|
var DEPTH_LIMIT_SHAPE = `a whole number of levels, ${HIERARCHY_DEPTH_LIMIT_MIN}\u2013${HIERARCHY_DEPTH_LIMIT_MAX} (a root is level 1)`;
|
|
5680
5680
|
|
|
5681
|
-
//
|
|
5681
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/diff.js
|
|
5682
5682
|
var isEmptyValue = (v) => v === void 0 || v === null || v === "" || Array.isArray(v) && v.length === 0 || isObj(v) && Object.keys(v).length === 0;
|
|
5683
5683
|
function diffValues(before, after, prefix, out) {
|
|
5684
5684
|
if (isObj(before) && isObj(after)) {
|
|
@@ -5740,7 +5740,7 @@ function diffV2Form(before, after) {
|
|
|
5740
5740
|
};
|
|
5741
5741
|
}
|
|
5742
5742
|
|
|
5743
|
-
//
|
|
5743
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/responsive.js
|
|
5744
5744
|
var PANEL_PARENTS = /* @__PURE__ */ new Set(["tabs", "accordion", "steps"]);
|
|
5745
5745
|
var FILTER_TYPES = /* @__PURE__ */ new Set(["datePicker", "select", "input", "checkbox", "buttonList"]);
|
|
5746
5746
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? Math.floor(v) : d;
|
|
@@ -5851,7 +5851,7 @@ function packBreakpoint(schema, bp, opts) {
|
|
|
5851
5851
|
}
|
|
5852
5852
|
}
|
|
5853
5853
|
|
|
5854
|
-
//
|
|
5854
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/normalize.js
|
|
5855
5855
|
var PRIMARY_BREAKPOINT = "lg";
|
|
5856
5856
|
var DEFAULT_COLUMNS = 12;
|
|
5857
5857
|
function intAtLeast(v, min) {
|
|
@@ -6439,7 +6439,7 @@ function fitContainerHeights(schema, bp) {
|
|
|
6439
6439
|
return changed;
|
|
6440
6440
|
}
|
|
6441
6441
|
|
|
6442
|
-
//
|
|
6442
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/polish.js
|
|
6443
6443
|
var DEFAULT_COLUMNS2 = 12;
|
|
6444
6444
|
var DEFAULT_CANVAS_WIDTH = 1024;
|
|
6445
6445
|
var DEFAULT_X_GAP = 12;
|
|
@@ -6716,7 +6716,7 @@ function tidyFlow(els, bp, cols, baselineIds) {
|
|
|
6716
6716
|
}
|
|
6717
6717
|
}
|
|
6718
6718
|
|
|
6719
|
-
//
|
|
6719
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/themesTokens.js
|
|
6720
6720
|
var SYSTEM_TOKENS = [
|
|
6721
6721
|
{ key: "brand.primary", light: "#3381E5", dark: "#6C9EF2" },
|
|
6722
6722
|
{ key: "brand.primary-hover", light: "#2C6EC2", dark: "#85AEF4" },
|
|
@@ -7047,7 +7047,7 @@ var DATA_COLOR_TOKEN_POOLS = {
|
|
|
7047
7047
|
line: ["border.default", "border.hover", "border.active", "border.disabled", "brand.accent", "feedback.success", "feedback.warning", "feedback.error", "text.primary", "text.secondary", "text.muted"]
|
|
7048
7048
|
};
|
|
7049
7049
|
|
|
7050
|
-
//
|
|
7050
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/themes.js
|
|
7051
7051
|
var clamp = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
7052
7052
|
var toChannel = (v) => clamp(Math.round(v), 0, 255);
|
|
7053
7053
|
var toAlpha = (v) => clamp(v, 0, 1);
|
|
@@ -7502,7 +7502,7 @@ function paintIn(value, themeName, adapt, palette) {
|
|
|
7502
7502
|
return themeHex(adapt ? adaptLiteral(s, adapt, theme) : s);
|
|
7503
7503
|
}
|
|
7504
7504
|
|
|
7505
|
-
//
|
|
7505
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/theme.js
|
|
7506
7506
|
var BRAND = {
|
|
7507
7507
|
primary: "#3381E5",
|
|
7508
7508
|
// BluePrimary
|
|
@@ -7819,7 +7819,7 @@ function applyTheme(draft, rawTheme) {
|
|
|
7819
7819
|
return { draft: out, warnings };
|
|
7820
7820
|
}
|
|
7821
7821
|
|
|
7822
|
-
//
|
|
7822
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/brandConformance.js
|
|
7823
7823
|
var SNAP_DIST = 14;
|
|
7824
7824
|
var RADIUS_SCALE = [8, 12];
|
|
7825
7825
|
var SPACING_SCALE = [4, 6, 8, 12, 16, 20, 24];
|
|
@@ -8086,7 +8086,7 @@ function conformBrandColors(schema, baseline, accentColor, opts = {}) {
|
|
|
8086
8086
|
return { schema: out, warnings };
|
|
8087
8087
|
}
|
|
8088
8088
|
|
|
8089
|
-
//
|
|
8089
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/cardKitPatterns.js
|
|
8090
8090
|
var CARD_KIT_PATTERNS = [
|
|
8091
8091
|
{
|
|
8092
8092
|
name: "p_recordHeader",
|
|
@@ -8455,7 +8455,7 @@ var CARD_KIT_PATTERNS = [
|
|
|
8455
8455
|
}
|
|
8456
8456
|
];
|
|
8457
8457
|
|
|
8458
|
-
//
|
|
8458
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/cardKitLint.js
|
|
8459
8459
|
var KIT_SHADOWS = new Set(["", "none", "0 1px 2px rgba(16,24,40,0.05)", "0 1px 2px rgba(16,24,40,0.06), 0 12px 20px -14px rgba(16,24,40,0.30)"].map((s) => s.replace(/\s+/g, "")));
|
|
8460
8460
|
var urlCalls = (css) => [...css.matchAll(/url\s*\(\s*(?:"([^"]*)"|'([^']*)'|([^"'\s)]*))\s*\)/gi)].map((m) => (m[1] ?? m[2] ?? m[3] ?? "").trim());
|
|
8461
8461
|
var decoded = (u) => {
|
|
@@ -8479,7 +8479,7 @@ var CARD_KIT_GLYPH_URLS = new Set(CARD_KIT_PATTERNS.flatMap((p) => p.components)
|
|
|
8479
8479
|
return out;
|
|
8480
8480
|
}));
|
|
8481
8481
|
|
|
8482
|
-
//
|
|
8482
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/beautify.js
|
|
8483
8483
|
var CARD_SECTION_TYPES = /* @__PURE__ */ new Set(["container"]);
|
|
8484
8484
|
var FIELD_LIKE_TYPES = /* @__PURE__ */ new Set([
|
|
8485
8485
|
"input",
|
|
@@ -8711,7 +8711,7 @@ function beautifyDraft(draft, opts) {
|
|
|
8711
8711
|
return { draft: { ...draft, schema, settings }, changed, notes };
|
|
8712
8712
|
}
|
|
8713
8713
|
|
|
8714
|
-
//
|
|
8714
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/reconcile.js
|
|
8715
8715
|
var layoutOf = (el) => isObj(el.layout) ? el.layout : void 0;
|
|
8716
8716
|
var TOOLBAR_ZONE_SUFFIX = "__actions";
|
|
8717
8717
|
function reconcileTreeIntegrity(rawSchema, baselineSchema) {
|
|
@@ -8977,7 +8977,7 @@ function reconcileTreeIntegrity(rawSchema, baselineSchema) {
|
|
|
8977
8977
|
return { schema: finalSchema, changed, notes };
|
|
8978
8978
|
}
|
|
8979
8979
|
|
|
8980
|
-
//
|
|
8980
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/templates.js
|
|
8981
8981
|
var SETTINGS = { columnsNumber: 12, xGap: "16px", yGap: "12px" };
|
|
8982
8982
|
var CARD_SETTINGS = { columnsNumber: 12, xGap: "12px", yGap: "12px", backgroundColor: "var(--sp-surface-app-bg, #F5F5FA)" };
|
|
8983
8983
|
var TOP_LABEL = { labelLocation: { flexDirection: "column", gap: "4px" }, labelSettings: { fontSize: "12px", fontWeight: "500", color: "rgb(var(--sp-text-secondary-rgb, 72 73 84))" } };
|
|
@@ -378,31 +378,49 @@ export function normalizeEnvelope(input) {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
/**
|
|
381
|
-
*
|
|
382
|
-
* `relation_missing_entity` on a form that is fine
|
|
381
|
+
* A relation variable as a tenant hands it back has no `entity`, and the core then reports
|
|
382
|
+
* `relation_missing_entity` on a form that is fine.
|
|
383
383
|
*
|
|
384
|
-
* The server keeps no `entity` column on FormVariables
|
|
385
|
-
*
|
|
386
|
-
* every
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* variable really does need its own entity, and inventing one would hide a real defect. The fill is
|
|
390
|
-
* for the CHECK only — the writers send the file's own variable list, never this copy.
|
|
384
|
+
* The server keeps no `entity` column on FormVariables: what it stores is `relationEntity` (an
|
|
385
|
+
* EntityMetadata reference — entity-builder form-row-mappers.ts mapVariableRow, VARIABLE_SELECT_FIELDS
|
|
386
|
+
* `relationEntity: { id }`), so every variable read back (GET /core/forms/:id/schema, a FormVariables
|
|
387
|
+
* read) arrives with `relationEntity: { id }` at best and never with `entity`. Two fills, for the CHECK
|
|
388
|
+
* only — the writers send the file's own variable list, never this copy:
|
|
391
389
|
*
|
|
392
|
-
*
|
|
390
|
+
* - a relation variable that carries `relationEntity` HAS a target: the server's own. Checked as such —
|
|
391
|
+
* its name when the read gives one, else `#<id>` (the core only asks whether there is one). This is
|
|
392
|
+
* the reported false refusal on publish (2026-11-16): forms whose tabular parts and lookups ride on
|
|
393
|
+
* relation variables an application seeded with `relationEntity`.
|
|
394
|
+
* - the DEFAULT relation variable with no `relationEntity` either (Mykola's list D3, forms 349 and 480,
|
|
395
|
+
* 2026-10-14): the builder re-derives its entity on every open (FE core/utils/defaultVariableFactory.ts
|
|
396
|
+
* `ensure` → `syncDefaultEntity`) and `create()` names it after the entity verbatim, so `entity = name`.
|
|
397
|
+
*
|
|
398
|
+
* A NON-default relation variable with neither `entity` nor `relationEntity` keeps the finding: it
|
|
399
|
+
* really has no target on the server, and inventing one would hide a real defect.
|
|
400
|
+
*
|
|
401
|
+
* @returns {{ variables: unknown[], filled: string[], fromServer: string[] }} a copy; the input is never mutated
|
|
393
402
|
*/
|
|
394
403
|
export function fillDefaultRelationEntity(variables) {
|
|
395
404
|
const filled = [];
|
|
405
|
+
const fromServer = [];
|
|
396
406
|
const list = Array.isArray(variables) ? variables : [];
|
|
397
407
|
const out = list.map((v) => {
|
|
398
|
-
if (!v || typeof v !== "object" || v.
|
|
408
|
+
if (!v || typeof v !== "object" || v.type !== "relation") return v;
|
|
399
409
|
if (typeof v.entity === "string" && v.entity) return v;
|
|
410
|
+
const rel = v.relationEntity ?? v.relatedEntity;
|
|
411
|
+
const relName = rel && typeof rel === "object" && typeof rel.name === "string" && rel.name ? rel.name : null;
|
|
412
|
+
const relId = rel && typeof rel === "object" ? rel.id : typeof rel === "number" ? rel : null;
|
|
413
|
+
if (relName || (relId !== null && relId !== undefined && relId !== "")) {
|
|
414
|
+
fromServer.push(String(v.name));
|
|
415
|
+
return { ...v, entity: relName ?? `#${relId}` };
|
|
416
|
+
}
|
|
417
|
+
if (v.isDefault !== true) return v;
|
|
400
418
|
// `create()` falls back to the name 'record' only when there is no entity at all — not a name to copy.
|
|
401
419
|
if (typeof v.name !== "string" || !v.name || v.name === "record") return v;
|
|
402
420
|
filled.push(v.name);
|
|
403
421
|
return { ...v, entity: v.name };
|
|
404
422
|
});
|
|
405
|
-
return { variables: out, filled };
|
|
423
|
+
return { variables: out, filled, fromServer };
|
|
406
424
|
}
|
|
407
425
|
|
|
408
426
|
/**
|
|
@@ -2013,17 +2031,26 @@ export async function validateForm(input, { baseline = null, normalize = false,
|
|
|
2013
2031
|
// The default relation variable as read back from a tenant, entity restored for the CHECK
|
|
2014
2032
|
// (fillDefaultRelationEntity) — the draft handed back to a writer keeps it, writers send the file's list.
|
|
2015
2033
|
const filledDraft = fillDefaultRelationEntity(draft.variables);
|
|
2016
|
-
if (filledDraft.filled.length) {
|
|
2034
|
+
if (filledDraft.filled.length || filledDraft.fromServer.length) {
|
|
2017
2035
|
draft = { ...draft, variables: filledDraft.variables };
|
|
2018
2036
|
// The "what the repair silenced" comparison below re-checks the AUTHORED envelope; it must not
|
|
2019
2037
|
// report this fill as something --normalize swallowed.
|
|
2020
2038
|
env.draft = draft;
|
|
2039
|
+
}
|
|
2040
|
+
if (filledDraft.filled.length) {
|
|
2021
2041
|
notes.push(
|
|
2022
2042
|
`the default relation variable ${filledDraft.filled.map((n) => `'${n}'`).join(", ")} had no \`entity\` — the shape every ` +
|
|
2023
2043
|
"variable a tenant returns has, because FormVariables keeps no entity column — so it was checked as `entity` = its name, " +
|
|
2024
2044
|
"which is what the builder derives on open (FE core/utils/defaultVariableFactory.ts syncDefaultEntity).",
|
|
2025
2045
|
);
|
|
2026
2046
|
}
|
|
2047
|
+
if (filledDraft.fromServer.length) {
|
|
2048
|
+
notes.push(
|
|
2049
|
+
`the relation variable${filledDraft.fromServer.length > 1 ? "s" : ""} ${filledDraft.fromServer.map((n) => `'${n}'`).join(", ")} had no \`entity\` ` +
|
|
2050
|
+
"but carr" + (filledDraft.fromServer.length > 1 ? "y" : "ies") + " the server's `relationEntity` — where FormVariables keeps the target — so " +
|
|
2051
|
+
"the check took that as the target instead of reporting relation_missing_entity.",
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2027
2054
|
|
|
2028
2055
|
// The baseline is resolved FIRST: brand conformance skips elements the baseline already carries
|
|
2029
2056
|
// by id, which is what keeps an edit from being told off for a colour the form has had for a year.
|
|
@@ -2033,7 +2060,7 @@ export async function validateForm(input, { baseline = null, normalize = false,
|
|
|
2033
2060
|
if (b.error) notes.push(`the baseline was ignored: ${b.error.message}`);
|
|
2034
2061
|
else {
|
|
2035
2062
|
const filledBase = fillDefaultRelationEntity(b.draft.variables);
|
|
2036
|
-
baseDraft = filledBase.filled.length ? { ...b.draft, variables: filledBase.variables } : b.draft;
|
|
2063
|
+
baseDraft = filledBase.filled.length || filledBase.fromServer.length ? { ...b.draft, variables: filledBase.variables } : b.draft;
|
|
2037
2064
|
}
|
|
2038
2065
|
}
|
|
2039
2066
|
|
|
@@ -2451,7 +2478,7 @@ async function main(argv) {
|
|
|
2451
2478
|
* Was this file STARTED, or imported?
|
|
2452
2479
|
*
|
|
2453
2480
|
* Never compare `import.meta.url` against a hand-built `file:///` + path: the URL is
|
|
2454
|
-
* percent-encoded and the path is not, so an install under `C:\\Users\\
|
|
2481
|
+
* percent-encoded and the path is not, so an install under `C:\\Users\\JOHNDO~1\\…`
|
|
2455
2482
|
* (`%7E`), a path with a space, or a non-ASCII user name made this false — and the gate then exited
|
|
2456
2483
|
* 0 having printed nothing, which reads exactly like a pass. Compare realpaths, falling back to the
|
|
2457
2484
|
* encoded URL when a path cannot be resolved.
|