panbuild 0.2.1__tar.gz

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.
@@ -0,0 +1 @@
1
+ *
Binary file
Binary file
Binary file
File without changes
@@ -0,0 +1,39 @@
1
+ {"time":"2026-09-18T15:59:59.145742804+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent/tools/mcp.Initialize","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/tools/mcp/init.go","line":299},"msg":"Initializing MCP clients"}
2
+ {"time":"2026-09-18T15:59:59.527303451+02:00","level":"ERROR","source":{"function":"github.com/charmbracelet/crush/internal/agent/tools/mcp.createSession","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/tools/mcp/init.go","line":1010},"msg":"MCP client failed to initialize","error":"calling \"initialize\": sending \"initialize\": Bad Request","name":"github"}
3
+ {"time":"2026-09-18T16:00:00.253264617+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
4
+ {"time":"2026-09-18T16:00:06.625952724+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
5
+ {"time":"2026-09-18T16:00:14.036079101+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
6
+ {"time":"2026-09-18T16:00:16.795518192+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
7
+ {"time":"2026-09-18T16:00:33.65719346+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
8
+ {"time":"2026-09-18T16:02:40.593485088+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
9
+ {"time":"2026-09-18T16:20:07.572012899+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
10
+ {"time":"2026-09-18T16:23:43.323427431+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
11
+ {"time":"2026-09-21T19:22:03.861319344+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent/tools/mcp.Initialize","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/tools/mcp/init.go","line":299},"msg":"Initializing MCP clients"}
12
+ {"time":"2026-09-21T19:22:04.23995225+02:00","level":"ERROR","source":{"function":"github.com/charmbracelet/crush/internal/agent/tools/mcp.createSession","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/tools/mcp/init.go","line":1010},"msg":"MCP client failed to initialize","error":"calling \"initialize\": sending \"initialize\": Bad Request","name":"github"}
13
+ {"time":"2026-09-21T19:22:18.729148361+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
14
+ {"time":"2026-09-21T19:22:25.271136048+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
15
+ {"time":"2026-09-21T19:22:33.202034044+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.logTurnSkillUsage","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/coordinator.go","line":1767},"msg":"Skill turn summary","component":"skills","session_id":"5bd2bcdf-bbb3-4350-97df-ce97d7ca226f","prompt_len":20,"active_total":6,"loaded_total":0,"loaded_this_turn":null}
16
+ {"time":"2026-09-21T19:22:57.305460123+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
17
+ {"time":"2026-09-21T19:23:03.924292743+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
18
+ {"time":"2026-09-21T19:40:50.972548935+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
19
+ {"time":"2026-09-21T19:40:59.065713906+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.logTurnSkillUsage","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/coordinator.go","line":1767},"msg":"Skill turn summary","component":"skills","session_id":"5bd2bcdf-bbb3-4350-97df-ce97d7ca226f","prompt_len":17,"active_total":6,"loaded_total":0,"loaded_this_turn":null}
20
+ {"time":"2026-09-21T19:44:17.550755849+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
21
+ {"time":"2026-09-21T19:44:35.773646666+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
22
+ {"time":"2026-09-21T19:44:42.283737099+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
23
+ {"time":"2026-09-21T19:44:47.906431629+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
24
+ {"time":"2026-09-21T19:44:54.281161799+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
25
+ {"time":"2026-09-21T19:45:02.580345619+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
26
+ {"time":"2026-09-21T19:45:08.278014568+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
27
+ {"time":"2026-09-21T19:45:13.53778434+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.logTurnSkillUsage","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/coordinator.go","line":1767},"msg":"Skill turn summary","component":"skills","session_id":"5bd2bcdf-bbb3-4350-97df-ce97d7ca226f","prompt_len":36,"active_total":6,"loaded_total":0,"loaded_this_turn":null}
28
+ {"time":"2026-09-21T19:45:15.483901919+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
29
+ {"time":"2026-09-21T19:45:31.621709117+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
30
+ {"time":"2026-09-21T19:45:36.722703064+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.logTurnSkillUsage","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/coordinator.go","line":1767},"msg":"Skill turn summary","component":"skills","session_id":"5bd2bcdf-bbb3-4350-97df-ce97d7ca226f","prompt_len":104,"active_total":6,"loaded_total":0,"loaded_this_turn":null}
31
+ {"time":"2026-09-21T19:46:01.750479593+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
32
+ {"time":"2026-09-21T19:46:08.183458591+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
33
+ {"time":"2026-09-21T19:46:14.358537582+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
34
+ {"time":"2026-09-21T19:46:22.395818344+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.logTurnSkillUsage","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/coordinator.go","line":1767},"msg":"Skill turn summary","component":"skills","session_id":"5bd2bcdf-bbb3-4350-97df-ce97d7ca226f","prompt_len":71,"active_total":6,"loaded_total":0,"loaded_this_turn":null}
35
+ {"time":"2026-09-21T19:47:45.61095938+02:00","level":"ERROR","source":{"function":"github.com/charmbracelet/x/powernap/pkg/lsp.startServerProcess.func1","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/x/powernap@v0.1.6/pkg/lsp/client.go","line":821},"msg":"Error reading stderr","error":"read |0: file already closed"}
36
+ {"time":"2026-09-21T19:47:49.578923035+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
37
+ {"time":"2026-09-21T19:48:03.873388432+02:00","level":"WARN","source":{"function":"github.com/charmbracelet/crush/internal/event.logger.Warnf","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/event/logger.go","line":23},"msg":"sending request - Post \"https://data.charm.land/batch/\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
38
+ {"time":"2026-09-21T19:48:07.691961785+02:00","level":"INFO","source":{"function":"github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run.func9","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/agent/agent.go","line":946},"msg":"ModelProvider called","provider":"zhipu-coding","model":"glm-5.3"}
39
+ {"time":"2026-09-21T19:48:18.863674646+02:00","level":"WARN","source":{"function":"github.com/charmbracelet/crush/internal/event.logger.Warnf","file":"/home/schwander/go/pkg/mod/github.com/charmbracelet/crush@v0.95.0/internal/event/logger.go","line":23},"msg":"sending request - Post \"https://data.charm.land/batch/\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
@@ -0,0 +1,9 @@
1
+ *.egg-info
2
+ setup.cfg
3
+ __pycache__
4
+ uv.lock
5
+
6
+ example/.*
7
+ example/build/
8
+ example/*ninja
9
+
Binary file
@@ -0,0 +1,92 @@
1
+ # AGENTS.md
2
+
3
+ ## Overview
4
+
5
+ Panbuild is a literate build system for documents: it turns a YAML config
6
+ (`Panbuild.yml`) plus a Markdown "index" file into a `build.ninja` file, which
7
+ the `ninja` build tool then executes to produce documents via pandoc. The
8
+ entire implementation is a single file: `panbuild.py`.
9
+
10
+ Two-phase pipeline:
11
+
12
+ 1. `panbuild` (run in a directory containing `Panbuild.yml`) parses the index
13
+ Markdown into a pandoc AST, rewrites `!rule` links into build statements,
14
+ and emits three files in the current directory:
15
+ - `build.ninja` — variables, rules, build statements, defaults
16
+ - `.index.native` — the index document in pandoc "native" format, with
17
+ `!rule` links rewritten to point at built outputs in the build directory
18
+ - `.metadata.yml` — the `variables:` section dumped back as YAML (for use
19
+ by pandoc `-d` flags)
20
+ 2. `ninja` executes `build.ninja`. The index itself is compiled to
21
+ `<build directory>/index.html` from `.index.native`.
22
+
23
+ ## Essential commands
24
+
25
+ ```sh
26
+ uv sync # install deps into .venv (repo root)
27
+ uv run panbuild # generate build.ninja (run inside a dir with Panbuild.yml)
28
+ uv run panbuild --help # NOTE: there is no CLI arg parsing at all; args are ignored
29
+ ninja # execute the generated build.ninja
30
+ ninja -n # dry run
31
+ uv build # build the package (hatchling backend)
32
+ ```
33
+
34
+ - `uv run` works from any subdirectory (e.g. `example/`); uv discovers the
35
+ root `pyproject.toml` and manages the venv at the repo root.
36
+ - `uv.lock` is **deliberately gitignored** — do not commit it. Resolution
37
+ happens fresh on `uv sync`/`uv run`.
38
+
39
+ ## How it works (panbuild.py)
40
+
41
+ - `main()` reads `Panbuild.yml` from the **current working directory**
42
+ (hardcoded name, exits with code 1 if missing/unreadable), then drives the
43
+ `Build` class in a fixed order: `write_metadata`, then within the `open()`
44
+ context manager: `output_variables`, `output_header`, `output_rules`,
45
+ `output_targets`, `output_index`, `output_footer`.
46
+ - A build target is a Markdown link whose text starts with `!`:
47
+ `[!document tata](tata.md)` means "build `tata.md` with the `document`
48
+ rule". `istarget()` detects these; `_process_link()` emits the ninja
49
+ statement and rewrites the link (target → `build/<prefix>-<stem>.<ext>`,
50
+ the `!rule` token stripped from the link text).
51
+ - Rule targets: `<prefix>-<source stem>.<rule extension>` inside the build
52
+ directory; rules without an `extension` keep the source filename verbatim.
53
+ - Every generated target gets a `default` statement, so a bare `ninja` builds
54
+ everything.
55
+ - `header`/`footer` in `Panbuild.yml` are **raw ninja syntax** injected
56
+ verbatim (used for extra variables like `options`, extra rules, and phony
57
+ `build publish:`-style targets).
58
+ - Scalar keys under `build:` (e.g. `index`, `directory`, `prefix`) are emitted
59
+ as ninja variables so `$directory` etc. work inside commands.
60
+ - `dollar_expansion()` only expands a **leading** `$var` in a string (used for
61
+ `prefix`); the docstring itself says "Very simple and probably broken".
62
+
63
+ ## Gotchas
64
+
65
+ - **The `html` rule is mandatory**: `output_index()` hardcodes
66
+ `build <builddir>/index.html: html .index.native`. A `Panbuild.yml` without
67
+ an `html` rule produces a broken `build.ninja`.
68
+ - `panbuild` must be invoked with the project directory as cwd; there is no
69
+ way to point it at a config file.
70
+ - Generated files are **dotfiles** in cwd (`.index.native`, `.metadata.yml`)
71
+ plus `build.ninja`; the example's `.gitignore` entries (`example/.*`,
72
+ `example/*ninja`, `example/build/`) exist to hide them.
73
+ - `from pandoc.types import *` provides `Link`, `Str`, `Space`, etc. at
74
+ runtime, but basedpyright flags them as undefined variables ("Space is not
75
+ defined", etc.). These diagnostics are false positives from the wildcard
76
+ import; the code runs fine. Similarly, missing-import errors for
77
+ `pandoc`/`yaml` just mean the LSP isn't using `.venv`.
78
+ - The `pandoc` dependency (`>=2.4`) is the Python bindings package
79
+ (boisgera/pandoc), not the pandoc binary — but the generated ninja commands
80
+ shell out to the **pandoc CLI**, so a system pandoc (plus lualatex, etc.) is
81
+ needed at build time.
82
+ - `setuptools` in runtime dependencies is vestigial from the pre-uv/pre-
83
+ hatchling setup; the build backend is hatchling.
84
+
85
+ ## Testing
86
+
87
+ There is **no test suite, no CI, no lint config**. Manual verification:
88
+ regenerate the example build (`cd example && uv run panbuild`) and inspect
89
+ `build.ninja`, or run `ninja -n` for a dry run (note: the example's `toto.md`
90
+ / `tata.md` / `tofu.raw` sources are absent on purpose — generation succeeds,
91
+ only `ninja` complains about them). Version bumps are done by hand in
92
+ `pyproject.toml`.