Commit Graph
45 Commits
Author SHA1 Message Date
西风逍遥游 b5100b6dbd script: unify interactive compiler entry points 2026-08-25 15:59:26 +08:00
西风逍遥游 cdff0b90d6 Merge remote-tracking branch 'origin/dev' into codex/editor-p0-p1-mcp 2026-08-25 00:39:42 +08:00
西风逍遥游 328e37e8ec feat(editor): complete P0 and P1 authoring services 2026-08-24 22:47:23 +08:00
西风逍遥游 4b32a0e06b fix(event): add owning messages and payloads 2026-08-24 20:48:28 +08:00
github-actions[bot] 81adf2fbbc release: 0.2.1 2026-08-23 08:23:43 +00:00
github-actions[bot] a136e1b865 release: 0.2.0 2026-08-22 12:09:26 +00:00
西风逍遥游 811eff1c3a ci(quality): warnings-as-errors gate, sanitizers, smoke, Python lint/tests
- EVENGINE_ENABLE_STRICT_WARNINGS option: MSVC /W4 /WX, GCC/Clang
  -Wall -Wextra -Werror, with documented noise suppressions and
  -isystem/-external:I for third-party headers; enabled on the
  Windows/Linux debug CI jobs.
- Fix warnings across engine, modules and tests exposed by the gate,
  including real bugs (incomplete-type deletes, Timespan microsecond
  overflow, overload hiding, enum switch gaps, dead code).
- Add Linux ASan+UBSan job, example smoke step, python-tools test
  job, ruff config (scripts+tools), weekly Linux coverage job and a
  CodeQL workflow.
2026-08-22 02:27:37 +08:00
西风逍遥游 040bc4576f fix(devtools): unbreak MCP eval + state capture on instance roots
DevLab's hot-reload test was failing deterministically on Linux: any --debug
run that reloads a script hit 'state reload: capture failed: root
'spritestack' is a class instance' because every module instance lives in the
Squirrel root table and Snapshot's auto-scan treated the first instance root
as a fatal capture error. With break-on-error enabled the engine paused at
the reported error, and a subsequent eve_eval deadlocked the pause pump.

- Snapshot::resolveRoots: drop OT_INSTANCE from the automatic root scan so
  module singletons / class instances are skipped instead of aborting the
  capture (plain-data roots such as gameState/lab are still captured).
- Debugger::waitWhilePaused: make the pause pump re-entrant so bytecode run
  by eve_eval / watches / breakpoint conditions while paused no longer blocks
  on the same thread's line hook (deadlock).
- test: new devtools.snapshot.skipsInstanceRootInAutoScan case.

Verified in WSL (Linux/GCC, software Vulkan + Xvfb): devlab MCP hot-reload
test 12/12 rounds, full ctest 1656/1656, all 37 example smokes pass.
2026-08-22 01:22:55 +08:00
西风逍遥游 54dea0d561 feat: state hot reload for scripts and state machines
Adds a capture -> reload -> restore pipeline so code/asset changes can be hot-applied without resetting running state:

- common: StateValue (JSON-compatible state tree) + IStateProvider capability interface.
- devtools: Snapshot v2 (script roots + native provider section, v1 compatible, strict rejection of non-data roots), ReloadSession (begin/commit/abort), eve.dev script API (stateRoots / beginStateReload / commitStateReload / abortStateReload).
- load.nut: three-phase soft reload (capture -> dofile -> restore) with migrate_instance / remap_instances helpers and eve_before_reload / eve_after_reload hooks.
- dialogue + AnimStateMachine: IStateProvider for phase/vars/rng and params/current state.
- animation: AnimClip::adopt + AnimClipRegistry + 'animclip' IAssetReloader so .eva content reloads keep clip identity.
- rpg + card: IStateProvider for casting/cooldowns and card phases.
- Tests: stateValue, snapshot v2/strict, reload script protocol, dialogue, animation state machine + reload, rpg/card state roundtrips.
2026-08-21 19:46:25 +08:00
西风逍遥游 f372842f87 feat(script): enrich script error handling and reporting
- Capture full call stack + throw-site in the Squirrel runtime error hook
  (new common/ScriptError.{h,cpp}) and surface it through ScriptException
  (line/column/function/stackTrace/reported accessors).
