delta-force-core 0.4.0 โ†’ 0.5.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/README.en.md CHANGED
@@ -23,12 +23,26 @@
23
23
  <a id="status"></a>
24
24
  > ## ๐Ÿ“ข Project Status
25
25
  >
26
- > **v0.2.x** โ€” Stable. Covers **operators / weapons / equipment / ammo**.
26
+ > **v0.4.x** โ€” Stable. Covers **operators / weapons / equipment / ammo**.
27
+ >
28
+ > **New**: MCP Server (for AI clients).
27
29
  >
28
30
  > **Roadmap**: attachment system, ammo variants (T1โ€“T6), image assets, i18n.
29
31
 
30
32
  ---
31
33
 
34
+ <a id="ai-agents"></a>
35
+ ## ๐Ÿค– For AI Agents
36
+
37
+ - **Wiki (AI Usage Guide)**: https://github.com/Zhoyi011/delta-force-core/wiki
38
+ - **`llms.txt` (AI index)**: [llms.txt](./llms.txt)
39
+ - **`llms-full.txt` (AI full docs)**: [llms-full.txt](./llms-full.txt)
40
+ - **Raw JSON data**: https://unpkg.com/delta-force-core/index.json
41
+ - **MCP Server**: `npx -y -p delta-force-core delta-force-mcp`
42
+ - **npm page**: https://www.npmjs.com/package/delta-force-core
43
+
44
+ ---
45
+
32
46
  <a id="toc"></a>
33
47
  ## ๐Ÿ“– Table of Contents
34
48
 
