@mclawnet/agent 0.6.20 → 0.6.22

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.
Files changed (99) hide show
  1. package/cli.js +63 -0
  2. package/dist/__tests__/checkpoint.test.d.ts +2 -0
  3. package/dist/__tests__/checkpoint.test.d.ts.map +1 -0
  4. package/dist/__tests__/fs-handler-decode.test.d.ts +2 -0
  5. package/dist/__tests__/fs-handler-decode.test.d.ts.map +1 -0
  6. package/dist/__tests__/idle-sweeper.test.d.ts +2 -0
  7. package/dist/__tests__/idle-sweeper.test.d.ts.map +1 -0
  8. package/dist/__tests__/mcp-config.test.d.ts +2 -0
  9. package/dist/__tests__/mcp-config.test.d.ts.map +1 -0
  10. package/dist/__tests__/schedule-runtime-spawn.test.d.ts +2 -0
  11. package/dist/__tests__/schedule-runtime-spawn.test.d.ts.map +1 -0
  12. package/dist/__tests__/schedule-runtime.test.d.ts +2 -0
  13. package/dist/__tests__/schedule-runtime.test.d.ts.map +1 -0
  14. package/dist/__tests__/session-limit.test.d.ts +2 -0
  15. package/dist/__tests__/session-limit.test.d.ts.map +1 -0
  16. package/dist/__tests__/swarm-cli-client.test.d.ts +2 -0
  17. package/dist/__tests__/swarm-cli-client.test.d.ts.map +1 -0
  18. package/dist/__tests__/swarm-control-dispatch.test.d.ts +2 -0
  19. package/dist/__tests__/swarm-control-dispatch.test.d.ts.map +1 -0
  20. package/dist/__tests__/swarm-session-bridge.test.d.ts +2 -0
  21. package/dist/__tests__/swarm-session-bridge.test.d.ts.map +1 -0
  22. package/dist/backend-adapter.d.ts +43 -0
  23. package/dist/backend-adapter.d.ts.map +1 -1
  24. package/dist/checkpoint.d.ts +67 -0
  25. package/dist/checkpoint.d.ts.map +1 -0
  26. package/dist/{chunk-RIK7IXSW.js → chunk-WJWCYGLQ.js} +1130 -147
  27. package/dist/chunk-WJWCYGLQ.js.map +1 -0
  28. package/dist/errors.d.ts +40 -0
  29. package/dist/errors.d.ts.map +1 -0
  30. package/dist/fs-handler.d.ts.map +1 -1
  31. package/dist/hub-connection.d.ts +13 -0
  32. package/dist/hub-connection.d.ts.map +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/schedule-runtime.d.ts +125 -0
  35. package/dist/schedule-runtime.d.ts.map +1 -0
  36. package/dist/session-manager.d.ts +102 -0
  37. package/dist/session-manager.d.ts.map +1 -1
  38. package/dist/skill-loader.d.ts +20 -0
  39. package/dist/skill-loader.d.ts.map +1 -1
  40. package/dist/start.d.ts +2 -0
  41. package/dist/start.d.ts.map +1 -1
  42. package/dist/start.js +1 -1
  43. package/dist/swarm-cli-client.d.ts +24 -0
  44. package/dist/swarm-cli-client.d.ts.map +1 -0
  45. package/dist/swarm-cli-client.js +83 -0
  46. package/dist/swarm-cli-client.js.map +1 -0
  47. package/dist/swarm-control-dispatch.d.ts +47 -0
  48. package/dist/swarm-control-dispatch.d.ts.map +1 -0
  49. package/dist/swarm-session-bridge.d.ts +22 -0
  50. package/dist/swarm-session-bridge.d.ts.map +1 -0
  51. package/package.json +6 -4
  52. package/skills/cocos-creator-3x-cn/SKILL.md +475 -0
  53. package/skills/cocos-creator-3x-cn/references/framework/asset-management.md +322 -0
  54. package/skills/cocos-creator-3x-cn/references/framework/component-system.md +348 -0
  55. package/skills/cocos-creator-3x-cn/references/framework/event-patterns.md +410 -0
  56. package/skills/cocos-creator-3x-cn/references/framework/playable-optimization.md +257 -0
  57. package/skills/cocos-creator-3x-cn/references/language/performance.md +363 -0
  58. package/skills/cocos-creator-3x-cn/references/language/quality-hygiene.md +307 -0
  59. package/skills/cocos-creator-3x-cn/references/review/architecture-review.md +183 -0
  60. package/skills/cocos-creator-3x-cn/references/review/quality-review.md +251 -0
  61. package/skills/cocos-performance-optimizer/SKILL.md +214 -0
  62. package/skills/game-development/2d-games/SKILL.md +129 -0
  63. package/skills/game-development/3d-games/SKILL.md +145 -0
  64. package/skills/game-development/SKILL.md +175 -0
  65. package/skills/game-development/game-art/SKILL.md +195 -0
  66. package/skills/game-development/game-audio/SKILL.md +200 -0
  67. package/skills/game-development/game-design/SKILL.md +139 -0
  68. package/skills/game-development/mobile-games/SKILL.md +118 -0
  69. package/skills/game-development/multiplayer/SKILL.md +142 -0
  70. package/skills/game-development/pc-games/SKILL.md +154 -0
  71. package/skills/game-development/vr-ar/SKILL.md +133 -0
  72. package/skills/game-development/web-games/SKILL.md +160 -0
  73. package/skills/game-engine/SKILL.md +140 -0
  74. package/skills/game-engine/assets/2d-maze-game.md +528 -0
  75. package/skills/game-engine/assets/2d-platform-game.md +1855 -0
  76. package/skills/game-engine/assets/gameBase-template-repo.md +310 -0
  77. package/skills/game-engine/assets/paddle-game-template.md +1528 -0
  78. package/skills/game-engine/assets/simple-2d-engine.md +507 -0
  79. package/skills/game-engine/references/3d-web-games.md +754 -0
  80. package/skills/game-engine/references/algorithms.md +843 -0
  81. package/skills/game-engine/references/basics.md +343 -0
  82. package/skills/game-engine/references/game-control-mechanisms.md +617 -0
  83. package/skills/game-engine/references/game-engine-core-principles.md +695 -0
  84. package/skills/game-engine/references/game-publishing.md +352 -0
  85. package/skills/game-engine/references/techniques.md +894 -0
  86. package/skills/game-engine/references/terminology.md +354 -0
  87. package/skills/game-engine/references/web-apis.md +1394 -0
  88. package/skills/theone-cocos-standards/SKILL.md +557 -0
  89. package/skills/theone-cocos-standards/references/framework/component-system.md +645 -0
  90. package/skills/theone-cocos-standards/references/framework/event-patterns.md +433 -0
  91. package/skills/theone-cocos-standards/references/framework/playable-optimization.md +429 -0
  92. package/skills/theone-cocos-standards/references/framework/size-optimization.md +308 -0
  93. package/skills/theone-cocos-standards/references/language/modern-typescript.md +658 -0
  94. package/skills/theone-cocos-standards/references/language/performance.md +580 -0
  95. package/skills/theone-cocos-standards/references/language/quality-hygiene.md +582 -0
  96. package/skills/theone-cocos-standards/references/review/architecture-review.md +250 -0
  97. package/skills/theone-cocos-standards/references/review/performance-review.md +288 -0
  98. package/skills/theone-cocos-standards/references/review/quality-review.md +239 -0
  99. package/dist/chunk-RIK7IXSW.js.map +0 -1