- Runtime installs its own error hook and drives execute() with a raw
  sq_call, fixing a null-deref when DevTool's hook replaces ssq's default
  runtime error handler.
- Compile errors now carry source line/column plus a snippet with caret.
- REPL/MCP/Debugger eval paths return the real error text instead of
  generic 'compile failed' / 'runtime failed'.
- Run() skips a second DevTool report for hook-reported script errors.
- ECS bootstrap compile/run failures are printed instead of swallowed.
2026-08-20 23:13:19 +08:00
西风逍遥游 34d1fdb63b refactor(modules): clear remaining back-edges and split the largest TUs (#127)
* chore(ci): add clang-format gate, CODEOWNERS and agent collaboration rules

* refactor(modules): clear remaining back-edges and split the largest TUs

Three known dependency back-edges are gone (module_depgraph.py KNOWN_BACK_EDGES
is now empty; --check passes with 0 violations, 0 cycles):

- window -> graphics: window queries the new IWindowSurfaceHost capability
  (common/WindowSurfaceHost.h) instead of holding a Graphics pointer;
  Window::setGraphics was removed and all call sites updated.
- window -> image: Window::setIcon was replaced by setIconRGBA(const uint8_t*,
  w, h); the window no longer decodes ImageData.
- scene -> graphics: pickScreenAt / collectFrustumIdsAt implementations moved
  to graphics/ScenePicking.cpp (graphics -> scene is a legal downward edge);
  scene now depends only on spatial.

TU splits (pure moves, verified identical method sets and brace balance):

- vulkan/Graphics.cpp (5118 lines) -> Graphics.cpp (lifecycle), GraphicsPipeline,
  Graphics2D, Graphics3D, GraphicsMesh + shared GraphicsInternal.h.
- scene/Scene.cpp -> Scene.cpp (script layer / host lifecycle / serialization)
  + SceneNodes.cpp + shared SceneInternal.h.

Verified with a real build (MSVC 19.51, prebuilt third-party): full build green;
window.* and Scene.* suites pass, including scene picking/culling and GPU cases.

* refactor(graphics): narrow Graphics interfaces and clear public-header leaks

Step 4 — interface segregation:
- New lean interfaces: IGraphics2D, IGraphics3D, IResourceFactory, IPostFX
  (pure virtuals, forward-declared types only; graphics/Color.h extracted from
  Canvas.h so modules that only need the color type stop pulling Canvas.h).
- Graphics now implements all four facets; consumers can depend on the narrow
  interface they use instead of the 129-method god class.
- Migrated voxel (VoxelWorld::drawVisible -> IGraphics3D*) and model3d
  (ModelRenderer::buildRenderable(s) -> IResourceFactory&).
- Graphics.h slims from 24 sub-header includes to a handful of small type
  headers + forward declarations; the destructor moved out-of-line so
  unique_ptr effect members are destroyed where types are complete.

Step 5 — header leaks (module_depgraph.py '*' marks: 14 -> 7):
- map/TileLayer.h, particles/ParticleEmitter.h, avatar/AvatarInstance.h,
  animation/SpineAnim.h, map/TileSystem.h, model3d/ModelData.h,
  model3d/ModelRenderer.h, audio/Audio.h + Source.h, image/ImageData.h +
  Image.h, dialogue/Dialogue.h, procgen Palette/OutputSpec/TextureRecipe/
  PbrMaterial -> forward declarations, includes moved to .cpp.
- voxel/VoxelWorld.h: terrain sampler Pimpl'd (unique_ptr + out-of-line
  destructor), removing the procgen header dependency.
- gpgpu/vulkan backend headers stop pulling graphics/vulkan/Graphics.h.
- Remaining '*' marks are deliberate: tiny POD/enum headers (GridConfig,
  MapObject, BlendMode, Color), an internal backend header
  (GraphicsInternal.h -> filesystem), and lean interface references.

Verified with a full clean build (MSVC) and tests: window/Scene/voxel/
RenderSystem/Quad/shader/TextureSampler/resourceLifetime pass; broad suite
only shows the pre-existing PHYSFS-init filesystem-environment failures.