@@ -36,6 +50,7 @@
36
50
  - [๐ŸŽฏ Use Cases](#use-cases)
37
51
  - [๐Ÿง  Design Philosophy](#design)
38
52
  - [๐Ÿ“ฆ Installation](#install)
53
+ - [๐Ÿค– MCP Server](#mcp)
39
54
  - [๐Ÿš€ Quick Start](#quick-start)
40
55
  - [๐Ÿงฉ Core Concepts](#concepts)
41
56
  - [๐Ÿ“˜ API Reference](#api)
@@ -89,6 +104,7 @@
89
104
  - โœ… **Zero Dependencies** โ€” Core library has no third-party deps
90
105
  - โœ… **Forward Compatible** โ€” All optional fields use `?:`, no breaking changes
91
106
  - โœ… **Node + Browser** โ€” Node.js โ‰ฅ 18 and modern browsers
107
+ - โœ… **MCP Server** โ€” Direct integration with Claude Desktop / Cursor / Cline
92
108
 
93
109
  ---
94
110
 
@@ -120,6 +136,10 @@
120
136
  <td>๐ŸŒ <b>Static Sites / CDN</b></td>
121
137
  <td>Fetch <code>index.json</code> directly, no build needed</td>
122
138
  </tr>
139
+ <tr>
140
+ <td>๐Ÿง  <b>AI Assistants</b></td>
141
+ <td>Via MCP Server, let Claude / Cursor call directly</td>
142
+ </tr>
123
143
  </table>
124
144
 
125
145
  ---
@@ -148,7 +168,7 @@
148
168
  โ–ผ
149
169
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
150
170
  โ”‚ Engine โ”‚
151
- โ”‚ ยท Random picker ยท Query โ”‚
171
+ โ”‚ ยท Random picker ยท Query ยท MCP โ”‚
152
172
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
153
173
  ```
154
174
 
@@ -172,7 +192,7 @@ All optional fields use `?:`. Adding new fields later (e.g., `caliber`, `image`,
172
192
  ## ๐Ÿ“ฆ Installation
173
193
 
174
194
  <details open>
175
- <summary><b>npm / yarn / pnpm / bun</b></summary>
195
+ <summary><b>As a JS library (npm / yarn / pnpm / bun)</b></summary>
176
196
 
177
197
  ```bash
178
198
  # npm
@@ -190,6 +210,44 @@ bun add delta-force-core
190
210
 
191
211
  </details>
192
212
 
213
+ <details>
214
+ <summary><b>As an MCP Server (for AI clients)</b></summary>
215
+
216
+ **Option 1: npx (recommended, no install)**
217
+
218
+ Add to Claude Desktop / Cursor / Cline config:
219
+
220
+ ```json
221
+ {
222
+ "mcpServers": {
223
+ "delta-force": {
224
+ "command": "npx",
225
+ "args": ["-y", "-p", "delta-force-core", "delta-force-mcp"]
226
+ }
227
+ }
228
+ }
229
+ ```
230
+
231
+ **Option 2: Global install**
232
+
233
+ ```bash
234
+ npm install -g delta-force-core
235
+ ```
236
+
237
+ Config:
238
+
239
+ ```json
240
+ {
241
+ "mcpServers": {
242
+ "delta-force": {
243
+ "command": "delta-force-mcp"
244
+ }
245
+ }
246
+ }
247
+ ```
248
+
249
+ </details>
250
+
193
251
  <details>
194
252
  <summary><b>CDN (browser)</b></summary>
195
253
 
@@ -214,6 +272,57 @@ bun add delta-force-core
214
272
 
215
273
  ---
216
274
 
275
+ <a id="mcp"></a>
276
+ ## ๐Ÿค– MCP Server
277
+
278
+ `delta-force-core` ships with an MCP Server that lets AI clients (Claude Desktop / Cursor / Cline) **directly call** your tools.
279
+
280
+ ### Config
281
+
282
+ ```json
283
+ {
284
+ "mcpServers": {
285
+ "delta-force": {
286
+ "command": "npx",
287
+ "args": ["-y", "-p", "delta-force-core", "delta-force-mcp"]
288
+ }
289
+ }
290
+ }
291
+ ```
292
+
293
+ ### Available Tools
294
+
295
+ | Tool | Description |
296
+ |---|---|
297
+ | `get_random_loadout` | Random full loadout |
298
+ | `get_random_weapon` | Random weapon |
299
+ | `get_random_operator` | Random operator |
300
+ | `get_random_ammo` | Random ammo |
301
+ | `find_weapon` | Find weapon by id |
302
+ | `find_operator` | Find operator by id |
303
+ | `find_ammo` | Find ammo by id |
304
+ | `find_weapons_by_caliber` | Find weapons by caliber |
305
+ | `find_ammo_by_caliber` | Find ammo by caliber |
306
+ | `list_weapons` | List weapons (by category) |
307
+ | `list_operators` | List operators (by category) |
308
+ | `list_categories` | List all categories |
309
+
310
+ ### Available Resources
311
+
312
+ - `delta-force://weapons` โ€” All weapons JSON
313
+ - `delta-force://operators` โ€” All operators JSON
314
+ - `delta-force://equipment` โ€” All equipment JSON
315
+ - `delta-force://ammo` โ€” All ammo JSON
316
+
317
+ ### User Example
318
+
319
+ User says in Claude Desktop:
320
+ > "Generate a random Delta Force loadout for me"
321
+
322
+ AI **automatically calls** `get_random_loadout` and returns **real data**.
323
+
324
+ ---
325
+
217
326
  <a id="quick-start"></a>
218
327
  ## ๐Ÿš€ Quick Start
219
328
 
@@ -264,6 +373,11 @@ console.log(data.weapons);
264
373
  console.log(data.equipment.helmets);
265
374
  ```
266
375
 
376
+ ### Scenario 5 ยท AI users
377
+
378
+ Configure MCP Server (see [MCP Server](#mcp) section), then tell the AI:
379
+ > "Generate a random Delta Force loadout"
380
+
267
381
  ---
268
382
 
269
383
  <a id="concepts"></a>
@@ -301,6 +415,8 @@ console.log(data.equipment.helmets);
301
415
 
302
416
  > ๐Ÿ’ก **Tip**: All functions exported as `defaultEngine`-bound are equivalent to calling `createEngine()` first. Use `createEngine` for custom behavior.
303
417
 
418
+ > ๐Ÿ“– **Full API**: see [Wiki](https://github.com/Zhoyi011/delta-force-core/wiki) or [llms-full.txt](./llms-full.txt).
419
+
304
420
  <a id="api-engine"></a>
305
421
  ### Engine
306
422
 
@@ -653,9 +769,9 @@ interface Ammo {
653
769
  import { AMMO } from 'delta-force-core';
654
770
  ```
655
771
 
656
- **19 calibers currently**:
772
+ **21 calibers currently**:
657
773
 
658
- `.357 Magnum`, `.45 ACP`, `.58 AE`, `12 Gauge`, `12.7x55mm`, `5.45x39mm`, `5.56x45mm`, `5.7x28mm`, `5.8x42mm`, `6.8x51mm`, `7.62x39mm`, `7.62x51mm`, `7.62x54mm`, `9x19mm`, `9x39mm`, `4.6x30mm`, `.300 Blackout`, `็ฎญ็Ÿข`, `45-70 Govt`
774
+ `.357 Magnum`, `.45 ACP`, `.50 AE`, `.338`, `12 Gauge`, `12.7x55mm`, `12.7x99mm`, `5.45x39mm`, `5.56x45mm`, `5.7x28mm`, `5.8x42mm`, `6.8x51mm`, `7.62x39mm`, `7.62x51mm`, `7.62x54mm`, `9x19mm`, `9x39mm`, `4.6x30mm`, `.300 Blackout`, `็ฎญ็Ÿข`, `45-70 Govt`
659
775
 
660
776
  ---
661
777
 
@@ -667,7 +783,7 @@ A full snapshot of the official data is generated at build time:
667
783
  ```json
668
784
  {
669
785
  "$schema": "https://raw.githubusercontent.com/delta-force-core/schema/main/v1.json",
670
- "version": "0.2.0",
786
+ "version": "0.4.0",
671
787
  "generatedAt": "2026-10-14T00:34:01.102Z",
672
788
  "operators": [...],
673
789
  "weapons": [...],
@@ -681,6 +797,7 @@ A full snapshot of the official data is generated at build time:
681
797
  - ๐Ÿ Non-JS environments (e.g., Python scripts)
682
798
  - ๐ŸŒ Direct CDN fetch (`https://unpkg.com/delta-force-core/index.json`)
683
799
  - ๐Ÿ“Š Data diffing
800
+ - ๐Ÿง  AI reading data
684
801
 
685
802
  ```js
686
803
  // ESM
@@ -707,6 +824,10 @@ const data = await res.json();
707
824
  | **Bun** | `bun add delta-force-core` |
708
825
  | **Python** | Read `index.json` |
709
826
  | **Discord.js** | See example below |
827
+ | **Claude Desktop** | MCP Server |
828
+ | **Cursor** | MCP Server |
829
+ | **Cline / Continue.dev** | MCP Server |
830
+ | **AI Studio / ChatGPT** | Read `llms.txt` or fetch `index.json` |
710
831
 
711
832
  ### Discord.js Example
712
833
 
@@ -734,6 +855,19 @@ client.on(Events.InteractionCreate, async (interaction) => {
734
855
  });
735
856
  ```
736
857
 
858
+ ### Claude Desktop / Cursor MCP Config
859
+
860
+ ```json
861
+ {
862
+ "mcpServers": {
863
+ "delta-force": {
864
+ "command": "npx",
865
+ "args": ["-y", "-p", "delta-force-core", "delta-force-mcp"]
866
+ }
867
+ }
868
+ }
869
+ ```
870
+
737
871
  ---
738
872
 
739
873
  <a id="contributing"></a>
@@ -839,14 +973,19 @@ delta-force-core/
839
973
  โ”œโ”€ tsconfig.json
840
974
  โ”œโ”€ README.md
841
975
  โ”œโ”€ README.en.md
976
+ โ”œโ”€ llms.txt โ† AI index
977
+ โ”œโ”€ llms-full.txt โ† AI full docs
842
978
  โ”œโ”€ LICENSE
843
979
  โ”œโ”€ CONTRIBUTING.md
844
980
  โ”œโ”€ index.json โ† build artifact
981
+ โ”œโ”€ bin/
982
+ โ”‚ โ””โ”€ mcp.js โ† MCP CLI entry
845
983
  โ”œโ”€ scripts/
846
984
  โ”‚ โ””โ”€ emit-json.mjs โ† generate index.json
847
985
  โ”œโ”€ src/
848
986
  โ”‚ โ”œโ”€ types.ts โ† all type definitions
849
987
  โ”‚ โ”œโ”€ engine.ts โ† engine (createEngine + all methods)
988
+ โ”‚ โ”œโ”€ mcp.ts โ† MCP Server logic
850
989
  โ”‚ โ”œโ”€ index.ts โ† main entry
851
990
  โ”‚ โ””โ”€ data/
852
991
  โ”‚ โ”œโ”€ index.ts โ† data barrel export
@@ -854,6 +993,8 @@ delta-force-core/
854
993
  โ”‚ โ”œโ”€ weapons.ts
855
994
  โ”‚ โ”œโ”€ equipment.ts
856
995
  โ”‚ โ””โ”€ ammo.ts
996
+ โ”œโ”€ assets/
997
+ โ”‚ โ””โ”€ weapons/ โ† weapon images
857
998
  โ””โ”€ .github/
858
999
  โ””โ”€ workflows/ โ† CI / auto-publish
859
1000
  ```
@@ -864,14 +1005,18 @@ delta-force-core/
864
1005
  npm run build # compile + generate index.json
865
1006
  npm run dev # watch mode
866
1007
  npm run emit-json # only generate index.json
1008
+ npm run mcp # start MCP Server
867
1009
  ```
868
1010
 
869
1011
  ### Publishing to npm
870
1012
 
871
- ```bash
872
- npm version patch # or minor / major
873
- npm publish # auto-runs prepublishOnly โ†’ npm run build
874
- ```
1013
+ **GitHub Actions auto-publish is configured**:
1014
+
1015
+ - `feat:` prefix โ†’ minor bump
1016
+ - `fix:` / `data:` / `refactor:` / `perf:` โ†’ patch bump
1017
+ - `feat!:` or `BREAKING CHANGE` โ†’ major bump
1018
+
1019
+ Published via **OIDC Trusted Publisher** (no token), with **Provenance signature**.
875
1020
 
876
1021
  ---
877
1022
 
@@ -886,10 +1031,11 @@ npm publish # auto-runs prepublishOnly โ†’ npm run build
886
1031
  </tr>
887
1032
  <tr><td>โœ… Done</td><td>Operators / Weapons / Equipment / Ammo</td><td>v0.1</td></tr>
888
1033
  <tr><td>โœ… Done</td><td>Engine + user overrides (quality / alias / tag)</td><td>v0.2</td></tr>
889
- <tr><td>๐Ÿ”„ In progress</td><td>Full README + docs</td><td>v0.2.x</td></tr>
890
- <tr><td>๐Ÿ“‹ Planned</td><td>Attachment system (slots / compatibility)</td><td>v0.3</td></tr>
891
- <tr><td>๐Ÿ“‹ Planned</td><td>Ammo variants (T1โ€“T6, damage / pen)</td><td>v0.3</td></tr>
892
- <tr><td>๐Ÿ“‹ Planned</td><td>Image assets</td><td>v0.4</td></tr>
1034
+ <tr><td>โœ… Done</td><td>Full README + Wiki + AI docs</td><td>v0.3</td></tr>
1035
+ <tr><td>โœ… Done</td><td>MCP Server (AI client integration)</td><td>v0.4</td></tr>
1036
+ <tr><td>๐Ÿ“‹ Planned</td><td>Attachment system (slots / compatibility)</td><td>v0.5</td></tr>
1037
+ <tr><td>๐Ÿ“‹ Planned</td><td>Ammo variants (T1โ€“T6, damage / pen)</td><td>v0.5</td></tr>
1038
+ <tr><td>๐Ÿ“‹ Planned</td><td>Image assets</td><td>v0.6</td></tr>
893
1039
  <tr><td>๐Ÿ’ญ Considering</td><td>i18n (English / ๆ—ฅๆœฌ่ชž)</td><td>v1.0</td></tr>
894
1040
  </table>
895
1041
 
@@ -965,24 +1111,40 @@ const data = require('delta-force-core/index.json');
965
1111
  </details>
966
1112
 
967
1113
  <details>
968
- <summary><b>Q7: How to deploy my own <code>index.json</code>?</b></summary>
1114
+ <summary><b>Q7: What is MCP? How to use it?</b></summary>
969
1115
 
970
- ```bash
971
- # fork the repo โ†’ edit data โ†’ build
972
- npm run build
973
- # output in dist/, index.json at root
974
- ```
1116
+ **MCP (Model Context Protocol)** is a "tool-calling protocol" for AI clients.
975
1117
 
976
- Or use the one from the npm package:
1118
+ After configuring, Claude Desktop / Cursor / Cline can **directly call** `delta-force-core`'s tools:
977
1119
 
1120
+ ```json
1121
+ {
1122
+ "mcpServers": {
1123
+ "delta-force": {
1124
+ "command": "npx",
1125
+ "args": ["-y", "-p", "delta-force-core", "delta-force-mcp"]
1126
+ }
1127
+ }
1128
+ }
978
1129
  ```
979
- https://unpkg.com/delta-force-core/index.json
980
- ```
1130
+
1131
+ Then tell the AI: "Generate a random Delta Force loadout" โ€” AI **directly calls** your tools.
981
1132
 
982
1133
  </details>
983
1134
 
984
1135
  <details>
985
- <summary><b>Q8: How to contribute data fixes?</b></summary>
1136
+ <summary><b>Q8: How to make AI use my library?</b></summary>
1137
+
1138
+ **Three ways**:
1139
+
1140
+ 1. **MCP** (recommended): configure MCP Server โ†’ AI directly calls
1141
+ 2. **AI reads docs**: let AI read the [Wiki](https://github.com/Zhoyi011/delta-force-core/wiki) or [llms.txt](./llms.txt)
1142
+ 3. **AI reads data**: let AI fetch `https://unpkg.com/delta-force-core/index.json`
1143
+
1144
+ </details>
1145
+
1146
+ <details>
1147
+ <summary><b>Q9: How to contribute data fixes?</b></summary>
986
1148
 
987
1149
  1. Fork the repo
988
1150
  2. Edit `src/data/*.ts`
@@ -1008,6 +1170,7 @@ Released under the [MIT License](./LICENSE).
1008
1170
  - Thanks to all community members who contributed Delta Force data
1009
1171
  - Thanks to [Shields.io](https://shields.io/) for badges
1010
1172
  - Thanks to [unpkg](https://unpkg.com/) / [esm.sh](https://esm.sh/) for CDN
1173
+ - Thanks to [Anthropic MCP](https://modelcontextprotocol.io/) for the AI tool protocol
1011
1174
 
1012
1175
  ---
1013
1176
 
@@ -1018,3 +1181,4 @@ Released under the [MIT License](./LICENSE).
1018
1181
  [โฌ† Back to Top](#delta-force-core)
1019
1182
 
1020
1183
  </div>
1184
+