@usefillo/mcp 0.11.0 → 0.11.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/dist/index.js +59 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -80,9 +80,9 @@ async function installPackage(packageName, version, prefix) {
|
|
|
80
80
|
"--loglevel=error"
|
|
81
81
|
],
|
|
82
82
|
{
|
|
83
|
-
// npm diagnostics
|
|
84
|
-
//
|
|
85
|
-
stdio: ["ignore", "ignore", "
|
|
83
|
+
// Optional npm diagnostics have no stable machine format and may contain
|
|
84
|
+
// private configuration. Keep both CLI JSON and MCP channels clean.
|
|
85
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
86
86
|
timeout: 3e4,
|
|
87
87
|
killSignal: "SIGKILL",
|
|
88
88
|
windowsHide: true
|
|
@@ -177,8 +177,12 @@ async function runLatest(packageName, entryUrl) {
|
|
|
177
177
|
const root = fileURLToPath(new URL("../", entryUrl));
|
|
178
178
|
const entry = await resolveLatestRuntime(packageName, root);
|
|
179
179
|
if (!entry) return false;
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
const message = `Fillo: using the latest downloaded ${packageName}.`;
|
|
181
|
+
process.stderr.write(
|
|
182
|
+
packageName === "@usefillo/cli" && process.argv.includes("--json") ? `${JSON.stringify({ status: "runtime_updated", package: packageName, message })}
|
|
183
|
+
` : `${message}
|
|
184
|
+
`
|
|
185
|
+
);
|
|
182
186
|
const child = spawn(process.execPath, [entry, ...process.argv.slice(2)], {
|
|
183
187
|
stdio: "inherit",
|
|
184
188
|
env: { ...process.env, FILLO_RUNTIME_UPDATED: "1" }
|
|
@@ -221,7 +225,7 @@ function packageVersion() {
|
|
|
221
225
|
}
|
|
222
226
|
}
|
|
223
227
|
function apiOrigin() {
|
|
224
|
-
return (process.env.FILLO_API
|
|
228
|
+
return (process.env.FILLO_API?.trim() || DEFAULT_API).replace(/\/+$/, "");
|
|
225
229
|
}
|
|
226
230
|
function configDir() {
|
|
227
231
|
return process.env.FILLO_CONFIG_DIR?.trim() || join2(homedir2(), ".fillo");
|
|
@@ -234,16 +238,15 @@ function readConfig() {
|
|
|
234
238
|
const parsed = JSON.parse(readFileSync2(configPath(), "utf8"));
|
|
235
239
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
236
240
|
const record = parsed;
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
};
|
|
241
|
+
const result = { ...record };
|
|
242
|
+
for (const key of ["token", "tokenApi", "pk", "apiKey", "apiKeyApi"]) {
|
|
243
|
+
if (typeof record[key] !== "string") delete result[key];
|
|
244
|
+
}
|
|
245
|
+
if (record.activeContext !== "account" && record.activeContext !== "provisional")
|
|
246
|
+
delete result.activeContext;
|
|
247
|
+
if (!record.provision || typeof record.provision !== "object" || Array.isArray(record.provision))
|
|
248
|
+
delete result.provision;
|
|
249
|
+
return result;
|
|
247
250
|
} catch {
|
|
248
251
|
return {};
|
|
249
252
|
}
|
|
@@ -6380,8 +6383,23 @@ function saveSelection(project) {
|
|
|
6380
6383
|
slug: value.slug,
|
|
6381
6384
|
publishableKey: value.publishableKey
|
|
6382
6385
|
};
|
|
6383
|
-
const {
|
|
6384
|
-
|
|
6386
|
+
const {
|
|
6387
|
+
apiKey: _apiKey,
|
|
6388
|
+
apiKeyApi: _apiKeyApi,
|
|
6389
|
+
provision: _provision,
|
|
6390
|
+
claimToken: _claimToken,
|
|
6391
|
+
claimUrl: _claimUrl,
|
|
6392
|
+
email: _email,
|
|
6393
|
+
name: _name,
|
|
6394
|
+
preview: _preview,
|
|
6395
|
+
...current
|
|
6396
|
+
} = readConfig();
|
|
6397
|
+
writeConfig({
|
|
6398
|
+
...current,
|
|
6399
|
+
activeContext: "account",
|
|
6400
|
+
pk: selected.publishableKey,
|
|
6401
|
+
pkApi: apiOrigin()
|
|
6402
|
+
});
|
|
6385
6403
|
return selected;
|
|
6386
6404
|
}
|
|
6387
6405
|
function environmentWarning() {
|
|
@@ -6508,11 +6526,27 @@ function registerProvisionWorkspace(server) {
|
|
|
6508
6526
|
const responseCap = typeof res.json.limits?.responses === "number" ? res.json.limits.responses : void 0;
|
|
6509
6527
|
const expiresAt = typeof res.json.limits?.expiresAt === "string" ? res.json.limits.expiresAt : void 0;
|
|
6510
6528
|
const emailedTo = typeof res.json.claim?.email === "string" ? res.json.claim.email : email;
|
|
6511
|
-
const {
|
|
6529
|
+
const {
|
|
6530
|
+
apiKey: _apiKey,
|
|
6531
|
+
apiKeyApi: _apiKeyApi,
|
|
6532
|
+
claimUrl: _claimUrl,
|
|
6533
|
+
claimToken: _claimToken,
|
|
6534
|
+
name: _name,
|
|
6535
|
+
preview: _preview,
|
|
6536
|
+
...current
|
|
6537
|
+
} = readConfig();
|
|
6512
6538
|
writeConfig({
|
|
6513
6539
|
...current,
|
|
6514
6540
|
activeContext: "provisional",
|
|
6515
6541
|
pk: key,
|
|
6542
|
+
pkApi: apiOrigin(),
|
|
6543
|
+
email: emailedTo,
|
|
6544
|
+
...name ? { name } : {},
|
|
6545
|
+
preview: {
|
|
6546
|
+
workspace: typeof res.json.workspaceName === "string" ? res.json.workspaceName : `${name?.trim().split(/\s+/)[0] || emailedTo.split("@")[0]}'s workspace`,
|
|
6547
|
+
...responseCap !== void 0 && expiresAt ? { limits: { responses: responseCap, expiresAt } } : {},
|
|
6548
|
+
...typeof res.json.canPublishFileFields === "boolean" ? { canPublishFileFields: res.json.canPublishFileFields } : {}
|
|
6549
|
+
},
|
|
6516
6550
|
provision: { organizationId, email: emailedTo, responseCap, expiresAt, api: apiOrigin() }
|
|
6517
6551
|
});
|
|
6518
6552
|
return ok(
|
|
@@ -6655,16 +6689,18 @@ function registerPushForm(server) {
|
|
|
6655
6689
|
}
|
|
6656
6690
|
const { formId, slug, url, updated, warning, warningUrl } = res.json;
|
|
6657
6691
|
const status = res.json.status === "draft" ? "draft" : "published";
|
|
6658
|
-
const
|
|
6692
|
+
const staged = res.json.staged === true;
|
|
6693
|
+
const live = status === "published" && !staged && url ? url : void 0;
|
|
6659
6694
|
const warningText = (typeof warning === "string" && warning ? ` Note: ${warning}` : "") + (typeof warningUrl === "string" && warningUrl ? ` Storage settings: ${warningUrl}.` : "");
|
|
6660
6695
|
return ok(
|
|
6661
|
-
status === "published" ? `${updated ? "Updated" : "Published"} form "${formId}"${live ? `, live at ${live}` : ""}. Embed it with <FilloForm formId="${formId}" />.` + warningText : publish === false && !warning ? `Saved form "${formId}" as a private review draft. Use fillo_publish_form when it is ready.` : `Saved form "${formId}" as a draft for storage setup and final preview. Use fillo_publish_form after review.` + warningText,
|
|
6696
|
+
staged ? `Staged changes to form "${formId}" for review. The published version remains unchanged. Use fillo_publish_form when ready.` + warningText : status === "published" ? `${updated ? "Updated" : "Published"} form "${formId}"${live ? `, live at ${live}` : ""}. Embed it with <FilloForm formId="${formId}" />.` + warningText : publish === false && !warning ? `Saved form "${formId}" as a private review draft. Use fillo_publish_form when it is ready.` : `Saved form "${formId}" as a draft for storage setup and final preview. Use fillo_publish_form after review.` + warningText,
|
|
6662
6697
|
{
|
|
6663
6698
|
mode: "token",
|
|
6664
6699
|
formId,
|
|
6665
6700
|
slug,
|
|
6666
6701
|
url: live,
|
|
6667
6702
|
status,
|
|
6703
|
+
staged,
|
|
6668
6704
|
updated: !!updated,
|
|
6669
6705
|
...typeof warning === "string" ? { warning } : {},
|
|
6670
6706
|
...typeof warningUrl === "string" ? { warningUrl } : {}
|
|
@@ -6695,8 +6731,8 @@ function registerPushForm(server) {
|
|
|
6695
6731
|
return fail(message, syncError?.code ? { code: syncError.code } : void 0);
|
|
6696
6732
|
}
|
|
6697
6733
|
const { formId, slug, status, staged, warning, warningUrl } = res.json;
|
|
6698
|
-
const live = status === "published" && slug ? `${apiOrigin()}/f/${slug}` : void 0;
|
|
6699
|
-
const label = status === "published" ? `Live at ${live}` : staged ? "Staged as a draft for dashboard review" : "Saved as a draft";
|
|
6734
|
+
const live = status === "published" && !staged && slug ? `${apiOrigin()}/f/${slug}` : void 0;
|
|
6735
|
+
const label = staged ? "Staged changes for review; use fillo_publish_form when ready" : status === "published" ? `Live at ${live}` : staged ? "Staged as a draft for dashboard review" : "Saved as a draft";
|
|
6700
6736
|
return ok(
|
|
6701
6737
|
`Synced form "${formId}" (${status ?? "draft"}). ${label}. Embed it with <FilloForm formId="${formId}" />.` + (warning ? ` Note: ${warning}` : "") + (warningUrl ? ` Storage settings: ${warningUrl}.` : ""),
|
|
6702
6738
|
{
|
package/package.json
CHANGED