* feat(resources): revive ResourceManager as unified IAssetReloader-backed cache

* fix(resources): leak ResourceManager singleton to avoid exit-time teardown crashes

Cached CPU resources may own third-party handles (FreeType faces, Assimp
scenes, image decode handlers) whose libraries are torn down at process
exit in an unspecified TU order; destroying cached entries from the
singleton destructor can segfault at exit (seen on CI Windows in
model3d.materialApi.objMtl). Keep the singleton alive until OS reclaim;
explicit unload()/clear() still release entries during the run.

* refactor(devtools): consume business modules through capability interfaces

DevTools / cmdline no longer include business-module headers, so trimming
scene / physics / procgen / particles / audio / ui / graphics no longer
requires disabling devtools, and devtools can be switched off with
-DEVENGINE_MODULE_DEVTOOLS=OFF.

New capability interfaces in common/:
- ISceneQuery (scene) - host/node inspection + mutation + transform sync
- IRenderCapture (graphics) - render status, PNG capture, camera control,
  visible-entity snapshot, entity-ID mask, G-buffer PNGs
- IPhysicsQuery (physics) - 2D world lifecycle + ray casts
- IProcgenQuery (procgen) - recipe listing, map/mesh generation
- IParticlesQuery (particles) - emitter status + one-shot emit
- IAudioQuery (audio) - volume / stop-all
- IEditorHost (ui) - declarative editor host (used by cmdline too)

Providers register in their module constructors. DevTools rewires McpServer
(render/scene/procgen/physics/particles/audio/host tools), SceneInspect
(now delegates to ISceneQuery + IRenderCapture) and RenderVision (uses
IRenderCapture::capturePngDataUrl); cmdline/Mcp.cpp uses IEditorHost.

manifest: devtools DEPS graphics scene physics procgen particles audio ui
image event filesystem -> event; cmdline DEPS filesystem ui -> filesystem.

Verified: full build green; devtools.mcp.* tests pass; broad suite shows
only the pre-existing PHYSFS-init filesystem-environment failures.

* style: apply clang-format to changed lines after dev merge

* fix(webgpu): include RenderControl/TextureSampler explicitly after Graphics.h slimming

* fix(webgpu): provide newFont/print stubs to satisfy IGraphics2D/IResourceFactory vtables

* fix(common): make ProcgenQuery.h self-sufficient (cstdint/utility for GCC)
2026-08-20 05:53:33 +08:00
西风逍遥游 f62261a779 fix(engine): validate Runtime stack size before VM creation; centralize DevTools singletons
Runtime now validates stackSize before constructing the Squirrel VM (previously the check ran after member initialization). DevTools singletons (AiPanel/ConsolePanel/McpServer/RenderVision) keep their process-immortal lifetime - required by the detached stdio reader thread and cross-singleton calls - but move from scattered raw new leaks to a single documented Immortal holder.
2026-08-19 22:44:52 +08:00
西风逍遥游 4377e062dd feat: zeroerr parameter validation + Doxygen API documentation
Squashed onto current main. Adds src/engine/common/Assert.h (EV_PARAM_CHECK / EV_ASSERT backed by zeroerr), an EVENGINE_ENABLE_ASSERTS option (non-Debug builds strip ZEROERR_NO_ASSERT unless enabled), parameter checks at key entry points, Doxygen comments across headers, Doxyfile + make docs / CMake docs targets, and Windows setup + code conventions in AGENTS.md.
2026-08-19 09:01:12 +08:00
西风逍遥游 50a230f5a3 Revert "feat: zeroerr parameter validation + Doxygen API documentation (#113)"
This reverts commit 3f3e41990b, reversing
changes made to 7d6375bc95.
2026-08-19 08:36:18 +08:00
西风逍遥游 af0cae4e49 Merge branch 'main' into codex/asserts-and-api-docs
# Conflicts:
#	src/engine/cmdline/cmdline.h
#	src/modules/building/BuildingTypes.h
#	src/modules/building/Ghost.h
#	src/modules/building/JsonHelpers.h
#	src/modules/building/PlacementSystem.h
#	src/modules/building/PlacementWorld.h
#	src/modules/dialogue/Dialogue.h
#	src/modules/filesystem/HotReload.h
#	src/modules/gpgpu/Gpgpu.h
#	src/modules/graphics/Graphics.h
#	src/modules/inventory/JsonHelpers.h
#	src/modules/model3d/ModelData.h
#	src/modules/network/Network.h
#	src/modules/network/TcpSocket.h
#	src/modules/rpg/JsonHelpers.h
#	src/modules/scene/SceneHost.h
#	src/modules/tensor/GpuBackend.h
#	src/modules/tensor/Graph.h
#	src/modules/tensor/Tensor.h
#	src/modules/voxel/Chunk.h
#	src/modules/voxel/GreedyMesher.h
#	src/modules/voxel/VoxelWorld.h
2026-08-19 08:20:18 +08:00
西风逍遥游 228b5a0f15 docs: add Doxygen API comments, docs target, and Windows AGENTS.md
Normalize all header comments to Doxygen @brief form and fill in missing class/method docs across engine common, cmdline, and module headers (~2368 @brief entries). Add root Doxyfile, 'make docs' target, CMake docs target, .gitignore for docs/api, README/docs/dev updates, and a Windows (native) + code-conventions section in AGENTS.md.
2026-08-19 00:13:35 +08:00
Cursor Agentand西风逍遥游 d80df444aa refactor(scene): register link kinds instead of hard-coding them
A scene link keeps an external object in step with the node it hangs off. The
kinds were a closed enum with a switch in TransformSystem, so scene had to
include graphics, physics and audio to do the casts, and no other module could
ever attach to the tree without editing SceneHost.h -- particles, voxel,
spritestack, avatar and weather all had to stay outside it.