@@ -0,0 +1,310 @@
1
+ # GameBase Template Repository
2
+
3
+ A feature-rich, opinionated starter template for 2D game projects built with **Haxe** and the **Heaps** game engine. Created and maintained by **Sebastien Benard** (deepnight), the lead developer behind *Dead Cells*. GameBase provides a production-tested foundation with entity management, level integration via LDtk, rendering pipeline, and a game loop architecture -- all designed to let developers skip boilerplate and jump straight into game-specific logic.
4
+
5
+ **Repository:** [github.com/deepnight/gameBase](https://github.com/deepnight/gameBase)
6
+ **Author:** [Sebastien Benard / deepnight](https://deepnight.net)
7
+ **Technology:** Haxe + Heaps (HashLink or JS targets)
8
+ **Level editor integration:** [LDtk](https://ldtk.io)
9
+
10
+ ---
11
+
12
+ ## Purpose
13
+
14
+ GameBase exists to solve the "blank project" problem. Instead of setting up rendering, entity systems, camera controls, debug overlays, and level loading from scratch, developers clone this repository and begin implementing game-specific mechanics immediately. It reflects patterns refined through commercial game development, particularly from the development of *Dead Cells*.
15
+
16
+ Key benefits:
17
+ - Pre-built entity system with grid-based positioning and sub-pixel precision
18
+ - LDtk level editor integration for visual level design
19
+ - Built-in debug tools and overlays
20
+ - Frame-rate independent game loop with fixed-step updates
21
+ - Camera system with follow, shake, zoom, and clamp
22
+ - Configurable Controller/input management
23
+ - Scalable rendering pipeline with Heaps
24
+
25
+ ---
26
+
27
+ ## Repository Structure
28
+
29
+ ```
30
+ gameBase/
31
+ src/
32
+ game/
33
+ App.hx -- Application entry point and initialization
34
+ Game.hx -- Main game process, holds level and entities
35
+ Entity.hx -- Base entity class with grid coords, velocity, animation
36
+ Level.hx -- Level loading and collision map from LDtk
37
+ Camera.hx -- Camera follow, shake, zoom, clamping
38
+ Fx.hx -- Visual effects (particles, flashes, etc.)
39
+ Types.hx -- Enums, typedefs, and constants
40
+ en/
41
+ Hero.hx -- Player entity (example implementation)
42
+ Mob.hx -- Enemy entity (example implementation)
43
+ import.hx -- Global imports (available everywhere)
44
+ res/
45
+ atlas/ -- Sprite sheets and texture atlases
46
+ levels/ -- LDtk level project files
47
+ fonts/ -- Bitmap fonts
48
+ .ldtk -- LDtk project file (root)
49
+ build.hxml -- Haxe compiler configuration
50
+ Makefile -- Build/run shortcuts
51
+ README.md
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Key Files and Their Roles
57
+
58
+ ### `src/game/App.hx` -- Application Entry Point
59
+
60
+ The main application class that extends `dn.Process`. Handles:
61
+ - Window/display initialization
62
+ - Scene management (root scene graph)
63
+ - Global input controller setup
64
+ - Debug toggle and console
65
+
66
+ ```haxe
67
+ class App extends dn.Process {
68
+ public static var ME : App;
69
+
70
+ override function init() {
71
+ ME = this;
72
+ // Initialize rendering, controller, assets
73
+ new Game();
74
+ }
75
+ }
76
+ ```
77
+
78
+ ### `src/game/Game.hx` -- Game Process
79
+
80
+ Manages the active game session:
81
+ - Holds reference to the current `Level`
82
+ - Manages all active `Entity` instances (via a global linked list)
83
+ - Handles pause, game-over, and restart logic
84
+ - Coordinates camera and effects
85
+
86
+ ```haxe
87
+ class Game extends dn.Process {
88
+ public var level : Level;
89
+ public var hero : en.Hero;
90
+ public var fx : Fx;
91
+ public var camera : Camera;
92
+
93
+ public function new() {
94
+ super(App.ME);
95
+ level = new Level();
96
+ fx = new Fx();
97
+ camera = new Camera();
98
+ hero = new en.Hero();
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### `src/game/Entity.hx` -- Base Entity
104
+
105
+ The core entity class featuring:
106
+ - **Grid-based positioning:** `cx`, `cy` (integer cell coordinates) plus `xr`, `yr` (sub-cell ratio 0.0 to 1.0) for smooth sub-pixel movement
107
+ - **Velocity and friction:** `dx`, `dy` (velocity) with configurable `frictX`, `frictY`
108
+ - **Gravity:** Optional per-entity gravity
109
+ - **Sprite management:** Animated sprite via Heaps `h2d.Anim` or `dn.heaps.HSprite`
110
+ - **Lifecycle:** `update()`, `fixedUpdate()`, `postUpdate()`, `dispose()`
111
+ - **Collision helpers:** `hasCollision(cx, cy)` check against the level collision map
112
+
113
+ ```haxe
114
+ class Entity {
115
+ // Grid position
116
+ public var cx : Int = 0; // Cell X
117
+ public var cy : Int = 0; // Cell Y
118
+ public var xr : Float = 0.5; // X ratio within cell (0..1)
119
+ public var yr : Float = 1.0; // Y ratio within cell (0..1)
120
+
121
+ // Velocity
122
+ public var dx : Float = 0;
123
+ public var dy : Float = 0;
124
+
125
+ // Pixel position (computed)
126
+ public var attachX(get,never) : Float;
127
+ inline function get_attachX() return (cx + xr) * Const.GRID;
128
+ public var attachY(get,never) : Float;
129
+ inline function get_attachY() return (cy + yr) * Const.GRID;
130
+
131
+ // Physics step
132
+ public function fixedUpdate() {
133
+ xr += dx;
134
+ dx *= frictX;
135
+
136
+ // X collision
137
+ if (xr > 1) { cx++; xr--; }
138
+ if (xr < 0) { cx--; xr++; }
139
+
140
+ yr += dy;
141
+ dy *= frictY;
142
+
143
+ // Y collision
144
+ if (yr > 1) { cy++; yr--; }
145
+ if (yr < 0) { cy--; yr++; }
146
+ }
147
+ }
148
+ ```
149
+
150
+ ### `src/game/Level.hx` -- Level Management
151
+
152
+ Loads and manages level data from LDtk project files:
153
+ - Parses tile layers, entity layers, and int grid layers
154
+ - Builds a collision grid (`hasCollision(cx, cy)`)
155
+ - Provides helper methods to query the level structure
156
+
157
+ ```haxe
158
+ class Level {
159
+ var data : ldtk.Level;
160
+ var collisions : Map<Int, Bool>;
161
+
162
+ public function new(ldtkLevel) {
163
+ data = ldtkLevel;
164
+ // Parse IntGrid layer for collision marks
165
+ for (cy in 0...data.l_Collisions.cHei)
166
+ for (cx in 0...data.l_Collisions.cWid)
167
+ if (data.l_Collisions.getInt(cx, cy) == 1)
168
+ collisions.set(coordId(cx, cy), true);
169
+ }
170
+
171
+ public inline function hasCollision(cx:Int, cy:Int) : Bool {
172
+ return collisions.exists(coordId(cx, cy));
173
+ }
174
+ }
175
+ ```
176
+
177
+ ### `src/game/Camera.hx` -- Camera System
178
+
179
+ Provides:
180
+ - **Target tracking:** Follow an entity smoothly with configurable dead zones
181
+ - **Shake:** Screen shake with decay
182
+ - **Zoom:** Dynamic zoom in/out
183
+ - **Clamping:** Keep the camera within level bounds
184
+
185
+ ### `src/game/Fx.hx` -- Effects System
186
+
187
+ Particle and visual effect management:
188
+ - Particle pools
189
+ - Screen flash
190
+ - Slow-motion helpers
191
+ - Color overlay effects
192
+
193
+ ---
194
+
195
+ ## Technology Stack
196
+
197
+ ### Haxe
198
+
199
+ A cross-platform, high-level programming language that compiles to multiple targets:
200
+ - **HashLink (HL):** Native bytecode VM for desktop (primary dev target)
201
+ - **JavaScript (JS):** Browser/web target
202
+ - **C/C++:** Via HXCPP for native builds
203
+
204
+ ### Heaps (Heaps.io)
205
+
206
+ A high-performance, cross-platform 2D/3D game engine:
207
+ - GPU-accelerated rendering via OpenGL/DirectX/WebGL
208
+ - Scene graph architecture with `h2d.Object` hierarchy
209
+ - Sprite batching and texture atlases
210
+ - Bitmap font rendering
211
+ - Input abstraction
212
+
213
+ ### LDtk
214
+
215
+ A modern, open-source 2D level editor created by Sebastien Benard:
216
+ - Visual, tile-based level design
217
+ - IntGrid layers for collision and metadata
218
+ - Entity layers for game object placement
219
+ - Auto-tiling rules
220
+ - Haxe API auto-generated from the project file
221
+
222
+ ---
223
+
224
+ ## Setup Instructions
225
+
226
+ ### Prerequisites
227
+
228
+ 1. **Install Haxe** (4.0+): [haxe.org](https://haxe.org/download/)
229
+ 2. **Install HashLink** (for desktop target): [hashlink.haxe.org](https://hashlink.haxe.org/)
230
+ 3. **Install LDtk** (for level editing): [ldtk.io](https://ldtk.io/)
231
+
232
+ ### Getting Started
233
+
234
+ ```bash
235
+ # Clone the repository
236
+ git clone https://github.com/deepnight/gameBase.git my-game
237
+ cd my-game
238
+
239
+ # Install Haxe dependencies
240
+ haxelib install heaps
241
+ haxelib install deepnightLibs
242
+ haxelib install ldtk-haxe-api
243
+
244
+ # Build and run (HashLink target)
245
+ haxe build.hxml
246
+ hl bin/client.hl
247
+
248
+ # Or use the Makefile (if available)
249
+ make run
250
+ ```
251
+
252
+ ### Using as a Starting Point
253
+
254
+ 1. **Clone or use the template** -- Do not fork; clone into a new directory with your game's name.
255
+ 2. **Rename the package** -- Update `src/game/` package declarations and project references to match your game.
256
+ 3. **Edit `build.hxml`** -- Adjust the main class, output path, and target as needed.
257
+ 4. **Design levels in LDtk** -- Open the `.ldtk` file, define your layers and entities, and export.
258
+ 5. **Implement entities** -- Create new entity classes in `src/game/en/` extending `Entity`.
259
+ 6. **Iterate** -- Use the debug console (toggle in-game) for live inspection and tuning.
260
+
261
+ ---
262
+
263
+ ## Build Targets
264
+
265
+ | Target | Command | Output | Use Case |
266
+ |--------|---------|--------|----------|
267
+ | HashLink | `haxe build.hxml` | `bin/client.hl` | Development, desktop release |
268
+ | JavaScript | `haxe build.js.hxml` | `bin/client.js` | Web/browser builds |
269
+ | DirectX/OpenGL | Via HL native | Native executable | Production desktop release |
270
+
271
+ ---
272
+
273
+ ## Debug Features
274
+
275
+ GameBase includes built-in debug tooling:
276
+ - **Debug overlay:** Toggle with a key to show entity bounds, grid, velocities, collision map
277
+ - **Console:** In-game command console for toggling flags, teleporting, spawning entities
278
+ - **FPS counter:** Visible frame-rate and update-rate monitor
279
+ - **Process inspector:** View active processes and their hierarchy
280
+
281
+ ---
282
+
283
+ ## Game Loop Architecture
284
+
285
+ GameBase uses a fixed-timestep game loop pattern:
286
+
287
+ ```
288
+ Each frame:
289
+ 1. preUpdate() -- Input polling, pre-frame logic
290
+ 2. fixedUpdate() -- Physics, movement, collisions (fixed timestep)
291
+ - May run 0-N times per frame to catch up
292
+ 3. update() -- General per-frame logic
293
+ 4. postUpdate() -- Sprite position sync, camera update, rendering prep
294
+ ```
295
+
296
+ This ensures physics behavior is consistent regardless of frame rate, while rendering and visual updates remain smooth.
297
+
298
+ ---
299
+
300
+ ## Entity Lifecycle
301
+
302
+ ```
303
+ Constructor --> init() --> [game loop: fixedUpdate/update/postUpdate] --> dispose()
304
+ ```
305
+
306
+ - **Constructor:** Set initial position, create sprite, register in global entity list
307
+ - **fixedUpdate():** Physics step (velocity, friction, gravity, collision)
308
+ - **update():** AI, state machine, animation triggers
309
+ - **postUpdate():** Sync sprite position to grid coordinates, apply visual effects
310
+ - **dispose():** Remove from entity list, destroy sprite, clean up references