Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 2.66 KB

File metadata and controls

59 lines (40 loc) · 2.66 KB

AGENTS.md - Lua Debug

Purpose

This example supports the Lua and LSP debugging tutorial using Mako Server, Visual Studio Code, the Lua Debug extension, and the BAS debug monitor. It includes a primary debug target app and a helper FileServer app for remote debugging/source mapping.

As written, this is Mako Server focused. It can be adapted by AI for Xedge-style workflows, but that requires changing debug monitor startup, app loading, restart assumptions, and source mapping behavior.

Read First

  1. README.md - required debugger setup and workflow.
  2. www/.preload - debug monitor startup and module loading.
  3. www/.vscode/launch.json - VS Code debug client configuration.
  4. www/index.lsp - LSP debug target.
  5. www/.lua/Markow-Chain.lua - Lua module used for stepping and breakpoints.
  6. FileServer/ files when working on remote debugging support.

Do not invent Mako debug monitor, VS Code launch, LSP, module loading, or restart APIs.

Official Documentation (Source Of Truth)

Reference priority:

  1. basapi.md for API syntax, signatures, and behavior.
  2. tutorials.md for architecture, security, deployment, and tutorial context.
  3. If tutorial guidance conflicts with API details, trust the API reference.

Key Files

  • www/.preload - loads the debug monitor and the Markow Chain module.
  • www/.vscode/launch.json - debugger connection and source mapping configuration.
  • www/index.lsp - browser-triggered LSP page for debugging.
  • www/.lua/Markow-Chain.lua - Lua module for stepping/breakpoint practice.
  • FileServer/.preload and FileServer/index.lsp - helper app for remote debugging and generated launch configuration.

Change Guidance

  • Preserve Mako Server debugger workflow unless the user explicitly asks for Xedge adaptation.
  • If adapting to Xedge, state which Mako assumptions are being replaced: app loading, debug monitor connection, source mappings, and restart behavior.
  • Keep .preload, .lsp, and .config file association guidance aligned with README instructions.
  • Avoid editing generated or environment-specific launch.json paths without confirming the user's debugger location.

Run And Verify

cd Lua-Debug
mako -l::www

Verify Mako prints that the debug monitor is waiting on port 4711, open Lua-Debug/www in VS Code, start the debugger, and confirm it halts in .preload or the LSP page as described in the README.