Kinds are registered now (scene/SceneLink.h). The module owning the target type
supplies pushWorld / pullWorld / alive, keeps the casts on its own side where
the type is complete, and scene never learns what a Renderable3D is. Dispatch is
a function-pointer table rather than virtual calls, since link sync runs for
every dirty node every frame.

The six typed helpers (linkRenderable2D and friends) stay as conveniences and
now resolve their kind by name, so they return false rather than crash when the
module that registers it was trimmed out. The script API already named kinds
with strings, which is exactly the registry key, so it is unchanged.

Direction is now the right way round: graphics, physics and audio depend on
scene rather than scene on them, and scene drops from L5 to L1. What remains is
scene -> graphics from pickScreenAt / collectFrustumIdsAt, which take a Camera3D
and read its projection; that is recorded in the back-edge whitelist as the next
thing to move.

Each provider lives in a SceneLinks.cpp, sharing the basename so the three come
out of the build together when scene is disabled.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-18 13:46:25 +00:00
西风逍遥游 011b8b7b5e Merge branch 'main' into codex/scene-ecs-integration 2026-08-18 10:55:33 +08:00
西风逍遥游 34a9a63bfa Merge pull request #105 from EVEngine/codex/eve-mcp-host
feat(mcp): headless eve mcp host with AI-crafted MVVM editors
2026-08-18 10:40:21 +08:00
西风逍遥游 1c755f8940 feat(scene): scene/script-ECS integration, generic links, serialization & picking
Scene module overhaul: per-node script entities (SceneObject/SceneEntity/NodeRef), script ECS view-cache perf, generic multi-link system (renderable/physics/camera/audio), API completeness (transform getters, hierarchy ops, quaternions, tags/layer), incremental transforms, id index, reconcile moves, node events, JSON serialization, ray/frustum picking, spatial-index sync and SceneLoader auto AABB. Includes Cmdline/PhysFS argv0 robustness fix for unit tests.
2026-08-17 22:45:18 +08:00
西风逍遥游 4b24d1a157 feat(mcp): headless eve mcp host with AI-crafted MVVM editors
Adds 'eve mcp': a desktop-only headless MCP host (stdio by default, --port for TCP, --root for the project). It runs the full runtime, attaches DevTools (eve_eval / eve_run_script / snapshot), and starts the new EditorHost module that renders JSON-defined editor Views (ImGui) bound two-way to Squirrel ViewModel tables (MVVM), persists editors under editors/, and exposes the eve_host_* tool family (apply/state/set_value/events/capture/script/shutdown...). The stdio transport uses a background stdin reader and keeps stdout JSON-RPC-only; script print() is routed to stderr.

