@ai-ecoverse/mcpcat 0.17.1 → 0.17.3

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.
@@ -10192,6 +10192,29 @@ init_lock();
10192
10192
 
10193
10193
  // src/config/edit.ts
10194
10194
  init_lock();
10195
+ var FILE_MODE2 = 384;
10196
+ var DIR_MODE2 = 448;
10197
+ var PI_DIR = /\/\.pi(\/agent)?$/;
10198
+ async function privateDir(fs, dir, made) {
10199
+ try {
10200
+ await fs.mkdir(dir, { mode: DIR_MODE2 });
10201
+ } catch {
10202
+ }
10203
+ if (fs.chmod && (made || PI_DIR.test(dir))) {
10204
+ try {
10205
+ await fs.chmod(dir, DIR_MODE2);
10206
+ } catch {
10207
+ }
10208
+ }
10209
+ }
10210
+ async function privateFile(fs, path, output) {
10211
+ await fs.writeFile(path, output, { mode: FILE_MODE2 });
10212
+ if (!fs.chmod) return;
10213
+ try {
10214
+ await fs.chmod(path, FILE_MODE2);
10215
+ } catch {
10216
+ }
10217
+ }
10195
10218
  function isRecord2(value) {
10196
10219
  return typeof value === "object" && value !== null && !Array.isArray(value);
10197
10220
  }
@@ -10208,6 +10231,8 @@ async function readText(fs, path) {
10208
10231
  }
10209
10232
  }
10210
10233
  async function editMcpServers(fs, path, edit) {
10234
+ const dir = path.slice(0, path.lastIndexOf("/"));
10235
+ const made = dir !== "" && !await fs.exists(dir).catch(() => false);
10211
10236
  const release = await acquireLock(fs, path);
10212
10237
  try {
10213
10238
  const text = await readText(fs, path);
@@ -10219,16 +10244,10 @@ async function editMcpServers(fs, path, edit) {
10219
10244
  const indent = text ? detectIndent(text) : " ";
10220
10245
  const output = `${JSON.stringify(parsed, null, indent)}
10221
10246
  `;
10222
- const dir = path.slice(0, path.lastIndexOf("/"));
10223
- if (dir) {
10224
- try {
10225
- await fs.mkdir(dir);
10226
- } catch {
10227
- }
10228
- }
10247
+ if (dir) await privateDir(fs, dir, made);
10229
10248
  const tmpPath = `${path}.tmp.${Date.now()}`;
10230
- await fs.writeFile(tmpPath, output);
10231
10249
  try {
10250
+ await privateFile(fs, tmpPath, output);
10232
10251
  await fs.rename(tmpPath, path);
10233
10252
  } catch (renameErr) {
10234
10253
  try {
@@ -16992,5 +17011,5 @@ try {
16992
17011
  });
16993
17012
  } catch {
16994
17013
  }
16995
- var code = await run(platform, "0.17.1", args);
17014
+ var code = await run(platform, "0.17.3", args);
16996
17015
  process.exit(code);
@@ -9813,6 +9813,29 @@ init_lock();
9813
9813
 
9814
9814
  // src/config/edit.ts
9815
9815
  init_lock();
9816
+ var FILE_MODE2 = 384;
9817
+ var DIR_MODE2 = 448;
9818
+ var PI_DIR = /\/\.pi(\/agent)?$/;
9819
+ async function privateDir(fs, dir, made) {
9820
+ try {
9821
+ await fs.mkdir(dir, { mode: DIR_MODE2 });
9822
+ } catch {
9823
+ }
9824
+ if (fs.chmod && (made || PI_DIR.test(dir))) {
9825
+ try {
9826
+ await fs.chmod(dir, DIR_MODE2);
9827
+ } catch {
9828
+ }
9829
+ }
9830
+ }
9831
+ async function privateFile(fs, path, output) {
9832
+ await fs.writeFile(path, output, { mode: FILE_MODE2 });
9833
+ if (!fs.chmod) return;
9834
+ try {
9835
+ await fs.chmod(path, FILE_MODE2);
9836
+ } catch {
9837
+ }
9838
+ }
9816
9839
  function isRecord2(value) {
9817
9840
  return typeof value === "object" && value !== null && !Array.isArray(value);
9818
9841
  }
@@ -9829,6 +9852,8 @@ async function readText(fs, path) {
9829
9852
  }
9830
9853
  }
9831
9854
  async function editMcpServers(fs, path, edit) {
9855
+ const dir = path.slice(0, path.lastIndexOf("/"));
9856
+ const made = dir !== "" && !await fs.exists(dir).catch(() => false);
9832
9857
  const release = await acquireLock(fs, path);
9833
9858
  try {
9834
9859
  const text = await readText(fs, path);
@@ -9840,16 +9865,10 @@ async function editMcpServers(fs, path, edit) {
9840
9865
  const indent = text ? detectIndent(text) : " ";
9841
9866
  const output = `${JSON.stringify(parsed, null, indent)}
9842
9867
  `;
9843
- const dir = path.slice(0, path.lastIndexOf("/"));
9844
- if (dir) {
9845
- try {
9846
- await fs.mkdir(dir);
9847
- } catch {
9848
- }
9849
- }
9868
+ if (dir) await privateDir(fs, dir, made);
9850
9869
  const tmpPath = `${path}.tmp.${Date.now()}`;
9851
- await fs.writeFile(tmpPath, output);
9852
9870
  try {
9871
+ await privateFile(fs, tmpPath, output);
9853
9872
  await fs.rename(tmpPath, path);
9854
9873
  } catch (renameErr) {
9855
9874
  try {
@@ -16714,7 +16733,7 @@ async function main(ctx) {
16714
16733
  packageDir: "/node_modules/@ai-ecoverse/mcpcat"
16715
16734
  });
16716
16735
  const args = ctx.argv.slice(1);
16717
- return run(platform2, "0.17.1", args);
16736
+ return run(platform2, "0.17.3", args);
16718
16737
  }
16719
16738
  export {
16720
16739
  main as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/mcpcat",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "description": "A curl for the Model Context Protocol",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -61,15 +61,16 @@
61
61
  "trust:dry": "npx fledgling sync --dry-run -y --skip-publish"
62
62
  },
63
63
  "devDependencies": {
64
- "@ai-ecoverse/slicc-bios": "1.30.4",
65
- "@ai-ecoverse/slicc-kernel": "1.133.3",
66
- "@ai-ecoverse/slicc-shared-web": "1.23.2",
64
+ "@ai-ecoverse/slicc-bios": "1.33.1",
65
+ "@ai-ecoverse/slicc-kernel": "1.135.7",
66
+ "@ai-ecoverse/slicc-shared-web": "1.29.2",
67
67
  "@biomejs/biome": "2.5.15",
68
68
  "@earendil-works/pi-codemode": "1.2.0",
69
69
  "@earendil-works/pi-mcp": "1.2.0",
70
70
  "@types/node": "26.6.5",
71
71
  "esbuild": "0.28.2",
72
- "kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.133.3",
72
+ "kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.135.7",
73
+ "lefthook": "2.2.2",
73
74
  "monocart-coverage-reports": "2.13.2",
74
75
  "proper-lockfile": "4.1.2",
75
76
  "quickjs-wasi": "3.6.2",