fa-mcp-sdk 0.4.46 → 0.4.48
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/cli-template/CLAUDE.md +26 -0
- package/cli-template/package.json +1 -1
- package/package.json +1 -1
- package/scripts/save-file.js +48 -0
package/cli-template/CLAUDE.md
CHANGED
|
@@ -341,3 +341,29 @@ This log serves as:
|
|
|
341
341
|
- **Decision record** — why each change was made (e.g., "changed description because LLM didn't understand default value")
|
|
342
342
|
- **Progress tracker** — which tools/scenarios are covered, which remain
|
|
343
343
|
- **Handoff document** — if the session is interrupted, the next session can read the log and continue
|
|
344
|
+
|
|
345
|
+
## Editing files in `.claude/`
|
|
346
|
+
|
|
347
|
+
Files inside `.claude/` (SKILL.md and others) are monitored by Claude Code and reloaded on change. To avoid partial reads during multi-edit sessions, follow this protocol:
|
|
348
|
+
|
|
349
|
+
1. **Copy** the target file to a temp location outside `.claude/`:
|
|
350
|
+
```bash
|
|
351
|
+
cp .claude/skills/headless-test/SKILL.md tmp-skill.md
|
|
352
|
+
```
|
|
353
|
+
2. **Edit** `tmp-skill.md` — make ALL changes there (multiple Edit calls are fine).
|
|
354
|
+
3. **Save** atomically via the helper script:
|
|
355
|
+
```bash
|
|
356
|
+
node scripts/save-file.js .claude/skills/headless-test/SKILL.md tmp-skill.md
|
|
357
|
+
```
|
|
358
|
+
4. **Remove** the temp file:
|
|
359
|
+
```bash
|
|
360
|
+
rm tmp-skill.md
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Never use `Edit` or `Write` directly on files inside `.claude/` — always go through the temp-copy workflow above.
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## Formatting
|
|
367
|
+
|
|
368
|
+
MD lines ≤120 chars. Break at 120. Target 100-120. No short lines (60-80). Fill to ~120.
|
|
369
|
+
Exceptions: URLs, code blocks, tables — no wrap.
|
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.4.
|
|
4
|
+
"version": "0.4.48",
|
|
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",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Atomically save content to a file.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* node scripts/save-file.js <filePath> <contentFilePath>
|
|
8
|
+
*
|
|
9
|
+
* <filePath> — destination path (absolute or relative to project root)
|
|
10
|
+
* <contentFilePath> — path to a temp file whose contents will be written to <filePath>
|
|
11
|
+
*
|
|
12
|
+
* The script reads the content from <contentFilePath> and writes it to <filePath>,
|
|
13
|
+
* creating parent directories if needed.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import fs from 'fs';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import { fileURLToPath } from 'url';
|
|
19
|
+
import { dirname } from 'path';
|
|
20
|
+
|
|
21
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
+
const __dirname = dirname(__filename);
|
|
23
|
+
const projectRoot = path.resolve(__dirname, '..');
|
|
24
|
+
|
|
25
|
+
const [, , rawTarget, rawSource] = process.argv;
|
|
26
|
+
|
|
27
|
+
if (!rawTarget || !rawSource) {
|
|
28
|
+
console.error('Usage: node scripts/save-file.js <filePath> <contentFilePath>');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const targetPath = path.isAbsolute(rawTarget) ? rawTarget : path.resolve(projectRoot, rawTarget);
|
|
33
|
+
const sourcePath = path.isAbsolute(rawSource) ? rawSource : path.resolve(projectRoot, rawSource);
|
|
34
|
+
|
|
35
|
+
if (!fs.existsSync(sourcePath)) {
|
|
36
|
+
console.error(`Source file not found: ${sourcePath}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const content = fs.readFileSync(sourcePath, 'utf-8');
|
|
41
|
+
|
|
42
|
+
const targetDir = path.dirname(targetPath);
|
|
43
|
+
if (!fs.existsSync(targetDir)) {
|
|
44
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
fs.writeFileSync(targetPath, content, 'utf-8');
|
|
48
|
+
console.log(`Saved: ${targetPath} (${content.length} chars)`);
|