Tests: stdio handshake + tools/list round trip, host editor binding (VM<->View sync, set_value -> VM write + onChange events, save/reload persistence). Docs updated (AI与MCP支持.md, 命令行设计.md, tools/eve-mcp README) with the editor JSON protocol and Codex stdio setup.
2026-08-17 22:43:08 +08:00
西风逍遥游 0b8cfca633 feat(devtools): add runtime console and REPL 2026-08-17 22:06:16 +08:00
西风逍遥游 7b27945c88 Merge branch 'main' into codex/ai-scene-director 2026-08-17 17:10:24 +08:00
西风逍遥游 33d5e5b870 devtools: DAP output events, variable inspect, error throw-site pause 2026-08-17 14:51:32 +08:00
西风逍遥游 79127ed354 feat(scene-director): agent-drivable scene-authoring kit + engine MCP tools
Add the scene_director Squirrel kit (src/scripts/scene_director.nut) with
spawn/move/scale/rotate/remove/material/lighting/camera/cameras/info/modify/
reset, embedded into the engine and exposed to host games as
eve.sceneDirectorScript. New MCP tools (eve_scene_director_install/status,
eve_scene_reset, eve_scene_modify, eve_scene_info, eve_camera_generate) are
thin dispatchers over the kit, so agents can place props, set lighting,
frame cameras, inspect truth and reset the stage through MCP alone.

The kit's cross-references are written explicitly as scene_director.<field>
to avoid Squirrel table-closure 	his resolution, and cameras() uses a
fixed 6-way compass table (no math-lib dependency) so it works both in the
engine and in plain ssq test VMs.
2026-08-17 10:10:09 +08:00
西风逍遥游 74bc94df4f fix(devtools): correct JSON schema formatting in handleToolsList function
- Fixed the JSON schema for the 'capture_render_frame' tool by adding a missing closing brace.
- Ensured proper structure for the input schema to maintain consistency and prevent potential parsing errors.
2026-08-17 00:17:10 +08:00
西风逍遥游 be71b46269 Merge branch 'main' into codex/scene-inspection-mcp 2026-08-16 21:31:33 +08:00
西风逍遥游 35670cb370 Merge remote-tracking branch 'origin/main' into codex/scene-inspection-mcp
# Conflicts:
#	src/engine/devtools/McpServer.cpp
2026-08-16 19:49:14 +08:00
西风逍遥游 6d0e53832e feat(devtools): add scene-inspection MCP tools with synchronized image/geometry snapshots
Add engine-layer scene inspection toolset for the MCP server:
- inspect_generate_scene_camera_views / set_camera_pose / get_visible_entities_screen_bbox
- capture_render_frame now exports atomically synchronized buffers: color frame
  + geometry JSON always, plus optional depth/normal (GBuffer), and a per-pixel
  render entity-ID mask (id) with a JSON id->entity mapping.

Engine support:
- Graphics::renderEntityIdMask (per-pixel mesh ID offscreen pass, Vulkan)
- Graphics::readGBufferToImageData (depth/normal readback)
- SceneInspect module: multi-camera auto sampling, atomic snapshot, temp cache

Verified with GPU tests (RenderSystem3D.entityIdMaskPixels, readTextureBackPixels).
2026-08-16 16:46:05 +08:00
西风逍遥游 072c454150 feat(mcp): add RenderVision — vision-model description of rendered frames
Adds a vision-model bridge (devtools/RenderVision) that captures the
current frame (Graphics readback -> PNG data URL) and sends it with
engine render parameters to an OpenAI-compatible vision model over
plain HTTP, returning prose that describes the frame and explains the
render-parameter <-> visual-result correspondence for other LLM agents.

- New MCP tools:
  - eve_render_describe (fresh/reason; cached otherwise)
  - eve_render_vision_config (set/read config, key masked)
- Breakpoint hit and runtime-error pause auto-flag a pending dump that
  McpServer::poll performs on the main (render) thread.
- Config via env (EVE_VISION_BASE_URL/API_KEY/MODEL/PATH/TIMEOUT_MS)
  or the config tool.
- No TLS/OpenSSL is linked, so the endpoint must be plain HTTP (works
  with local Ollama/vLLM/LM Studio).
