@forgeax/game 0.1.3 → 0.2.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.md +55 -7
- package/dist/main.js +34 -30
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,17 +22,22 @@ externalizes it from the Game bundle.
|
|
|
22
22
|
|
|
23
23
|
## Install
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### New client setup
|
|
26
|
+
|
|
27
|
+
Run this once per machine to add the ForgeaX MCP server to the selected agent client.
|
|
28
|
+
For ZCode:
|
|
26
29
|
|
|
27
30
|
```bash
|
|
28
|
-
npx -y -p @forgeax/game forgeax-game install --ide
|
|
29
|
-
npx -y -p @forgeax/game forgeax-game init --game snake
|
|
31
|
+
npx -y -p @forgeax/game forgeax-game install --ide zcode
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
This writes ZCode's native user configuration to
|
|
35
|
+
`~/.zcode/cli/config.json`. It can run from any directory.
|
|
36
|
+
|
|
37
|
+
Configure several clients in one pass:
|
|
33
38
|
|
|
34
39
|
```bash
|
|
35
|
-
npx -y -p @forgeax/game forgeax-game install --ide codex,claude,cursor
|
|
40
|
+
npx -y -p @forgeax/game forgeax-game install --ide codex,claude,cursor,zcode
|
|
36
41
|
```
|
|
37
42
|
|
|
38
43
|
Omitting `--ide` configures every supported client. User-scoped clients can be
|
|
@@ -49,6 +54,44 @@ store and completes a real `initialize` → `tools/list` → `resources/list` ha
|
|
|
49
54
|
Existing config files are merged, and a changed file is backed up beside the original
|
|
50
55
|
with the `.bak.latest` suffix.
|
|
51
56
|
|
|
57
|
+
### Create a project
|
|
58
|
+
|
|
59
|
+
Choose an empty directory and initialize a game there:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd /path/to/empty-directory
|
|
63
|
+
npx -y -p @forgeax/game forgeax-game init --game snake --ide zcode
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`init` creates the ForgeaX project, installs the matching Engine SDK, and mounts the
|
|
67
|
+
bundled Skills under `.zcode/skills` for ZCode. If `--ide` is omitted, it refreshes
|
|
68
|
+
every client that already has a ForgeaX MCP entry.
|
|
69
|
+
|
|
70
|
+
> [!IMPORTANT]
|
|
71
|
+
> `init` does not install the user-level MCP entry. A new machine must run
|
|
72
|
+
> `install --ide zcode` once before `init`. A user who already has the `forgeax`
|
|
73
|
+
> entry configured in ZCode can run `init` directly for each new project.
|
|
74
|
+
|
|
75
|
+
### Refresh an existing project
|
|
76
|
+
|
|
77
|
+
For a project that was initialized previously, use `update` instead of running the
|
|
78
|
+
same `init` again:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
cd /path/to/existing-forgeax-project
|
|
82
|
+
npx -y -p @forgeax/game forgeax-game update --ide zcode
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
If the project has no game-development Skills yet, use:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx -y -p @forgeax/game forgeax-game devkit install
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
After installing or refreshing ZCode Skills, open the project as a ZCode workspace,
|
|
92
|
+
refresh Settings → Skills, and start a new session. Check Settings → MCP Servers or
|
|
93
|
+
run `/mcp status` to confirm `forgeax` is connected.
|
|
94
|
+
|
|
52
95
|
For local package development or offline use, pin the currently running executable:
|
|
53
96
|
|
|
54
97
|
```bash
|
|
@@ -60,12 +103,12 @@ bun src/main.ts install --ide codex --local
|
|
|
60
103
|
| Command | Purpose |
|
|
61
104
|
|:--|:--|
|
|
62
105
|
| `install [--ide a,b] [--local]` | Verify the MCP launch command, then merge client configuration |
|
|
63
|
-
| `init [--game <slug>]` | Create a project/game, install routing rules, and materialize the bundled Engine SDK |
|
|
106
|
+
| `init [--game <slug>] [--ide ...]` | Create a project/game, install routing rules, and materialize the bundled Engine SDK |
|
|
64
107
|
| `use <slug>` | Activate an existing game through the server |
|
|
65
108
|
| `doctor` | Check Node, project binding, service tiers, and client configuration |
|
|
66
109
|
| `devkit install` | Install the game-development Skill and host rules; use `forgeax-install` only when available |
|
|
67
110
|
| `agents update` | Insert or refresh only the managed ForgeaX block in `AGENTS.md` |
|
|
68
|
-
| `
|
|
111
|
+
| `update [--ide ...]` | Verify the published launch command, refresh installed client entries, and update project routing rules |
|
|
69
112
|
|
|
70
113
|
`init` can create the minimal `.forgeax/` instance and game in an ordinary empty
|
|
71
114
|
directory. It also installs `.forgeax/engine-sdk/`, containing declarations, API
|
|
@@ -122,6 +165,7 @@ is absent, inspect `source/<package>/src/` instead of guessing.
|
|
|
122
165
|
| `codebuddy` / `workbuddy` | `~/.codebuddy/.mcp.json` | User |
|
|
123
166
|
| `windsurf` | `~/.codeium/windsurf/mcp_config.json` | User |
|
|
124
167
|
| `vscode` | `<project>/.vscode/mcp.json` | Project |
|
|
168
|
+
| `zcode` | `~/.zcode/cli/config.json` | User |
|
|
125
169
|
| `opencode` | `~/.config/opencode/opencode.json` | User |
|
|
126
170
|
|
|
127
171
|
> [!NOTE]
|
|
@@ -133,6 +177,10 @@ is absent, inspect `source/<package>/src/` instead of guessing.
|
|
|
133
177
|
> OpenCode 1.17.9: `opencode mcp list` starts this package and reports
|
|
134
178
|
> `forgeax connected`. If a future client release changes the schema, `doctor`
|
|
135
179
|
> will still report whether the configured entry matches what this package writes.
|
|
180
|
+
>
|
|
181
|
+
> ZCode uses its native `mcp.servers.<name>` user configuration rather than the
|
|
182
|
+
> `.agents/mcp.json` fallback. Project Skills are installed under `.zcode/skills`;
|
|
183
|
+
> start a new ZCode session and run `/mcp status` after installation.
|
|
136
184
|
|
|
137
185
|
## Game development Skill
|
|
138
186
|
|
package/dist/main.js
CHANGED
|
@@ -678,27 +678,17 @@ running, and running it.`;
|
|
|
678
678
|
var PLUGIN_SKILL_ID = "forgeax-game";
|
|
679
679
|
var ENGINE_SKILL_PREFIX = "forgeax-engine-";
|
|
680
680
|
var DEVKIT_VERSION = 2;
|
|
681
|
-
var
|
|
682
|
-
codex: ".agents/skills",
|
|
683
|
-
claude: ".claude/skills",
|
|
684
|
-
cursor: ".cursor/skills",
|
|
685
|
-
trae: ".trae/skills",
|
|
686
|
-
codebuddy: ".codebuddy/skills",
|
|
687
|
-
workbuddy: ".codebuddy/skills",
|
|
688
|
-
windsurf: ".codeium/windsurf/skills",
|
|
689
|
-
vscode: ".vscode/skills",
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
var HOST_RULE_MOUNTS = {
|
|
693
|
-
codex: ".agents/rules",
|
|
694
|
-
claude: ".claude/rules",
|
|
695
|
-
cursor: ".cursor/rules",
|
|
696
|
-
trae: ".trae/rules",
|
|
697
|
-
codebuddy: ".codebuddy/rules",
|
|
698
|
-
workbuddy: ".codebuddy/rules",
|
|
699
|
-
windsurf: ".codeium/windsurf/rules",
|
|
700
|
-
vscode: ".vscode/rules",
|
|
701
|
-
opencode: ".config/opencode/rules"
|
|
681
|
+
var HOST_MOUNTS = {
|
|
682
|
+
codex: { skills: ".agents/skills", rules: ".agents/rules" },
|
|
683
|
+
claude: { skills: ".claude/skills", rules: ".claude/rules" },
|
|
684
|
+
cursor: { skills: ".cursor/skills", rules: ".cursor/rules" },
|
|
685
|
+
trae: { skills: ".trae/skills", rules: ".trae/rules" },
|
|
686
|
+
codebuddy: { skills: ".codebuddy/skills", rules: ".codebuddy/rules" },
|
|
687
|
+
workbuddy: { skills: ".codebuddy/skills", rules: ".codebuddy/rules" },
|
|
688
|
+
windsurf: { skills: ".codeium/windsurf/skills", rules: ".codeium/windsurf/rules" },
|
|
689
|
+
vscode: { skills: ".vscode/skills", rules: ".vscode/rules" },
|
|
690
|
+
zcode: { skills: ".zcode/skills" },
|
|
691
|
+
opencode: { skills: ".config/opencode/skills", rules: ".config/opencode/rules" }
|
|
702
692
|
};
|
|
703
693
|
function skillRoots() {
|
|
704
694
|
const here = dirname3(fileURLToPath(import.meta.url));
|
|
@@ -782,24 +772,27 @@ function writeTextIfChanged(path, content) {
|
|
|
782
772
|
return true;
|
|
783
773
|
}
|
|
784
774
|
function selectedHostIds(clients) {
|
|
785
|
-
return [...new Set(clients.map((id) => id === "workbuddy" ? "codebuddy" : id))].filter((id) =>
|
|
775
|
+
return [...new Set(clients.map((id) => id === "workbuddy" ? "codebuddy" : id))].filter((id) => HOST_MOUNTS[id]);
|
|
786
776
|
}
|
|
787
777
|
function hostSkillDirs(projectRoot) {
|
|
788
|
-
return [...new Set(Object.values(
|
|
778
|
+
return [...new Set(Object.values(HOST_MOUNTS).map((mount) => mount.skills))].map((mount) => join3(projectRoot, mount));
|
|
789
779
|
}
|
|
790
780
|
function installHostDevKit(projectRoot, clients, skills = bundledSkills()) {
|
|
791
781
|
const skillPaths = [];
|
|
792
782
|
const rulePaths = [];
|
|
793
783
|
let changed = false;
|
|
794
784
|
for (const id of selectedHostIds(clients)) {
|
|
795
|
-
const
|
|
785
|
+
const mount = HOST_MOUNTS[id];
|
|
786
|
+
const skillsDir = join3(projectRoot, mount.skills);
|
|
796
787
|
for (const skill of skills) {
|
|
797
788
|
changed = copySkill(skill.path, join3(skillsDir, skill.id)) || changed;
|
|
798
789
|
}
|
|
799
|
-
const rulePath = join3(projectRoot, HOST_RULE_MOUNTS[id], `${PLUGIN_SKILL_ID}.md`);
|
|
800
|
-
changed = writeTextIfChanged(rulePath, ROUTING_TEXT) || changed;
|
|
801
790
|
skillPaths.push(skillsDir);
|
|
802
|
-
|
|
791
|
+
if (mount.rules) {
|
|
792
|
+
const rulePath = join3(projectRoot, mount.rules, `${PLUGIN_SKILL_ID}.md`);
|
|
793
|
+
changed = writeTextIfChanged(rulePath, ROUTING_TEXT) || changed;
|
|
794
|
+
rulePaths.push(rulePath);
|
|
795
|
+
}
|
|
803
796
|
}
|
|
804
797
|
const skillIds = skills.map((skill) => skill.id);
|
|
805
798
|
const noun = skillPaths.length === 1 ? "host" : "hosts";
|
|
@@ -888,7 +881,7 @@ function removeDevKit(projectRoot) {
|
|
|
888
881
|
const owned = new Set(bundledSkills().map((skill) => skill.id));
|
|
889
882
|
const removed = [];
|
|
890
883
|
let skillCount = 0;
|
|
891
|
-
for (const mount of new Set(Object.values(
|
|
884
|
+
for (const mount of new Set(Object.values(HOST_MOUNTS).map((entry) => entry.skills))) {
|
|
892
885
|
const dir = join3(projectRoot, mount);
|
|
893
886
|
let entries;
|
|
894
887
|
try {
|
|
@@ -906,7 +899,8 @@ function removeDevKit(projectRoot) {
|
|
|
906
899
|
}
|
|
907
900
|
removed.push(dir);
|
|
908
901
|
}
|
|
909
|
-
|
|
902
|
+
const ruleMounts = Object.values(HOST_MOUNTS).flatMap((entry) => entry.rules ? [entry.rules] : []);
|
|
903
|
+
for (const mount of new Set(ruleMounts)) {
|
|
910
904
|
for (const suffix of [".md", ".md.bak.latest"]) {
|
|
911
905
|
rmSync(join3(projectRoot, mount, `${PLUGIN_SKILL_ID}${suffix}`), { force: true });
|
|
912
906
|
}
|
|
@@ -1788,6 +1782,16 @@ var CLIENTS = [
|
|
|
1788
1782
|
commandShape: "split",
|
|
1789
1783
|
postInstallNote: 'Open .vscode/mcp.json and click Start, or run "MCP: List Servers".'
|
|
1790
1784
|
},
|
|
1785
|
+
{
|
|
1786
|
+
id: "zcode",
|
|
1787
|
+
label: "ZCode",
|
|
1788
|
+
format: "json",
|
|
1789
|
+
scope: "user",
|
|
1790
|
+
path: () => join7(HOME, ".zcode", "cli", "config.json"),
|
|
1791
|
+
serverMapKey: ["mcp", "servers"],
|
|
1792
|
+
commandShape: "split",
|
|
1793
|
+
postInstallNote: "Start a new ZCode session, then run /mcp status to confirm the server is connected."
|
|
1794
|
+
},
|
|
1791
1795
|
{
|
|
1792
1796
|
id: "opencode",
|
|
1793
1797
|
label: "OpenCode",
|
|
@@ -2273,7 +2277,7 @@ import {
|
|
|
2273
2277
|
var HELP = `ForgeaX game development plugin
|
|
2274
2278
|
|
|
2275
2279
|
Usage:
|
|
2276
|
-
forgeax-game install [--ide
|
|
2280
|
+
forgeax-game install [--ide ${CLIENT_CHOICES.join(",")}] [--local]
|
|
2277
2281
|
forgeax-game uninstall [--ide ...] [--purge]
|
|
2278
2282
|
forgeax-game init [--game <slug>] [--ide ...]
|
|
2279
2283
|
forgeax-game use <slug>
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeax/game",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "@forgeax/game \u2014 ForgeaX game development as a plugin for MCP-capable agent CLIs (Codex, Claude Code, Cursor, Trae, OpenCode, WorkBuddy). Single binary, dual mode: no args = stdio MCP server, subcommand = CLI.",
|
|
6
|
+
"description": "@forgeax/game \u2014 ForgeaX game development as a plugin for MCP-capable agent CLIs (Codex, Claude Code, Cursor, Trae, ZCode, OpenCode, WorkBuddy). Single binary, dual mode: no args = stdio MCP server, subcommand = CLI.",
|
|
7
7
|
"main": "./dist/main.js",
|
|
8
8
|
"bin": {
|
|
9
9
|
"forgeax-game": "dist/main.js"
|