3 5 Manual editor-save bridge from comment markers to background Pi edits.
9 +llmiterate does not autostart.
10 +`/llmiterate` or `/llmiterate on` starts it for the exact real cwd.
11 +It loads global Pi settings, then `<scope>/.pi/settings.json`; there is no
12 +upward project-root search.
17 +2. load config and state
18 +3. acquire singleton lock for the scope hash
21 +6. queue matching markers
31 +Marker must appear after a known comment prefix.
32 +Raw markers never run.
35 +void main(final
String[] a) {
37 + if (a.length
== 0) {
55 +- raw `llmiterate:` is ignored
56 +- consecutive marker lines are grouped
57 +- empty marker lines are ignored
58 +- `!llmiterate` in a comment disables the whole file
62 +Prefixes are extension-scoped.
65 +| file type | prefix |
66 +| ----------------------------------------------------------------------------------------- | ----------------- |
67 +| .c/.cc/.cpp/.cs/.cts/.go/.h/.hpp/.java/.js/.jsx/.kt/.kts/.mts/.php/.scala/.swift/.ts/.tsx | // /// /* /** |
68 +| .rs | // /// //! /* /** |
70 +| .scss/.less | // /* /** |
71 +| .py/.sh/.bash/.zsh/.fish/.rb/.pl/.pm/.r/.toml/.yaml/.yml/.dockerfile/.ex/.exs | # |
72 +| .md/.mdx/.html/.htm/.xml | |
73 +| .sql/.lua/.hs | -- |
74 +| .lisp/.el/.clj/.scm | ; ;; ;;; |
79 +Unknown extensions do not run markers.
80 +Markdown only accepts HTML comments, so headings or bullets containing
81 +`llmiterate:` are inert.
83 +Config `commentPrefixes` appends by extension:
88 + "commentPrefixes": {
96 +##
Replacement behavior 98 +For each marker block, the worker receives a prompt containing:
103 +- marker span to replace
104 +- instruction to work in/around the file
105 +- instruction to remove the marker unless impossible
107 +Before a job starts, llmiterate rechecks that the marker still exists at the
108 +same line with the same prompt hash.
109 +If it changed, the job is failed as stale and skipped.
111 +After the worker finishes, llmiterate rechecks the file.
112 +If the same marker is still present at the same line with the same prompt hash,
113 +the job is marked failed.
114 +Otherwise that job is marked done.
7 118 This extension is loaded through the root pi-ext package.
64 - "include": [
"src/**/*.{ts,tsx,rs,java,md}",
"docs/**/*.md"],
65 - "exclude": [
"**/target/**",
"**/dist/**"],
67 - "maxFileBytes":
1000000,
68 - "timeoutMs":
600000,
69 - "maxWatchDirs":
10000,
71 - "commentPrefixes": {
175 + "include": [
"src/**/*.{ts,tsx,rs,java,md}",
"docs/**/*.md"],
176 + "exclude": [
"**/target/**",
"**/dist/**"],
177 + "debounceMs":
3000,
178 + "maxFileBytes":
1000000,
179 + "timeoutMs":
600000,
180 + "maxWatchDirs":
10000,
181 + "notify":
"errors",
182 + "commentPrefixes": {
183 + "foo": [
"COMMENT"],
81 -llmiterate does not autostart.
82 -`/llmiterate` or `/llmiterate on` starts it for the exact real cwd.
83 -It loads global Pi settings, then `<scope>/.pi/settings.json`; there is no
84 -upward project-root search.
89 -2. load config and state
90 -3. acquire singleton lock for the scope hash
93 -6. queue matching markers
95 192 Only one watcher may own an exact real cwd at a time.
96 193 Another Pi session in the same cwd enters standby and reports the lock owner.
110 207 It queues prompts.
111 208 A background Pi RPC worker performs edits with normal Pi tools.
118 ---session-dir <state>/sessions
119 ---append-system-prompt <llmiterate worker rules>
121 ---thinking <optional>
130 -`LLMITERATE_WORKER=1` prevents recursive llmiterate watchers while keeping other
131 -extensions available.
166 243 - `/llmiterate log`:
167 244 latest worker JSONL transcript rendered as markdown at
168 245 `<state>/logs/latest.md`
178 -Marker must appear after a known comment prefix.
179 -Raw markers never run.
182 -void main(final
String[] a) {
184 - if (a.length
== 0) {
201 -- raw `llmiterate:` is ignored
202 -- legacy `LLM` / `PROMPT` is ignored
203 -- consecutive marker lines are grouped
204 -- empty marker lines are ignored
205 -- `!llmiterate` in a comment disables the whole file
208 -<!-- !llmiterate -->
213 -Prefixes are extension-scoped.
217 -.c/.cc/.cpp/.cs/.cts/.go/.h/.hpp/.java/.js/.jsx/.kt/.kts/.mts/.php/.scala/.swift/.ts/.tsx // /// /* /**
218 -.rs // /// //! /* /**
220 -.scss/.less // /* /**
221 -.py/.sh/.bash/.zsh/.fish/.rb/.pl/.pm/.r/.toml/.yaml/.yml/.dockerfile/.ex/.exs #
222 -.md/.mdx/.html/.htm/.xml <!-- -->
224 -.lisp/.el/.clj/.scm ; ;; ;;;
230 -Unknown extensions do not run markers.
231 -Markdown only accepts HTML comments, so headings or bullets containing
232 -`llmiterate:` are inert.
234 -Config `commentPrefixes` appends by extension:
239 - "commentPrefixes": {
240 - "foo": [
"COMMENT"],
247 -##
Replacement behavior 249 -For each marker block, the worker receives a prompt containing:
254 -- marker span to replace
255 -- instruction to work in/around the file
256 -- instruction to remove the marker unless impossible
258 -Before a job starts, llmiterate rechecks that the marker still exists at the
259 -same line with the same prompt hash.
260 -If it changed, the job is failed as stale and skipped.
262 -After the worker finishes, llmiterate rechecks the file.
263 -If the same marker is still present at the same line with the same prompt hash,
264 -the job is marked failed.
265 -Otherwise that job is marked done.