@usefillo/mcp 0.11.0 → 0.11.2

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.
Files changed (2) hide show
  1. package/dist/index.js +59 -23
  2. package/package.json +2 -2
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, including its ordinary install summary, must never
84
- // appear on the CLI's JSON/MCP's JSON-RPC stdout channel.
85
- stdio: ["ignore", "ignore", "inherit"],
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
- process.stderr.write(`Fillo: using the latest downloaded ${packageName}.
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 ?? DEFAULT_API).replace(/\/$/, "");
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 provision = record.provision && typeof record.provision === "object" && !Array.isArray(record.provision) ? record.provision : void 0;
238
- return {
239
- ...record.activeContext === "account" || record.activeContext === "provisional" ? { activeContext: record.activeContext } : {},
240
- ...typeof record.token === "string" ? { token: record.token } : {},
241
- ...typeof record.tokenApi === "string" ? { tokenApi: record.tokenApi } : {},
242
- ...typeof record.pk === "string" ? { pk: record.pk } : {},
243
- ...typeof record.apiKey === "string" ? { apiKey: record.apiKey } : {},
244
- ...typeof record.apiKeyApi === "string" ? { apiKeyApi: record.apiKeyApi } : {},
245
- ...provision ? { provision } : {}
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 { apiKey: _apiKey, provision: _provision, ...current } = readConfig();
6384
- writeConfig({ ...current, activeContext: "account", pk: selected.publishableKey });
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 { apiKey: _apiKey, ...current } = readConfig();
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 live = status === "published" && url ? url : void 0;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usefillo/mcp",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "mcpName": "io.github.jacobfunch/usefillo",
5
5
  "description": "Fillo MCP server — provision, scaffold, publish, and query forms from your coding agent.",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@modelcontextprotocol/sdk": "^1.29.0",
38
+ "@modelcontextprotocol/sdk": "^1.31.0",
39
39
  "zod": "^4.4.3"
40
40
  },
41
41
  "devDependencies": {