dotfiles
bugabingas dorkfiles
owned by bugabinga
pi: remove dev tooling (moved to pi-ext repo)
fb50f666ac5587a5af39a8c1bd1b802d5d7fb232
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
Browse filesCompare with HEAD
scripts/, drivers/, justfile, agent/AGENTS.md, agent/llmiterate
state, and pi/.gitignore now live in github.com/bugabinga/pi-ext.
Dotfiles/pi keeps runtime config only: auth, settings, keybindings,
models, remember, agent/git skill stub.
Changed files (14)
pi/agent/AGENTS.md
Deleteddeleted file mode 100644 5 -DEATH TO LEGACY/COMPAT/HEDGING!
6 -DEATH TO EDGE CASES! FOUND SOME? TELL ME.
9 -- Prompts MUST be fair and profile-neutral.
10 -- Never add task instructions that name, require, forbid, or steer toward/away from an extension/tool under test.
11 -- Do not ban normal baseline strategies just to force extension usage.
12 -- If an extension needs evaluation, design neutral workloads where its natural behavior can help.
13 -- Extension-specific forcing belongs only in explicit debug experiments, not benchmark prompts.
pi/agent/llmiterate/1f19107742728ff867bbfbb138fdea3b7ab8ef4c487fa519ebc811980ff7b27d/state.json
Deleteddeleted file mode 100644 4 - ".local/share/Trash/files/umu/steamrt3/sniper_platform_3.0.20260316.216289/files/lib/python3.9/cmd.py:49:7f386ff9": {
5 - "file":
".local/share/Trash/files/umu/steamrt3/sniper_platform_3.0.20260316.216289/files/lib/python3.9/cmd.py",
8 - "promptHash":
"7f386ff9",
9 - "promptPreview":
"= '(Cmd) '",
10 - "queuedAt":
1778114437171 12 - ".local/share/Trash/files/screenpipe/apps/screenpipe-app-tauri/node_modules/parse5/dist/cjs/common/html.d.ts:14:4171ffea": {
13 - "file":
".local/share/Trash/files/screenpipe/apps/screenpipe-app-tauri/node_modules/parse5/dist/cjs/common/html.d.ts",
16 - "promptHash":
"4171ffea",
17 - "promptPreview":
"= \"prompt\",",
18 - "queuedAt":
1778114439869 20 - ".local/share/Trash/files/screenpipe/apps/screenpipe-app-tauri/node_modules/parse5/dist/common/html.d.ts:14:4171ffea": {
21 - "file":
".local/share/Trash/files/screenpipe/apps/screenpipe-app-tauri/node_modules/parse5/dist/common/html.d.ts",
24 - "promptHash":
"4171ffea",
25 - "promptPreview":
"= \"prompt\",",
26 - "queuedAt":
1778114439874 28 - ".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/node/node.d.ts:9636:b4eaa0aa": {
29 - "file":
".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/node/node.d.ts",
32 - "promptHash":
"b4eaa0aa",
33 - "promptPreview":
"= \"PROMPT\",",
34 - "queuedAt":
1778114450479 36 - ".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6293:b4eaa0aa": {
37 - "file":
".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
40 - "promptHash":
"b4eaa0aa",
41 - "promptPreview":
"= \"PROMPT\",",
42 - "queuedAt":
1778114450483 44 - ".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/web/web.d.ts:9629:b4eaa0aa": {
45 - "file":
".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/web/web.d.ts",
48 - "promptHash":
"b4eaa0aa",
49 - "promptPreview":
"= \"PROMPT\",",
50 - "queuedAt":
1778114450487 52 - ".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/genai.d.ts:9624:b4eaa0aa": {
53 - "file":
".local/share/Trash/files/git/github.com/tanvesh01/pierre-diffs/node_modules/@google/genai/dist/genai.d.ts",
56 - "promptHash":
"b4eaa0aa",
57 - "promptPreview":
"= \"PROMPT\",",
58 - "queuedAt":
1778114450490 60 - ".local/share/Trash/files/node_modules/@google/genai/dist/node/node.d.ts:9759:b4eaa0aa": {
61 - "file":
".local/share/Trash/files/node_modules/@google/genai/dist/node/node.d.ts",
64 - "promptHash":
"b4eaa0aa",
65 - "promptPreview":
"= \"PROMPT\",",
66 - "queuedAt":
1778114452193 68 - ".local/share/Trash/files/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6346:b4eaa0aa": {
69 - "file":
".local/share/Trash/files/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
72 - "promptHash":
"b4eaa0aa",
73 - "promptPreview":
"= \"PROMPT\",",
74 - "queuedAt":
1778114452196 76 - ".local/share/Trash/files/node_modules/@google/genai/dist/web/web.d.ts:9752:b4eaa0aa": {
77 - "file":
".local/share/Trash/files/node_modules/@google/genai/dist/web/web.d.ts",
80 - "promptHash":
"b4eaa0aa",
81 - "promptPreview":
"= \"PROMPT\",",
82 - "queuedAt":
1778114452200 84 - ".local/share/Trash/files/node_modules/@google/genai/dist/genai.d.ts:9747:b4eaa0aa": {
85 - "file":
".local/share/Trash/files/node_modules/@google/genai/dist/genai.d.ts",
88 - "promptHash":
"b4eaa0aa",
89 - "promptPreview":
"= \"PROMPT\",",
90 - "queuedAt":
1778114452204 92 - ".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/node/node.d.ts:9807:b4eaa0aa": {
93 - "file":
".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/node/node.d.ts",
96 - "promptHash":
"b4eaa0aa",
97 - "promptPreview":
"= \"PROMPT\",",
98 - "queuedAt":
1778114453107 100 - ".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
101 - "file":
".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
104 - "promptHash":
"b4eaa0aa",
105 - "promptPreview":
"= \"PROMPT\",",
106 - "queuedAt":
1778114453111 108 - ".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/web/web.d.ts:9800:b4eaa0aa": {
109 - "file":
".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/web/web.d.ts",
112 - "promptHash":
"b4eaa0aa",
113 - "promptPreview":
"= \"PROMPT\",",
114 - "queuedAt":
1778114453114 116 - ".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/genai.d.ts:9795:b4eaa0aa": {
117 - "file":
".local/share/Trash/files/npm/lib/node_modules/@sting8k/pi-vcc/node_modules/@google/genai/dist/genai.d.ts",
120 - "promptHash":
"b4eaa0aa",
121 - "promptPreview":
"= \"PROMPT\",",
122 - "queuedAt":
1778114453118 124 - ".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/node/node.d.ts:9807:b4eaa0aa": {
125 - "file":
".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/node/node.d.ts",
128 - "promptHash":
"b4eaa0aa",
129 - "promptPreview":
"= \"PROMPT\",",
130 - "queuedAt":
1778114454550 132 - ".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
133 - "file":
".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
136 - "promptHash":
"b4eaa0aa",
137 - "promptPreview":
"= \"PROMPT\",",
138 - "queuedAt":
1778114454554 140 - ".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/web/web.d.ts:9800:b4eaa0aa": {
141 - "file":
".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/web/web.d.ts",
144 - "promptHash":
"b4eaa0aa",
145 - "promptPreview":
"= \"PROMPT\",",
146 - "queuedAt":
1778114454558 148 - ".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/genai.d.ts:9795:b4eaa0aa": {
149 - "file":
".local/share/Trash/files/npm/lib/node_modules/@marcfargas/pi-test-harness/node_modules/@google/genai/dist/genai.d.ts",
152 - "promptHash":
"b4eaa0aa",
153 - "promptPreview":
"= \"PROMPT\",",
154 - "queuedAt":
1778114454561 156 - ".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/node/node.d.ts:9807:b4eaa0aa": {
157 - "file":
".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/node/node.d.ts",
160 - "promptHash":
"b4eaa0aa",
161 - "promptPreview":
"= \"PROMPT\",",
162 - "queuedAt":
1778114455705 164 - ".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
165 - "file":
".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
168 - "promptHash":
"b4eaa0aa",
169 - "promptPreview":
"= \"PROMPT\",",
170 - "queuedAt":
1778114455708 172 - ".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/web/web.d.ts:9800:b4eaa0aa": {
173 - "file":
".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/web/web.d.ts",
176 - "promptHash":
"b4eaa0aa",
177 - "promptPreview":
"= \"PROMPT\",",
178 - "queuedAt":
1778114455712 180 - ".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/genai.d.ts:9795:b4eaa0aa": {
181 - "file":
".local/share/Trash/files/npm/lib/node_modules/pi-model-cycler/node_modules/@google/genai/dist/genai.d.ts",
184 - "promptHash":
"b4eaa0aa",
185 - "promptPreview":
"= \"PROMPT\",",
186 - "queuedAt":
1778114455716 188 - ".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.5@@@1/README.md:220:9e329f6e": {
189 - "file":
".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.5@@@1/README.md",
192 - "promptHash":
"9e329f6e",
193 - "promptPreview":
"providers cache prompts based on exact prefix matching. When DCP prunes content, it changes messages, which invalidates…",
194 - "queuedAt":
1778114459075 196 - ".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.6@@@1/README.md:215:9e329f6e": {
197 - "file":
".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.6@@@1/README.md",
200 - "promptHash":
"9e329f6e",
201 - "promptPreview":
"providers cache prompts based on exact prefix matching. When DCP prunes content, it changes messages, which invalidates…",
202 - "queuedAt":
1778114459090 204 - ".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.7@@@1/README.md:215:9e329f6e": {
205 - "file":
".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.7@@@1/README.md",
208 - "promptHash":
"9e329f6e",
209 - "promptPreview":
"providers cache prompts based on exact prefix matching. When DCP prunes content, it changes messages, which invalidates…",
210 - "queuedAt":
1778114459111 212 - ".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.8@@@1/README.md:215:9e329f6e": {
213 - "file":
".local/share/Trash/files/.bun/install/cache/@tarquinen/opencode-dcp@3.1.8@@@1/README.md",
216 - "promptHash":
"9e329f6e",
217 - "promptPreview":
"providers cache prompts based on exact prefix matching. When DCP prunes content, it changes messages, which invalidates…",
218 - "queuedAt":
1778114459127 220 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/node/node.d.ts:9643:b4eaa0aa": {
221 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/node/node.d.ts",
224 - "promptHash":
"b4eaa0aa",
225 - "promptPreview":
"= \"PROMPT\",",
226 - "queuedAt":
1778114461347 228 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/vertex_internal/index.d.ts:6293:b4eaa0aa": {
229 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/vertex_internal/index.d.ts",
232 - "promptHash":
"b4eaa0aa",
233 - "promptPreview":
"= \"PROMPT\",",
234 - "queuedAt":
1778114461351 236 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/web/web.d.ts:9636:b4eaa0aa": {
237 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/web/web.d.ts",
240 - "promptHash":
"b4eaa0aa",
241 - "promptPreview":
"= \"PROMPT\",",
242 - "queuedAt":
1778114461355 244 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/genai.d.ts:9631:b4eaa0aa": {
245 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.49.0@@@1/dist/genai.d.ts",
248 - "promptHash":
"b4eaa0aa",
249 - "promptPreview":
"= \"PROMPT\",",
250 - "queuedAt":
1778114461358 252 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/node/node.d.ts:9759:b4eaa0aa": {
253 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/node/node.d.ts",
256 - "promptHash":
"b4eaa0aa",
257 - "promptPreview":
"= \"PROMPT\",",
258 - "queuedAt":
1778114461362 260 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/vertex_internal/index.d.ts:6346:b4eaa0aa": {
261 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/vertex_internal/index.d.ts",
264 - "promptHash":
"b4eaa0aa",
265 - "promptPreview":
"= \"PROMPT\",",
266 - "queuedAt":
1778114461366 268 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/web/web.d.ts:9752:b4eaa0aa": {
269 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/web/web.d.ts",
272 - "promptHash":
"b4eaa0aa",
273 - "promptPreview":
"= \"PROMPT\",",
274 - "queuedAt":
1778114461370 276 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/genai.d.ts:9747:b4eaa0aa": {
277 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.50.1@@@1/dist/genai.d.ts",
280 - "promptHash":
"b4eaa0aa",
281 - "promptPreview":
"= \"PROMPT\",",
282 - "queuedAt":
1778114461374 284 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/node/node.d.ts:9807:b4eaa0aa": {
285 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/node/node.d.ts",
288 - "promptHash":
"b4eaa0aa",
289 - "promptPreview":
"= \"PROMPT\",",
290 - "queuedAt":
1778114461378 292 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
293 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/vertex_internal/index.d.ts",
296 - "promptHash":
"b4eaa0aa",
297 - "promptPreview":
"= \"PROMPT\",",
298 - "queuedAt":
1778114461381 300 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/web/web.d.ts:9800:b4eaa0aa": {
301 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/web/web.d.ts",
304 - "promptHash":
"b4eaa0aa",
305 - "promptPreview":
"= \"PROMPT\",",
306 - "queuedAt":
1778114461385 308 - ".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/genai.d.ts:9795:b4eaa0aa": {
309 - "file":
".local/share/Trash/files/.bun/install/cache/@google/genai@1.51.0@@@1/dist/genai.d.ts",
312 - "promptHash":
"b4eaa0aa",
313 - "promptPreview":
"= \"PROMPT\",",
314 - "queuedAt":
1778114461388 316 - ".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/node/node.d.ts:9807:b4eaa0aa": {
317 - "file":
".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/node/node.d.ts",
320 - "promptHash":
"b4eaa0aa",
321 - "promptPreview":
"= \"PROMPT\",",
322 - "queuedAt":
1778114462875 324 - ".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
325 - "file":
".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
328 - "promptHash":
"b4eaa0aa",
329 - "promptPreview":
"= \"PROMPT\",",
330 - "queuedAt":
1778114462878 332 - ".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/web/web.d.ts:9800:b4eaa0aa": {
333 - "file":
".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/web/web.d.ts",
336 - "promptHash":
"b4eaa0aa",
337 - "promptPreview":
"= \"PROMPT\",",
338 - "queuedAt":
1778114462883 340 - ".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/genai.d.ts:9795:b4eaa0aa": {
341 - "file":
".local/share/Trash/files/.bun/install/global/node_modules/@google/genai/dist/genai.d.ts",
344 - "promptHash":
"b4eaa0aa",
345 - "promptPreview":
"= \"PROMPT\",",
346 - "queuedAt":
1778114462886 348 - ".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/node/node.d.ts:9807:b4eaa0aa": {
349 - "file":
".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/node/node.d.ts",
352 - "promptHash":
"b4eaa0aa",
353 - "promptPreview":
"= \"PROMPT\",",
354 - "queuedAt":
1778114463589 356 - ".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
357 - "file":
".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
360 - "promptHash":
"b4eaa0aa",
361 - "promptPreview":
"= \"PROMPT\",",
362 - "queuedAt":
1778114463592 364 - ".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/web/web.d.ts:9800:b4eaa0aa": {
365 - "file":
".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/web/web.d.ts",
368 - "promptHash":
"b4eaa0aa",
369 - "promptPreview":
"= \"PROMPT\",",
370 - "queuedAt":
1778114463596 372 - ".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/genai.d.ts:9795:b4eaa0aa": {
373 - "file":
".local/share/Trash/files/aliou-1777642027.631093/pi-processes/node_modules/@google/genai/dist/genai.d.ts",
376 - "promptHash":
"b4eaa0aa",
377 - "promptPreview":
"= \"PROMPT\",",
378 - "queuedAt":
1778114463599 380 - ".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/node/node.d.ts:9807:b4eaa0aa": {
381 - "file":
".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/node/node.d.ts",
384 - "promptHash":
"b4eaa0aa",
385 - "promptPreview":
"= \"PROMPT\",",
386 - "queuedAt":
1778114464845 388 - ".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/vertex_internal/index.d.ts:6384:b4eaa0aa": {
389 - "file":
".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/vertex_internal/index.d.ts",
392 - "promptHash":
"b4eaa0aa",
393 - "promptPreview":
"= \"PROMPT\",",
394 - "queuedAt":
1778114464849 396 - ".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/web/web.d.ts:9800:b4eaa0aa": {
397 - "file":
".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/web/web.d.ts",
400 - "promptHash":
"b4eaa0aa",
401 - "promptPreview":
"= \"PROMPT\",",
402 - "queuedAt":
1778114464853 404 - ".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/genai.d.ts:9795:b4eaa0aa": {
405 - "file":
".local/share/Trash/files/baflow-1777642027.777905/pi-model-cycler/node_modules/@google/genai/dist/genai.d.ts",
408 - "promptHash":
"b4eaa0aa",
409 - "promptPreview":
"= \"PROMPT\",",
410 - "queuedAt":
1778114464857 pi/agent/settings.json
Modified 2 - "lastChangelogVersion":
"0.75.5",
2 + "lastChangelogVersion":
"0.76.0",
5 5 "openai-codex/gpt-5.5",
pi/drivers/advisor_suite.py
Deleteddeleted file mode 100644 1 -title
= "Advisor suite" 21 -cwd
= "agent/extensions/lucifiber" 25 - (
"command",
"/neko status",
3000),
26 - (
"command",
"/neko on",
4000),
27 - (
"command",
"/angel-policy",
3000),
28 - (
"command",
"/devil Publish every extension to npm today, no review needed.",
18000),
29 - (
"prompt",
"Give a terse safety review of publishing many npm packages at once.",
16000),
pi/drivers/footer_suite.py
Deleteddeleted file mode 100644 1 -title
= "Footer suite" 23 -cwd
= "agent/extensions/lucifiber" 27 - (
"command",
"/quota",
6000),
28 - (
"prompt",
"In one short sentence, say what this directory contains.",
16000),
29 - (
"command",
"/footer",
4000),
30 - (
"command",
"/footer",
6000),
31 - (
"prompt",
"Now answer with exactly three words: footer status dashboard.",
14000),
pi/drivers/lucifiber_suite.py
Deleteddeleted file mode 100644 1 -title
= "Lucifiber bundle" 19 -cwd
= "agent/extensions/lucifiber" 23 - (
"command",
"/quota",
6000),
24 - (
"prompt",
"In one terse sentence, describe the Lucifiber Pi bundle in this directory.",
16000),
25 - (
"command",
"/footer",
4000),
26 - (
"command",
"/footer",
6000),
pi/drivers/prune_suite.py
Deleteddeleted file mode 100644 1 -title
= "Prune recall" 13 -cwd
= "agent/extensions/prune" 17 - (
"prompt",
"Remember this phrase for the demo: lossless compaction keeps recall searchable.",
12000),
18 - (
"command",
"/prune-recall compaction all",
5000),
19 - (
"command",
"/prune demo focus",
8000),
pi/drivers/shell_suite.py
Deleteddeleted file mode 10064415 - "terminal-notifier",
21 -cwd
= "agent/extensions/lucifiber" 25 - (
"command",
"/ssh status",
3000),
26 - (
"prompt",
"Explain what this inline shell value means: !{printf lucifiber-demo}",
14000),
27 - (
"command",
"!date now | format date '%Y-%m-%d'",
5000),
28 - (
"prompt",
"Answer with exactly three words: terminal signals ready.",
12000),
pi/drivers/tools_suite.py
Deleteddeleted file mode 10064419 -cwd
= "agent/extensions/lucifiber" 23 - (
"command",
"/builtin-tools",
4000),
24 - (
"prompt",
"Use web_fetch to fetch https://example.com and summarize the page in one sentence.",
16000),
25 - (
"prompt",
"Use ctx to run a tiny Python count of files in this directory.",
14000),
26 - (
"prompt",
"Call git_clone_safe for https://github.com/octocat/Hello-World into /tmp/pi-demo-hello-world, then report success briefly.",
18000),
pi/drivers/workflow_suite.py
Deleteddeleted file mode 100644 1 -title
= "Workflow suite" 27 -cwd
= "agent/extensions/lucifiber" 31 - (
"command",
"/session-rename release demo",
3000),
32 - (
"command",
"/cwd",
3000),
33 - (
"command",
"/llmiterate status",
4000),
34 - (
"command",
"/pulse help",
6000),
35 - (
"prompt",
"Ask me two crisp follow-up questions about npm release automation.",
14000),
36 - (
"command",
"/q",
6000),
37 - (
"command",
"/diff-review-cancel",
3000),
38 - (
"command",
"/usage",
7000),
39 - (
"send",
"q",
1000),
deleted file mode 100644 2 - python3 scripts/extensions.py list
5 - python3 scripts/extensions.py check
{{ ext }} 8 - python3 scripts/extensions.py test
{{ ext }} 11 - python3 scripts/extensions.py changelog
{{ ext }} 13 -publish ext flags=
"":
14 - python3 scripts/extensions.py publish
{{ ext }} {{ flags }} 17 - python3 scripts/demo.py
{{ name }} pi/scripts/demo.py
Deleteddeleted file mode 100755 4 -from __future__
import annotations
12 -from dataclasses
import dataclass
13 -from pathlib
import Path
14 -from types
import ModuleType
18 -except ImportError as e:
19 - raise SystemExit(
"missing Python package: pexpect")
from e
21 -ROOT
= Path(
__file__).resolve().parents[
1]
22 -DRIVERS
= ROOT
/ "drivers" 23 -EXTENSIONS
= ROOT
/ "agent" / "extensions" 26 -CAST_IDLE_LIMIT
= "4.0" 28 - "--theme",
"asciinema",
29 - "--text-font-family",
"JetBrains Mono",
30 - "--font-size",
"14",
31 - "--line-height",
"1.25",
32 - "--idle-time-limit",
"4.0",
33 - "--last-frame-duration",
"5",
38 -@dataclass(frozen
=True)
42 - extensions:
list[
str]
50 -def load_module(name:
str) -> ModuleType:
51 - path
= DRIVERS
/ f"{name}
.py" 52 - if not path.exists():
53 - raise SystemExit(
f"driver not found: {path}
")
54 - spec
= importlib.util.spec_from_file_location(
f"driver_{name}
", path)
55 - if spec
is None or spec.loader
is None:
56 - raise SystemExit(
f"cannot load driver: {path}
")
57 - module
= importlib.util.module_from_spec(spec)
58 - spec.loader.exec_module(module)
62 -def str_list(module: ModuleType, attr:
str) ->
list[
str]:
63 - value
= getattr(module, attr,
None)
64 - if not isinstance(value,
list)
or not all(
isinstance(x,
str)
and x
for x
in value):
65 - raise SystemExit(
f"driver {module.
__name__}
: {attr}
must be non-empty string list")
69 -def load_driver(name:
str) -> Driver:
70 - module
= load_module(name)
71 - title
= getattr(module,
"title", name.replace(
"_",
" ").title())
72 - if not isinstance(title,
str)
or not title:
73 - raise SystemExit(
"title must be string")
75 - cols
= getattr(module,
"cols",
100)
76 - rows
= getattr(module,
"rows",
28)
77 - if not isinstance(cols,
int)
or not isinstance(rows,
int)
or cols
< 40 or rows
< 12:
78 - raise SystemExit(
"cols/rows must be reasonable ints")
80 - cwd_raw
= getattr(module,
"cwd",
".")
81 - if not isinstance(cwd_raw,
str):
82 - raise SystemExit(
"cwd must be string")
83 - cwd
= (ROOT
/ cwd_raw).resolve()
84 - if not cwd.is_dir():
85 - raise SystemExit(
f"cwd missing: {cwd}
")
87 - steps
= getattr(module,
"steps",
None)
88 - if not isinstance(steps,
list):
89 - raise SystemExit(
"steps must be list")
96 - extensions
=str_list(module,
"extensions"),
97 - targets
=str_list(module,
"targets"),
103 - validate_driver(driver)
107 -def validate_step(step:
object) ->
None:
108 - if not isinstance(step,
tuple)
or not step:
109 - raise SystemExit(
f"invalid step: {step
!r}
")
111 - if op
not in {
"wait",
"type",
"send",
"command",
"prompt",
"ctrl",
"quit"}:
112 - raise SystemExit(
f"unknown step op: {op
!r}
")
113 - if op
== "wait" and not (
len(step)
== 2 and isinstance(step[
1],
int)):
114 - raise SystemExit(
f"wait step must be ('wait', ms): {step
!r}
")
115 - if op
in {
"type",
"send"}
and not (
len(step)
in {
2,
3}
and isinstance(step[
1],
str)):
116 - raise SystemExit(
f"{op}
step must include text: {step
!r}
")
117 - if op
in {
"command",
"prompt"}
and not (
len(step)
in {
2,
3}
and isinstance(step[
1],
str)):
118 - raise SystemExit(
f"{op}
step must include text: {step
!r}
")
119 - if op
== "ctrl" and not (
len(step)
== 2 and isinstance(step[
1],
str)
and len(step[
1])
== 1):
120 - raise SystemExit(
f"ctrl step must be ('ctrl', key): {step
!r}
")
121 - if op
== "quit" and len(step)
!= 1:
122 - raise SystemExit(
f"quit step takes no args: {step
!r}
")
125 -def validate_driver(driver: Driver) ->
None:
126 - for name
in driver.extensions:
127 - if not (EXTENSIONS
/ name
/ "index.ts").exists():
128 - raise SystemExit(
f"extension missing index.ts: {name}
")
129 - for name
in driver.targets:
130 - ext
= EXTENSIONS
/ name
131 - if not ext.is_dir():
132 - raise SystemExit(
f"target extension missing: {name}
")
133 - if not (ext
/ "README.md").exists():
134 - raise SystemExit(
f"target README missing: {ext
/ 'README.md'}
")
137 -def pi_command(driver: Driver) ->
str:
141 - "--no-context-files",
143 - "--no-prompt-templates",
146 - for name
in driver.extensions:
147 - parts.extend([
"-e",
str(EXTENSIONS
/ name)])
148 - return " ".join(shlex_quote(part)
for part
in parts)
151 -def shlex_quote(value:
str) ->
str:
153 - return shlex.quote(value)
156 -def pump(child: pexpect.spawn, seconds:
float) ->
None:
157 - end
= time.time()
+ seconds
158 - while time.time()
< end
and child.isalive():
160 - data
= child.read_nonblocking(size
=8192, timeout
=0.03)
162 - sys.stdout.write(data)
164 - except pexpect.TIMEOUT:
166 - except pexpect.EOF:
170 -def type_text(child: pexpect.spawn, text:
str, delay:
float) ->
None:
176 -def run_step(child: pexpect.spawn, step:
tuple) ->
bool:
179 - pump(child, step[
1]
/ 1000)
181 - delay
= (step[
2]
if len(step)
> 2 else 55)
/ 1000 182 - type_text(child, step[
1], delay)
184 - child.send(step[
1])
185 - pump(child, (step[
2]
if len(step)
> 2 else 500)
/ 1000)
186 - elif op
== "command":
187 - type_text(child, step[
1],
0.055)
190 - pump(child, (step[
2]
if len(step)
> 2 else 1000)
/ 1000)
191 - elif op
== "prompt":
192 - type_text(child, step[
1],
0.035)
195 - pump(child, (step[
2]
if len(step)
> 2 else 12000)
/ 1000)
197 - child.sendcontrol(step[
1])
204 -def drive(driver: Driver) ->
int:
205 - child
= pexpect.spawn(
206 - pi_command(driver),
207 - cwd
=str(driver.cwd),
210 - dimensions
=(driver.rows, driver.cols),
213 - for step
in driver.steps:
214 - if run_step(child, step):
218 - child.sendcontrol(
"c")
222 - child.terminate(force
=True)
226 -def ensure_tools() ->
None:
227 - missing
= [tool
for tool
in [
"asciinema",
"agg"]
if not shutil.which(tool)]
229 - raise SystemExit(
f"missing tool(s): {
', '.join(missing)}
")
232 -def record(driver: Driver) ->
tuple[Path, Path, Path]:
234 - OUT.mkdir(exist_ok
=True)
235 - cast
= OUT
/ f"{driver.name}
.cast" 236 - gif
= OUT
/ f"{driver.name}
.gif" 237 - txt
= OUT
/ f"{driver.name}
.txt" 240 - "asciinema",
"rec",
244 - "--window-size",
f"{driver.cols}
x{driver.rows}
",
245 - "-i", CAST_IDLE_LIMIT,
246 - "-c",
f"python3 {shlex_quote(
str(Path(
__file__).resolve()))}
--drive {shlex_quote(driver.name)}
",
249 - subprocess.run(cmd, cwd
=ROOT, check
=True)
253 - "--cols",
str(driver.cols),
254 - "--rows",
str(driver.rows),
258 - ], cwd
=ROOT, check
=True)
261 - "asciinema",
"convert",
"-f",
"txt",
str(cast),
str(txt),
"--overwrite",
262 - ], cwd
=ROOT, check
=True, stdout
=subprocess.DEVNULL)
264 - return cast, gif, txt
267 -def readme_block(driver: Driver) ->
str:
269 - f"<!-- demo:{driver.name}
:start -->\n" 270 - f"\n" 271 - f"<!-- demo:{driver.name}
:end -->" 275 -def update_readme(readme: Path, driver: Driver) ->
None:
276 - text
= readme.read_text()
277 - start
= f"<!-- demo:{driver.name}
:start -->" 278 - end
= f"<!-- demo:{driver.name}
:end -->" 279 - block
= readme_block(driver)
281 - if start
in text
and end
in text:
282 - before, rest
= text.split(start,
1)
283 - _, after
= rest.split(end,
1)
284 - readme.write_text(before
+ block
+ after)
287 - addition
= f"\n\n## Demo\n\n{block}
\n" 288 - readme.write_text(text.rstrip()
+ addition)
291 -def install_assets(driver: Driver, gif: Path) ->
None:
292 - for name
in driver.targets:
293 - ext
= EXTENSIONS
/ name
294 - assets
= ext
/ "assets" 295 - assets.mkdir(exist_ok
=True)
296 - shutil.copy2(gif, assets
/ f"{driver.name}
.gif")
297 - update_readme(ext
/ "README.md", driver)
298 - print(
f"OK asset {name}
/assets/{driver.name}
.gif")
302 - parser
= argparse.ArgumentParser()
303 - parser.add_argument(
"name", nargs
="?")
304 - parser.add_argument(
"--drive", dest
="drive_name")
305 - parser.add_argument(
"--no-install", action
="store_true")
306 - args
= parser.parse_args()
308 - if args.drive_name:
309 - return drive(load_driver(args.drive_name))
311 - raise SystemExit(
"usage: scripts/demo.py <driver>")
313 - driver
= load_driver(args.name)
314 - cast, gif, txt
= record(driver)
315 - print(
f"OK cast {cast}
")
316 - print(
f"OK gif {gif}
")
317 - print(
f"OK txt {txt}
")
318 - if not args.no_install:
319 - install_assets(driver, gif)
323 -if __name__ == "__main__":
324 - raise SystemExit(main())
pi/scripts/extensions.py
Deleteddeleted file mode 100755 4 -from __future__
import annotations
14 -from pathlib
import Path
15 -from types
import ModuleType
17 -ROOT
= Path(
__file__).resolve().parents[
1]
18 -EXT_ROOT
= ROOT
/ "agent" / "extensions" 19 -DRIVER_ROOT
= ROOT
/ "drivers" 21 - "@earendil-works/pi-ai",
22 - "@earendil-works/pi-agent-core",
23 - "@earendil-works/pi-coding-agent",
24 - "@earendil-works/pi-tui",
27 -HARNESS
= "@marcfargas/pi-test-harness" 28 -IMPORT_RE
= re.compile(
r"(?:import|export)\s+(?:[^'\"]+?\s+from\s+)?['\"]([^'\"]+)['\"]|import\(['\"]([^'\"]+)['\"]\)")
29 -SECRET_RE
= re.compile(
r"(api[_-]?key|secret|token|password)\s*[:=]\s*['\"][^'\"]{12,}", re.I)
30 -RELEASE_IGNORED_SUBJECTS
= (
"update extension release changelogs",)
31 -OSC_RE
= re.compile(
r"\x1b\][^\x07]*(?:\x07|\x1b\\)")
32 -ANSI_RE
= re.compile(
r"\x1b\[[0-?]*[ -/]*[@-~]")
33 -CHANGELOG_STYLE
= """Voice: 34 -- terse, technical, human 35 -- brutal minimalism: no marketing, no excitement, no filler 36 -- concrete nouns/verbs; name actual commands, tools, hooks, files, API 37 -- no corporate adjectives: enhanced, improved, streamlined, robust, seamless, powerful, comprehensive, leverage 38 -- no vague "various fixes" 39 -- write like a maintainer note, not an ad 40 -- short fragments beat full sentences 50 -- max 100 chars per bullet; rewrite until every bullet fits 51 -- each bullet must start with a verb, command name, or concrete noun 52 -- combine details; do not enumerate implementation internals separately 53 -- omit internal function names unless they are the change users maintain 57 -def pkg_name(spec:
str) ->
str:
58 - if spec.startswith(
"@"):
59 - parts
= spec.split(
"/")
60 - return "/".join(parts[:
2])
61 - return spec.split(
"/")[
0]
64 -def read_pkg(ext: Path) ->
dict:
65 - return json.loads((ext
/ "package.json").read_text())
68 -def ext_dirs(selected:
list[
str]) ->
list[Path]:
69 - dirs
= sorted(p.parent
for p
in EXT_ROOT.glob(
"*/package.json"))
73 - wanted
= set(selected)
77 - if ext.name
in wanted
or pkg.get(
"name")
in wanted:
80 - found
= {ext.name
for ext
in result}
| {read_pkg(ext).get(
"name")
for ext
in result}
81 - missing
= wanted
- found
83 - raise SystemExit(
f"unknown extension(s): {
', '.join(
sorted(missing))}
")
87 -def ts_files(ext: Path) ->
list[Path]:
88 - return sorted(p
for p
in ext.rglob(
"*.ts")
if "node_modules" not in p.parts)
91 -def import_specs(ext: Path) ->
set[
str]:
92 - specs:
set[
str]
= set()
93 - for file
in ts_files(ext):
94 - for match
in IMPORT_RE.finditer(file.read_text(errors
="ignore")):
95 - spec
= match.group(
1)
or match.group(
2)
101 -def err(errors:
list[
str], ext: Path, msg:
str) ->
None:
102 - errors.append(
f"{ext.name}
: {msg}
")
105 -def static_check(ext: Path) ->
list[
str]:
106 - errors:
list[
str]
= []
108 - pkg
= read_pkg(ext)
109 - except Exception as e:
110 - return [
f"{ext.name}
: invalid package.json: {e}
"]
112 - expected
= f"@bugabinga/pi-ext-{ext.name}
" 113 - if pkg.get(
"name")
!= expected:
114 - err(errors, ext,
f"package name must be {expected
!r}
")
115 - if pkg.get(
"type")
!= "module":
116 - err(errors, ext,
"package.json type must be 'module'")
117 - if pkg.get(
"main")
!= "index.ts":
118 - err(errors, ext,
"package.json main must be 'index.ts'")
119 - if not (ext
/ "index.ts").exists():
120 - err(errors, ext,
"missing index.ts")
121 - if pkg.get(
"license")
!= "MIT":
122 - err(errors, ext,
"package license must be MIT")
123 - if not (ext
/ "README.md").exists():
124 - err(errors, ext,
"missing README.md")
126 - deps
= pkg.get(
"dependencies", {})
or {}
127 - peers
= pkg.get(
"peerDependencies", {})
or {}
128 - dev
= pkg.get(
"devDependencies", {})
or {}
129 - scripts
= pkg.get(
"scripts", {})
or {}
131 - if dev.get(HARNESS)
is None:
132 - err(errors, ext,
f"missing devDependency {HARNESS}
")
133 - if scripts.get(
"test:harness")
!= "bun test ./__tests__/harness.test.ts":
134 - err(errors, ext,
"missing script test:harness='bun test ./__tests__/harness.test.ts'")
135 - if not (ext
/ "__tests__" / "harness.test.ts").exists():
136 - err(errors, ext,
"missing __tests__/harness.test.ts")
139 - if dep
in PI_PEERS:
140 - err(errors, ext,
f"Pi package {dep}
belongs in peerDependencies, not dependencies")
141 - if dep.startswith(
"@bugabinga/pi-ext-"):
142 - err(errors, ext,
f"must not depend on sibling extension {dep}
")
144 - if dep.startswith(
"@bugabinga/pi-ext-"):
145 - err(errors, ext,
f"must not peer-depend on sibling extension {dep}
")
147 - specs
= import_specs(ext)
151 - if not (s.startswith(
".")
or s.startswith(
"/")
or s.startswith(
"node:")
or s.startswith(
"bun:"))
155 - if spec.startswith(
"@bugabinga/pi-ext-"):
156 - err(errors, ext,
f"must not import sibling extension {spec}
")
158 - for file
in ts_files(ext):
159 - text
= file.read_text(errors
="ignore")
160 - for match
in IMPORT_RE.finditer(text):
161 - spec
= match.group(
1)
or match.group(
2)
162 - if not spec
or not spec.startswith(
"../"):
164 - resolved
= (file.parent
/ spec).resolve()
166 - resolved.relative_to(ext.resolve())
168 - err(errors, ext,
f"cross-extension relative import {spec}
in {file.relative_to(ext)}
")
169 - if SECRET_RE.search(text):
170 - err(errors, ext,
f"possible secret in {file.relative_to(ext)}
")
172 - for dep
in sorted(packages
& PI_PEERS):
173 - if dep
not in peers:
174 - err(errors, ext,
f"imported {dep}
but missing peerDependency")
175 - for dep
in sorted(packages
- PI_PEERS):
176 - if dep
not in deps
and dep
not in peers
and dep
not in dev:
177 - err(errors, ext,
f"imported external package {dep}
but package.json does not declare it")
182 -def external_deps(pkg:
dict) ->
list[
str]:
184 - for key
in (
"dependencies",
"peerDependencies",
"devDependencies"):
185 - deps.update((pkg.get(key)
or {}).keys())
186 - return sorted(deps)
189 -def build(ext: Path, out_root: Path) ->
None:
190 - pkg
= read_pkg(ext)
191 - cmd
= [
"bun",
"build",
"index.ts",
"--target",
"bun",
"--outdir",
str(out_root
/ ext.name)]
192 - for dep
in external_deps(pkg):
193 - cmd.extend([
"--external", dep])
194 - subprocess.run(cmd, cwd
=ext, check
=True, stdout
=subprocess.PIPE, stderr
=subprocess.PIPE, text
=True)
197 -def run_harness(ext: Path) ->
None:
199 - [
"bun",
"test",
"./__tests__/harness.test.ts"],
202 - stdout
=subprocess.PIPE,
203 - stderr
=subprocess.PIPE,
208 -def cmd_list(selected:
list[
str]) ->
int:
209 - for ext
in ext_dirs(selected):
210 - print(
f"{ext.name}
\t{read_pkg(ext).get(
'name')}
")
214 -def git(
*args:
str, check:
bool = True, capture:
bool = False) -> subprocess.CompletedProcess[
str]:
215 - return subprocess.run(
220 - stdout
=subprocess.PIPE
if capture
else None,
221 - stderr
=subprocess.PIPE
if capture
else None,
225 -def git_dirty(paths:
list[Path]) ->
bool:
226 - rels
= [
str(p.relative_to(ROOT))
for p
in paths]
227 - proc
= git(
"status",
"--porcelain",
"--",
*rels, check
=True, capture
=True)
228 - return bool(proc.stdout.strip())
231 -def git_changes(ext: Path, since:
str | None) ->
list[
str]:
232 - cmd
= [
"log",
"--format=%h %s"]
234 - cmd.append(
f"{since}
..HEAD")
235 - cmd.extend([
"--",
str(ext.relative_to(ROOT))])
236 - proc
= git(
*cmd, capture
=True)
237 - lines
= [line.strip()
for line
in proc.stdout.splitlines()
if line.strip()]
238 - return [line
for line
in lines
if not any(line.endswith(subject)
for subject
in RELEASE_IGNORED_SUBJECTS)]
241 -def latest_release_tag(pkg_name:
str) ->
str | None:
242 - proc
= git(
"tag",
"--list",
f"{pkg_name}
@*",
"--sort=-creatordate", capture
=True)
243 - tags
= [line.strip()
for line
in proc.stdout.splitlines()
if line.strip()]
244 - return tags[
0]
if tags
else None 247 -def strip_terminal_noise(text:
str) ->
str:
248 - return ANSI_RE.sub(
"", OSC_RE.sub(
"", text)).strip()
251 -def changelog_prompt(ext: Path) ->
str:
252 - pkg
= read_pkg(ext)
253 - version
= pkg.get(
"version",
"0.0.0")
254 - tag
= latest_release_tag(pkg[
"name"])
255 - commits
= git_changes(ext, tag)
256 - commit_text
= "\n".join(
f"- {line}
" for line
in commits)
or "- no commits since previous tag" 257 - rel
= ext.relative_to(ROOT)
258 - return f"""You are writing one changelog section for one Pi extension. 260 -Output markdown only. No preamble. No code fence. 262 -{CHANGELOG_STYLE.format(version
=version)}
265 -Extension: {ext.name}
266 -Package: {pkg[
"name"]}
269 -Previous tag: {tag
or "none"}
271 -Inspect source/readme/tests/changelog under the path. Do not edit files. 272 -Use tools if useful. You are in an ephemeral Pi session with normal tools/extensions loaded. 274 -Git commits touching this extension: 279 -def generate_changelog_entry(ext: Path, model:
str | None = None) ->
str:
280 - cmd
= [
"pi",
"--no-session",
"-p"]
282 - cmd.extend([
"--model", model])
283 - cmd.append(changelog_prompt(ext))
284 - proc
= subprocess.run(cmd, cwd
=ROOT, text
=True, stdout
=subprocess.PIPE, stderr
=subprocess.PIPE)
285 - if proc.returncode
!= 0:
287 - print(proc.stderr, file
=sys.stderr)
288 - raise subprocess.CalledProcessError(proc.returncode, proc.args, proc.stdout, proc.stderr)
289 - out
= strip_terminal_noise(proc.stdout)
290 - if not out.startswith(
"## "):
291 - raise RuntimeError(
f"bad changelog output for {ext.name}
: {out[:
200]
!r}
")
292 - return out.rstrip()
+ "\n" 295 -def update_changelog(ext: Path, model:
str | None = None) ->
str:
296 - pkg
= read_pkg(ext)
297 - path
= ext
/ "CHANGELOG.md" 298 - entry
= generate_changelog_entry(ext, model)
299 - heading
= f"## {pkg.get(
'version',
'0.0.0')}
" 300 - if not path.exists():
301 - path.write_text(
f"# Changelog\n\n{entry}
")
302 - print(
f"OK changelog {ext.name}
")
305 - text
= path.read_text()
306 - if heading
in text:
307 - lines
= text.splitlines(keepends
=True)
308 - start
= next(i
for i, line
in enumerate(lines)
if line.startswith(heading))
309 - end
= next((i
for i
in range(start
+ 1,
len(lines))
if lines[i].startswith(
"## ")),
len(lines))
310 - path.write_text(
"".join(lines[:start])
+ entry
+ "\n" + "".join(lines[end:]).lstrip(
"\n"))
311 - elif text.startswith(
"# Changelog"):
312 - _, rest
= text.split(
"\n",
1)
313 - path.write_text(
"# Changelog\n\n" + entry
+ "\n" + rest.lstrip(
"\n"))
315 - path.write_text(
f"# Changelog\n\n{entry}
\n{text}
")
316 - print(
f"OK changelog {ext.name}
")
320 -def load_driver(path: Path) -> ModuleType:
321 - spec
= importlib.util.spec_from_file_location(
f"driver_{path.stem}
", path)
322 - if spec
is None or spec.loader
is None:
323 - raise SystemExit(
f"cannot load driver: {path}
")
324 - module
= importlib.util.module_from_spec(spec)
325 - spec.loader.exec_module(module)
329 -def drivers_for(exts:
list[Path]) ->
list[
tuple[
str,
list[
str]]]:
330 - selected
= {ext.name
for ext
in exts}
331 - drivers:
list[
tuple[
str,
list[
str]]]
= []
332 - for path
in sorted(DRIVER_ROOT.glob(
"*.py")):
333 - if path.name.startswith(
"__"):
335 - module
= load_driver(path)
336 - targets
= getattr(module,
"targets", [])
337 - if isinstance(targets,
list)
and selected.intersection(targets):
338 - drivers.append((path.stem, [t
for t
in targets
if isinstance(t,
str)]))
342 -def update_demos(exts:
list[Path]) ->
list[Path]:
343 - drivers
= drivers_for(exts)
345 - print(
"OK demo none")
347 - touched:
set[Path]
= set()
348 - for driver, targets
in drivers:
349 - subprocess.run([
"python3",
"scripts/demo.py", driver], cwd
=ROOT, check
=True)
350 - touched.update(EXT_ROOT
/ target
for target
in targets)
351 - print(
f"OK demo {driver}
")
352 - return sorted(path
for path
in touched
if path.exists())
355 -def tag_name(ext: Path) ->
str:
356 - pkg
= read_pkg(ext)
357 - return f"{pkg[
'name']}
@{pkg.get(
'version',
'0.0.0')}
" 360 -def create_tags(exts:
list[Path]) ->
list[
str]:
361 - tags:
list[
str]
= []
363 - tag
= tag_name(ext)
364 - exists
= git(
"rev-parse",
"--verify",
"--quiet",
f"refs/tags/{tag}
", check
=False).returncode
== 0 366 - print(
f"OK tag {tag}
exists")
369 - print(
f"OK tag {tag}
")
374 -def commit_release(selected:
list[Path], paths_to_add:
list[Path]) ->
None:
375 - paths
= sorted({
str(path.relative_to(ROOT))
for path
in paths_to_add})
377 - if git(
"diff",
"--cached",
"--quiet",
"--",
*paths, check
=False).returncode
== 0:
378 - print(
"OK commit none")
380 - names
= ", ".join(ext.name
for ext
in selected)
381 - git(
"commit",
"-m",
f"release(pi-ext): {names}
",
"--",
*paths)
382 - print(
f"OK commit {names}
")
385 -def push_release(tags:
list[
str]) ->
None:
388 - git(
"push",
"origin",
*tags)
392 -def check_static(dirs:
list[Path]) ->
int:
393 - errors:
list[
str]
= []
395 - errors.extend(static_check(ext))
398 - print(
f"ERROR {e}
", file
=sys.stderr)
400 - print(
f"OK static {
len(dirs)}
extension package(s)")
404 -def check_build(dirs:
list[Path]) ->
int:
405 - if not shutil.which(
"bun"):
406 - print(
"ERROR bun not found", file
=sys.stderr)
409 - with tempfile.TemporaryDirectory(prefix
="pi-ext-build-")
as tmp:
410 - out_root
= Path(tmp)
413 - build(ext, out_root)
414 - print(
f"OK build {ext.name}
")
415 - except subprocess.CalledProcessError
as e:
416 - print(
f"ERROR build {ext.name}
", file
=sys.stderr)
418 - print(e.stdout, file
=sys.stderr)
420 - print(e.stderr, file
=sys.stderr)
421 - return e.returncode
or 1 422 - print(
f"OK build {
len(dirs)}
extension package(s)")
426 -def cmd_test(selected:
list[
str]) ->
int:
427 - dirs
= ext_dirs(selected)
428 - if not shutil.which(
"bun"):
429 - print(
"ERROR bun not found", file
=sys.stderr)
434 - print(
f"OK harness {ext.name}
")
435 - except subprocess.CalledProcessError
as e:
436 - print(
f"ERROR harness {ext.name}
", file
=sys.stderr)
438 - print(e.stdout, file
=sys.stderr)
440 - print(e.stderr, file
=sys.stderr)
441 - return e.returncode
or 1 442 - print(
f"OK harness {
len(dirs)}
extension package(s)")
446 -def cmd_check(selected:
list[
str]) ->
int:
447 - dirs
= ext_dirs(selected)
448 - static
= check_static(dirs)
451 - built
= check_build(dirs)
454 - return cmd_test(selected)
457 -def cmd_changelog(selected:
list[
str], model:
str | None, write:
bool) ->
int:
458 - dirs
= ext_dirs(selected)
461 - entry
= update_changelog(ext, model)
463 - entry
= generate_changelog_entry(ext, model)
464 - print(entry.rstrip())
468 -def cmd_publish(selected:
list[
str],
*, dry_run:
bool, model:
str | None, skip_demo:
bool) ->
int:
470 - print(
"ERROR publish requires at least one extension", file
=sys.stderr)
473 - dirs
= ext_dirs(selected)
474 - checked
= cmd_check(selected)
479 - demos
= drivers_for(dirs)
480 - print(
"DRY RUN publish")
481 - print(
"demos: " + (
", ".join(name
for name, _targets
in demos)
if demos
else "none"))
483 - print(generate_changelog_entry(ext, model).rstrip())
484 - print(
"skip commit/tag/push")
487 - demo_paths
= []
if skip_demo
else update_demos(dirs)
489 - update_changelog(ext, model)
491 - commit_release(dirs, dirs
+ demo_paths)
492 - tags
= create_tags(dirs)
498 - parser
= argparse.ArgumentParser()
499 - sub
= parser.add_subparsers(dest
="command", required
=True)
500 - list_p
= sub.add_parser(
"list")
501 - list_p.add_argument(
"extensions", nargs
="*")
502 - check_p
= sub.add_parser(
"check")
503 - check_p.add_argument(
"extensions", nargs
="*")
504 - test_p
= sub.add_parser(
"test")
505 - test_p.add_argument(
"extensions", nargs
="*")
506 - changelog_p
= sub.add_parser(
"changelog")
507 - changelog_p.add_argument(
"extensions", nargs
="+")
508 - changelog_p.add_argument(
"--model")
509 - changelog_p.add_argument(
"--write", action
="store_true")
510 - publish_p
= sub.add_parser(
"publish")
511 - publish_p.add_argument(
"extensions", nargs
="+")
512 - publish_p.add_argument(
"--dry-run", action
="store_true")
513 - publish_p.add_argument(
"--model")
514 - publish_p.add_argument(
"--skip-demo", action
="store_true")
515 - args
= parser.parse_args()
517 - if args.command
== "list":
518 - return cmd_list(args.extensions)
519 - if args.command
== "check":
520 - return cmd_check(args.extensions)
521 - if args.command
== "test":
522 - return cmd_test(args.extensions)
523 - if args.command
== "changelog":
524 - return cmd_changelog(args.extensions, args.model, args.write)
525 - if args.command
== "publish":
526 - return cmd_publish(args.extensions, dry_run
=args.dry_run, model
=args.model, skip_demo
=args.skip_demo)
527 - raise AssertionError(args.command)
530 -if __name__ == "__main__":
531 - raise SystemExit(main())