- Compiles cleanly on MSVC (C++20); tests extended for new tools.
2026-08-16 16:10:26 +08:00
西风逍遥游 d5844f7cdf fix(mcp): use ENCODED_PNG enum directly instead of unimplemented ImageData::getConstant
ImageData::getConstant is declared but never defined, causing LNK2019 /
undefined-reference link failures on all CI platforms. Use the
medialoader::FormatHandler::ENCODED_PNG constant directly for the
eve_screenshot PNG encode.
2026-08-16 12:48:45 +08:00
西风逍遥游 090283a743 feat(mcp): expose engine runtime features (scene/procgen/physics/render/particles/audio) as MCP tools
Add 18 new MCP tools to the embedded McpServer so agents can drive
the live game beyond the debugger surface:
- scene/entity query + transform mutation
- procgen recipe enumeration, map grid generation, mesh build
- 2D physics world create/list/raycast/remove
- render status + frame screenshot (PNG)
- particle emitter spawn, audio master control

Tool handlers use ModuleManager to reach Scene/Procgen/Physics/
Graphics/Particles/Audio and degrade gracefully when a module is
not mounted. Extend the tools/list and unit-test coverage.
2026-08-16 02:44:25 +08:00
西风逍遥游 8c8ac893f4 fix(devtools): correct Squirrel stack frame level for call stack and locals
The Squirrel native debug hook is invoked as a direct C call, so the top of the call stack (level 0) is the current script frame. The debugger, DAP adapter, and DevTool read locals/stack at level 1, which skipped the current frame: stackTrace omitted the innermost frame and the variables panel showed the caller's locals instead.

Read stack frames/locals at level 0 across Debugger::stackTrace, Debugger::locals, Debugger::evaluate, Debugger::scriptStackDepth, DebugAdapter variables requests, and DevTool local sampling.

Adds debugger_audit.cpp (breakpoint hits, stepInto/stepOver/stepOut, call stack at nested breakpoint, locals at breakpoint) and a threaded DAP end-to-end test that runs a real script and verifies the stopped event and the full call stack.
2026-08-14 21:02:30 +08:00
西风逍遥游 6974b8cd61 feat(devtools): implement AiPanel and McpServer for enhanced debugging capabilities
- Introduced AiPanel for managing AI-related debugging information, including logging and visibility controls.
- Added McpServer to facilitate communication with the debugging interface, supporting JSON-RPC for various commands.
- Updated CMake configurations to include new dependencies and libraries for the devtools.
- Enhanced Vulkan SDK detection in CMake for improved compatibility on Windows platforms.
- Refactored existing CMakeLists for better organization and readability.
2026-08-10 23:19:52 +08:00
Cursor Agentand西风逍遥游 239d29ad9c fix(devtools): cut MSVC export bloat from MCP / DevTool headers
Forward-declare McpServer/AiPanel in DevTool.hpp, bridge MCP away from
DevTool.hpp inside DebugAdapter's TU, emit tools/resources/prompts lists
as static JSON (fewer Poco template exports), and drop the ImGuiBackend
AI drawer that instantiated more imgui inlines under WINDOWS_EXPORT_ALL_SYMBOLS.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-10 01:58:37 +00:00
Cursor Agentand西风逍遥游 adfad4f2c9 fix(devtools): compile MCP/AiPanel into existing TUs for MSVC exports
Fold McpServer and AiPanel implementations into DebugAdapter.cpp and
DevTool.cpp via .inc includes so WINDOWS_EXPORT_ALL_SYMBOLS does not add
extra Poco JSON-heavy object files (LNK1189). Keep prior macOS singleton
and ImGui drawer fixes.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-10 01:36:26 +00:00
Cursor Agentand西风逍遥游 9cc7100e0d fix(devtools): unblock Windows link and macOS MCP test teardown
Windows failed with LNK1189 after AiPanel.cpp included imgui.h under
WINDOWS_EXPORT_ALL_SYMBOLS. Keep AiPanel data-only and register the ImGui
drawer from ImGuiBackend on desktop.

