Files
pigibrack/.pi/extensions/pigibrack

pigibrack

pi guile bracket extension for structural Scheme/Guile editing.

What it provides

Tools:

  • pigibrack_read_module(path)
  • pigibrack_read_form(path, name)
  • pigibrack_replace_form(path, name, newSource)
  • pigibrack_insert_form(path, anchorName, position, newSource)
  • pigibrack_delete_form(path, name)
  • pigibrack_check_syntax({ path } | { source })
  • pigibrack_eval_expr(expr, module?)
  • pigibrack_macro_expand(expr, module?)

Commands:

  • /pigibrack-status
  • /pigibrack-repl-reset

How to load

This extension is project-local at:

  • .pi/extensions/pigibrack/index.ts

Pi auto-discovers this path. You can also start explicitly:

pi -e ./.pi/extensions/pigibrack/index.ts

Notes

  • Structural operations are top-level form by name.
  • Syntax checks run through guile reader scripts in guile/.
  • Eval uses a persistent Guile REPL sidecar (repl_sidecar.scm) with fallback to one-shot eval if sidecar startup fails.
  • File mutations use pi's withFileMutationQueue() to avoid race conditions in parallel tool mode.
  • Output is truncated to avoid context blowups.

Current limitations

  • Name extraction targets common define* patterns; unusual macro forms may be unnamed by the tool.