fa-mcp-sdk 0.12.17 → 0.12.19

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.
@@ -58,7 +58,7 @@
58
58
  "dependencies": {
59
59
  "@modelcontextprotocol/sdk": "^1.29.0",
60
60
  "dotenv": "^17.4.1",
61
- "fa-mcp-sdk": "^0.12.15"
61
+ "fa-mcp-sdk": "^0.12.19"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/express": "^5.0.6",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fa-mcp-sdk",
3
3
  "productName": "FA MCP SDK",
4
- "version": "0.12.17",
4
+ "version": "0.12.19",
5
5
  "description": "Core infrastructure and templates for building Model Context Protocol (MCP) servers with TypeScript",
6
6
  "type": "module",
7
7
  "main": "dist/core/index.js",
package/scripts/fcp.js CHANGED
@@ -1,16 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Atomically save content to a file.
4
+ * The sanctioned write/delete channel for files under .claude/ (and any other path).
5
+ *
6
+ * Direct Write/Edit on .claude/** is denied by settings.json, and direct shell modification of .claude/
7
+ * (rm, mv, cp, output redirection) is blocked by the harness. This script is the ONE allowed way to create,
8
+ * overwrite or delete such files, because it runs as `node` (an allowlisted command). See the /edit-claude-files
9
+ * skill for the full protocol.
5
10
  *
6
11
  * Usage:
7
- * node scripts/fcp.js <filePath> <contentFilePath>
12
+ * node scripts/fcp.js <filePath> <contentFilePath> # create/overwrite <filePath> with the contents of the temp file
13
+ * node scripts/fcp.js --rm <path> [<path> ...] # delete the given path(s) (files or directories, recursive)
8
14
  *
9
15
  * <filePath> — destination path (absolute or relative to project root)
10
16
  * <contentFilePath> — path to a temp file whose contents will be written to <filePath>
11
17
  *
12
- * The script reads the content from <contentFilePath> and writes it to <filePath>,
13
- * creating parent directories if needed.
18
+ * Write mode reads the content from <contentFilePath> and writes it to <filePath>, creating parent directories if
19
+ * needed. Delete mode (--rm / --delete) removes each target path; missing paths are reported, not an error.
14
20
  */
15
21
 
16
22
  import fs from 'fs';
@@ -22,10 +28,31 @@ const __filename = fileURLToPath(import.meta.url);
22
28
  const __dirname = dirname(__filename);
23
29
  const projectRoot = path.resolve(__dirname, '..');
24
30
 
25
- const [, , rawTarget, rawSource] = process.argv;
31
+ const argv = process.argv.slice(2);
32
+
33
+ // Delete mode: `--rm` / `--delete` followed by one or more paths to remove.
34
+ if (argv[0] === '--rm' || argv[0] === '--delete') {
35
+ const targets = argv.slice(1);
36
+ if (!targets.length) {
37
+ console.error('Usage: node scripts/fcp.js --rm <path> [<path> ...]');
38
+ process.exit(1);
39
+ }
40
+ for (const raw of targets) {
41
+ const target = path.isAbsolute(raw) ? raw : path.resolve(projectRoot, raw);
42
+ if (fs.existsSync(target)) {
43
+ fs.rmSync(target, { recursive: true, force: true });
44
+ console.log(`Deleted: ${target}`);
45
+ } else {
46
+ console.log(`Already absent: ${target}`);
47
+ }
48
+ }
49
+ process.exit(0);
50
+ }
51
+
52
+ const [rawTarget, rawSource] = argv;
26
53
 
27
54
  if (!rawTarget || !rawSource) {
28
- console.error('Usage: node scripts/fcp.js <filePath> <contentFilePath>');
55
+ console.error('Usage: node scripts/fcp.js <filePath> <contentFilePath> | node scripts/fcp.js --rm <path> [...]');
29
56
  process.exit(1);
30
57
  }
31
58