macOS MCP tests aborted after pass with mutex lock failed during static
destruction; leak McpServer/AiPanel singletons so teardown order cannot
invalidate their mutexes.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-10 01:17:00 +00:00
Cursor Agentand西风逍遥游 6c8116123b fix(mcp): store Poco JSON via Object::Ptr and harden parsing
Raw `new Object()` values stored in Dynamic::Var broke Stringifier with
BadCast during tools/list. Wrap nested objects/arrays in Ptr, emit
compact JSON for newline framing, and convert request fields safely.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-10 00:50:51 +00:00
Cursor Agentand西风逍遥游 779307c80b feat(devtools): add embedded MCP server and AI panel for agent testing
Expose a localhost MCP JSON-RPC server (--mcp-port) alongside DAP so AI
agents can pause, eval, snapshot, and slice errors on a live session.
Add DevTools AI session log/ImGui panel (eve.dev.ai, F9) and a Cursor
stdio bridge under tools/eve-mcp.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-10 00:43:11 +00:00
sunxfancy cee6eb0266 feat(devtools): enhance debugging capabilities with DAP integration and improved CallGraph
- Added support for DAP (Debug Adapter Protocol) in the DebugAdapter, allowing for better integration with IDEs like VS Code.
- Implemented new debugging commands: stepInto, stepOver, and stepOut, enhancing script execution control.
- Updated CallGraph to use a fixed ring buffer for event storage, improving performance and memory management.
- Introduced methods for resolving source paths and managing script aliases, facilitating smoother debugging experiences.
- Enhanced documentation to reflect new features and usage instructions for debugging tools.

These changes significantly improve the debugging workflow and provide developers with more robust tools for script management and error tracing.
2026-08-09 21:51:34 +08:00
西风逍遥游andCursor Agent 8abbb134cb feat(devtools): pause, breakpoints, watches, snapshots, and VS Code DAP (#6)
* feat(devtools): pause, breakpoints, watches, snapshots, and VS Code DAP

Add a script-centric debugger: Pause key / DAP frame pause, Squirrel
breakpoints with watches, JSON snapshot of script state (stateless
engine), TCP Debug Adapter Protocol server, and a VS Code extension
under tools/vscode-eve-debug.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): correct Snapshot JSON (Poco Ptr) and DAP includes

Use Poco::JSON::Object/Array::Ptr for script-state capture/restore so
round-trips no longer BadCast; include TimeoutException via Exception.h.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): move DebugAdapter ctor to cpp for MSVC unique_ptr

MSVC rejects unique_ptr of forward-declared Poco sockets when the
default constructor is defined in the header (incomplete-type delete).

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): disable Poco auto-link on EVDevTools for MSVC

Including Poco Net/JSON without POCO_NO_AUTOMATIC_LIBS makes the
Windows linker request PocoFoundationd.lib instead of PocoFoundationmdd.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-09 09:41:58 +08:00
西风逍遥游andCursor Agent 2d7b9f9287 feat(devtools): script error tracing with dynamic slicer (#4)
* feat(devtools): add dynamic slicer for script error tracing

Record call/return/line and Def/Use data-flow in CallGraph, attach a
Squirrel native debug hook via DevTool, and emit a Weiser-style backward
slice report on failures when running with `eve run --debug`.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): use one-in-one-out ring buffer for trace events

Replace half-window drops with a deque ring buffer: when full, each new
event evicts exactly one oldest event, with monotonic ids and index cleanup.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* feat(devtools): add render-pipeline error tracing

Introduce common RenderTrace hooks and a RenderFlow slicer so Graphics
passes/binds/draws are attributed on failure. Wire RenderSystem 2D/3D,
mark Exception sites, and merge render reports into DevTool --debug output.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* test(devtools): expand CallGraph and RenderFlow coverage

Add extensive unit tests for source locations, data-flow slicing,
ring-buffer eviction, nested passes/binds, Exception hooks, and RAII
scopes (54 cases / 202 assertions under ^devtools\.).

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-09 01:00:43 +08:00
sunxfancy 1a8434fb02 update 2024-06-12 14:59:31 -07:00
西风逍遥游 412ec4ddcb update 2022-07-16 22:00:44 -07:00
西风逍遥游 407e3218e5 add cmdline and some basic code 2021-09-09 09:17:29 -07:00