pi-usereq 0.6.0 → 0.10.0

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.
Files changed (774) hide show
  1. package/.gitignore +2 -0
  2. package/CHANGELOG.md +44 -0
  3. package/README.md +1 -1
  4. package/docs/pi.dev/coding-agent-docs/custom-provider.md +42 -1
  5. package/docs/pi.dev/coding-agent-docs/extensions.md +302 -28
  6. package/docs/pi.dev/coding-agent-docs/keybindings.md +23 -1
  7. package/docs/pi.dev/coding-agent-docs/models.md +3 -0
  8. package/docs/pi.dev/coding-agent-docs/packages.md +2 -2
  9. package/docs/pi.dev/coding-agent-docs/prompt-templates.md +21 -0
  10. package/docs/pi.dev/coding-agent-docs/providers.md +1 -0
  11. package/docs/pi.dev/coding-agent-docs/rpc.md +36 -6
  12. package/docs/pi.dev/coding-agent-docs/sdk.md +30 -5
  13. package/docs/pi.dev/coding-agent-docs/session.md +1 -1
  14. package/docs/pi.dev/coding-agent-docs/settings.md +2 -1
  15. package/docs/pi.dev/coding-agent-docs/skills.md +12 -12
  16. package/docs/pi.dev/coding-agent-docs/tree.md +2 -0
  17. package/docs/pi.dev/coding-agent-docs/tui.md +31 -0
  18. package/docs/pi.dev/mom-docs/new.md +4 -4
  19. package/package.json +1 -1
  20. package/pi-usereq/docs/REFERENCES.md +2658 -2035
  21. package/pi-usereq/docs/REQUIREMENTS.md +345 -191
  22. package/pi-usereq/docs/WORKFLOW.md +387 -363
  23. package/pi.dev-src/pi-mono/agent/src/agent-loop.ts +683 -0
  24. package/pi.dev-src/pi-mono/agent/src/agent.ts +543 -0
  25. package/pi.dev-src/pi-mono/agent/src/index.ts +8 -0
  26. package/pi.dev-src/pi-mono/agent/src/proxy.ts +367 -0
  27. package/pi.dev-src/pi-mono/agent/src/types.ts +364 -0
  28. package/pi.dev-src/pi-mono/agent/test/agent-loop.test.ts +1181 -0
  29. package/pi.dev-src/pi-mono/agent/test/agent.test.ts +463 -0
  30. package/pi.dev-src/pi-mono/agent/test/e2e.test.ts +404 -0
  31. package/pi.dev-src/pi-mono/agent/test/utils/calculate.ts +32 -0
  32. package/pi.dev-src/pi-mono/agent/test/utils/get-current-time.ts +46 -0
  33. package/pi.dev-src/pi-mono/agent/vitest.config.ts +9 -0
  34. package/pi.dev-src/pi-mono/ai/bedrock-provider.d.ts +1 -0
  35. package/pi.dev-src/pi-mono/ai/bedrock-provider.js +1 -0
  36. package/pi.dev-src/pi-mono/ai/scripts/generate-models.ts +1635 -0
  37. package/pi.dev-src/pi-mono/ai/scripts/generate-test-image.ts +34 -0
  38. package/pi.dev-src/pi-mono/ai/src/api-registry.ts +98 -0
  39. package/pi.dev-src/pi-mono/ai/src/bedrock-provider.ts +6 -0
  40. package/pi.dev-src/pi-mono/ai/src/cli.ts +133 -0
  41. package/pi.dev-src/pi-mono/ai/src/env-api-keys.ts +134 -0
  42. package/pi.dev-src/pi-mono/ai/src/index.ts +35 -0
  43. package/pi.dev-src/pi-mono/ai/src/models.generated.ts +14928 -0
  44. package/pi.dev-src/pi-mono/ai/src/models.ts +82 -0
  45. package/pi.dev-src/pi-mono/ai/src/oauth.ts +1 -0
  46. package/pi.dev-src/pi-mono/ai/src/providers/amazon-bedrock.ts +929 -0
  47. package/pi.dev-src/pi-mono/ai/src/providers/anthropic.ts +1125 -0
  48. package/pi.dev-src/pi-mono/ai/src/providers/azure-openai-responses.ts +253 -0
  49. package/pi.dev-src/pi-mono/ai/src/providers/faux.ts +499 -0
  50. package/pi.dev-src/pi-mono/ai/src/providers/github-copilot-headers.ts +37 -0
  51. package/pi.dev-src/pi-mono/ai/src/providers/google-gemini-cli.ts +996 -0
  52. package/pi.dev-src/pi-mono/ai/src/providers/google-shared.ts +354 -0
  53. package/pi.dev-src/pi-mono/ai/src/providers/google-vertex.ts +543 -0
  54. package/pi.dev-src/pi-mono/ai/src/providers/google.ts +500 -0
  55. package/pi.dev-src/pi-mono/ai/src/providers/mistral.ts +629 -0
  56. package/pi.dev-src/pi-mono/ai/src/providers/openai-codex-responses.ts +984 -0
  57. package/pi.dev-src/pi-mono/ai/src/providers/openai-completions.ts +1063 -0
  58. package/pi.dev-src/pi-mono/ai/src/providers/openai-responses-shared.ts +539 -0
  59. package/pi.dev-src/pi-mono/ai/src/providers/openai-responses.ts +264 -0
  60. package/pi.dev-src/pi-mono/ai/src/providers/register-builtins.ts +433 -0
  61. package/pi.dev-src/pi-mono/ai/src/providers/simple-options.ts +47 -0
  62. package/pi.dev-src/pi-mono/ai/src/providers/transform-messages.ts +220 -0
  63. package/pi.dev-src/pi-mono/ai/src/stream.ts +59 -0
  64. package/pi.dev-src/pi-mono/ai/src/types.ts +417 -0
  65. package/pi.dev-src/pi-mono/ai/src/utils/event-stream.ts +87 -0
  66. package/pi.dev-src/pi-mono/ai/src/utils/hash.ts +13 -0
  67. package/pi.dev-src/pi-mono/ai/src/utils/headers.ts +7 -0
  68. package/pi.dev-src/pi-mono/ai/src/utils/json-parse.ts +124 -0
  69. package/pi.dev-src/pi-mono/ai/src/utils/overflow.ts +138 -0
  70. package/pi.dev-src/pi-mono/ai/src/utils/sanitize-unicode.ts +25 -0
  71. package/pi.dev-src/pi-mono/ai/src/utils/typebox-helpers.ts +24 -0
  72. package/pi.dev-src/pi-mono/ai/src/utils/validation.ts +324 -0
  73. package/pi.dev-src/pi-mono/ai/test/abort.test.ts +260 -0
  74. package/pi.dev-src/pi-mono/ai/test/anthropic-oauth.test.ts +99 -0
  75. package/pi.dev-src/pi-mono/ai/test/anthropic-opus-4-7-smoke.test.ts +72 -0
  76. package/pi.dev-src/pi-mono/ai/test/anthropic-sse-parsing.test.ts +113 -0
  77. package/pi.dev-src/pi-mono/ai/test/anthropic-thinking-disable.test.ts +152 -0
  78. package/pi.dev-src/pi-mono/ai/test/anthropic-tool-name-normalization.test.ts +205 -0
  79. package/pi.dev-src/pi-mono/ai/test/azure-utils.ts +28 -0
  80. package/pi.dev-src/pi-mono/ai/test/bedrock-endpoint-resolution.test.ts +131 -0
  81. package/pi.dev-src/pi-mono/ai/test/bedrock-models.test.ts +66 -0
  82. package/pi.dev-src/pi-mono/ai/test/bedrock-thinking-payload.test.ts +107 -0
  83. package/pi.dev-src/pi-mono/ai/test/bedrock-utils.ts +18 -0
  84. package/pi.dev-src/pi-mono/ai/test/cache-retention.test.ts +335 -0
  85. package/pi.dev-src/pi-mono/ai/test/context-overflow.test.ts +714 -0
  86. package/pi.dev-src/pi-mono/ai/test/cross-provider-handoff.test.ts +458 -0
  87. package/pi.dev-src/pi-mono/ai/test/data/red-circle.png +0 -0
  88. package/pi.dev-src/pi-mono/ai/test/empty.test.ts +742 -0
  89. package/pi.dev-src/pi-mono/ai/test/faux-provider.test.ts +597 -0
  90. package/pi.dev-src/pi-mono/ai/test/fireworks-models.test.ts +49 -0
  91. package/pi.dev-src/pi-mono/ai/test/github-copilot-anthropic.test.ts +108 -0
  92. package/pi.dev-src/pi-mono/ai/test/github-copilot-oauth.test.ts +196 -0
  93. package/pi.dev-src/pi-mono/ai/test/google-gemini-cli-claude-thinking-header.test.ts +103 -0
  94. package/pi.dev-src/pi-mono/ai/test/google-gemini-cli-empty-stream.test.ts +108 -0
  95. package/pi.dev-src/pi-mono/ai/test/google-gemini-cli-retry-delay.test.ts +53 -0
  96. package/pi.dev-src/pi-mono/ai/test/google-shared-convert-tools.test.ts +187 -0
  97. package/pi.dev-src/pi-mono/ai/test/google-shared-gemini3-unsigned-tool-call.test.ts +172 -0
  98. package/pi.dev-src/pi-mono/ai/test/google-shared-image-tool-result-routing.test.ts +124 -0
  99. package/pi.dev-src/pi-mono/ai/test/google-thinking-disable.test.ts +183 -0
  100. package/pi.dev-src/pi-mono/ai/test/google-thinking-signature.test.ts +38 -0
  101. package/pi.dev-src/pi-mono/ai/test/google-tool-call-missing-args.test.ts +105 -0
  102. package/pi.dev-src/pi-mono/ai/test/google-vertex-api-key-resolution.test.ts +144 -0
  103. package/pi.dev-src/pi-mono/ai/test/image-tool-result.test.ts +481 -0
  104. package/pi.dev-src/pi-mono/ai/test/interleaved-thinking.test.ts +145 -0
  105. package/pi.dev-src/pi-mono/ai/test/lazy-module-load.test.ts +102 -0
  106. package/pi.dev-src/pi-mono/ai/test/mistral-reasoning-mode.test.ts +66 -0
  107. package/pi.dev-src/pi-mono/ai/test/mistral-tool-schema.test.ts +61 -0
  108. package/pi.dev-src/pi-mono/ai/test/oauth.ts +89 -0
  109. package/pi.dev-src/pi-mono/ai/test/openai-codex-cache-affinity-e2e.test.ts +36 -0
  110. package/pi.dev-src/pi-mono/ai/test/openai-codex-stream.test.ts +686 -0
  111. package/pi.dev-src/pi-mono/ai/test/openai-completions-cache-control-format.test.ts +189 -0
  112. package/pi.dev-src/pi-mono/ai/test/openai-completions-prompt-cache.test.ts +198 -0
  113. package/pi.dev-src/pi-mono/ai/test/openai-completions-thinking-as-text.test.ts +214 -0
  114. package/pi.dev-src/pi-mono/ai/test/openai-completions-tool-choice.test.ts +560 -0
  115. package/pi.dev-src/pi-mono/ai/test/openai-completions-tool-result-images.test.ts +101 -0
  116. package/pi.dev-src/pi-mono/ai/test/openai-responses-cache-affinity-e2e.test.ts +32 -0
  117. package/pi.dev-src/pi-mono/ai/test/openai-responses-copilot-provider.test.ts +128 -0
  118. package/pi.dev-src/pi-mono/ai/test/openai-responses-foreign-toolcall-id.test.ts +66 -0
  119. package/pi.dev-src/pi-mono/ai/test/openai-responses-partial-json-cleanup.test.ts +101 -0
  120. package/pi.dev-src/pi-mono/ai/test/openai-responses-reasoning-replay-e2e.test.ts +292 -0
  121. package/pi.dev-src/pi-mono/ai/test/openai-responses-tool-result-images.test.ts +200 -0
  122. package/pi.dev-src/pi-mono/ai/test/openrouter-cache-write-repro.test.ts +78 -0
  123. package/pi.dev-src/pi-mono/ai/test/overflow.test.ts +64 -0
  124. package/pi.dev-src/pi-mono/ai/test/responseid.test.ts +145 -0
  125. package/pi.dev-src/pi-mono/ai/test/stream.test.ts +1405 -0
  126. package/pi.dev-src/pi-mono/ai/test/supports-xhigh.test.ts +34 -0
  127. package/pi.dev-src/pi-mono/ai/test/tokens.test.ts +304 -0
  128. package/pi.dev-src/pi-mono/ai/test/tool-call-id-normalization.test.ts +291 -0
  129. package/pi.dev-src/pi-mono/ai/test/tool-call-without-result.test.ts +313 -0
  130. package/pi.dev-src/pi-mono/ai/test/total-tokens.test.ts +695 -0
  131. package/pi.dev-src/pi-mono/ai/test/transform-messages-copilot-openai-to-anthropic.test.ts +191 -0
  132. package/pi.dev-src/pi-mono/ai/test/unicode-surrogate.test.ts +754 -0
  133. package/pi.dev-src/pi-mono/ai/test/validation.test.ts +116 -0
  134. package/pi.dev-src/pi-mono/ai/test/xhigh.test.ts +71 -0
  135. package/pi.dev-src/pi-mono/ai/test/zen.test.ts +25 -0
  136. package/pi.dev-src/pi-mono/ai/vitest.config.ts +9 -0
  137. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/antigravity-image-gen.ts +418 -0
  138. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/auto-commit-on-exit.ts +49 -0
  139. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/bash-spawn-hook.ts +30 -0
  140. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/bookmark.ts +50 -0
  141. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/built-in-tool-renderer.ts +249 -0
  142. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/claude-rules.ts +86 -0
  143. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/commands.ts +72 -0
  144. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/confirm-destructive.ts +59 -0
  145. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-compaction.ts +127 -0
  146. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-footer.ts +64 -0
  147. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-header.ts +73 -0
  148. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-anthropic/index.ts +604 -0
  149. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  150. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-gitlab-duo/index.ts +349 -0
  151. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  152. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-qwen-cli/index.ts +345 -0
  153. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dirty-repo-guard.ts +56 -0
  154. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom/build.sh +152 -0
  155. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  156. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom-component.ts +132 -0
  157. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  158. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  159. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/index.ts +74 -0
  160. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/wad-finder.ts +51 -0
  161. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/SKILL.md +8 -0
  162. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/dynamic.json +79 -0
  163. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/dynamic.md +5 -0
  164. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/index.ts +15 -0
  165. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-tools.ts +74 -0
  166. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/event-bus.ts +43 -0
  167. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/file-trigger.ts +41 -0
  168. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/git-checkpoint.ts +53 -0
  169. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/github-issue-autocomplete.ts +185 -0
  170. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/handoff.ts +153 -0
  171. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/hello.ts +26 -0
  172. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/hidden-thinking-label.ts +53 -0
  173. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/inline-bash.ts +94 -0
  174. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/input-transform.ts +43 -0
  175. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/interactive-shell.ts +196 -0
  176. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/mac-system-theme.ts +47 -0
  177. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/message-renderer.ts +59 -0
  178. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/minimal-mode.ts +426 -0
  179. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/modal-editor.ts +85 -0
  180. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/model-status.ts +31 -0
  181. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/notify.ts +55 -0
  182. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/overlay-qa-tests.ts +1348 -0
  183. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/overlay-test.ts +150 -0
  184. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/permission-gate.ts +34 -0
  185. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/pirate.ts +47 -0
  186. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/plan-mode/index.ts +340 -0
  187. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/plan-mode/utils.ts +168 -0
  188. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/preset.ts +430 -0
  189. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/prompt-customizer.ts +97 -0
  190. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/protected-paths.ts +30 -0
  191. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/provider-payload.ts +18 -0
  192. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/qna.ts +122 -0
  193. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/question.ts +264 -0
  194. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/questionnaire.ts +427 -0
  195. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/rainbow-editor.ts +88 -0
  196. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/reload-runtime.ts +37 -0
  197. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/rpc-demo.ts +118 -0
  198. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/sandbox/index.ts +321 -0
  199. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/sandbox/package-lock.json +92 -0
  200. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/send-user-message.ts +97 -0
  201. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/session-name.ts +27 -0
  202. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/shutdown-command.ts +63 -0
  203. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/snake.ts +343 -0
  204. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/space-invaders.ts +560 -0
  205. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/ssh.ts +220 -0
  206. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/status-line.ts +32 -0
  207. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/structured-output.ts +65 -0
  208. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/planner.md +37 -0
  209. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/reviewer.md +35 -0
  210. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/scout.md +50 -0
  211. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/worker.md +24 -0
  212. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents.ts +126 -0
  213. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/index.ts +987 -0
  214. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  215. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/prompts/implement.md +10 -0
  216. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  217. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/summarize.ts +206 -0
  218. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/system-prompt-header.ts +17 -0
  219. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/tic-tac-toe.ts +1008 -0
  220. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/timed-confirm.ts +70 -0
  221. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/titlebar-spinner.ts +58 -0
  222. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/todo.ts +297 -0
  223. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/tool-override.ts +144 -0
  224. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/tools.ts +141 -0
  225. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/trigger-compact.ts +50 -0
  226. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/truncated-tool.ts +195 -0
  227. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/widget-placement.ts +9 -0
  228. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/with-deps/index.ts +32 -0
  229. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/with-deps/package-lock.json +31 -0
  230. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/working-indicator.ts +123 -0
  231. package/pi.dev-src/pi-mono/coding-agent/examples/extensions/working-message-test.ts +25 -0
  232. package/pi.dev-src/pi-mono/coding-agent/examples/rpc-extension-ui.ts +632 -0
  233. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/01-minimal.ts +22 -0
  234. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/02-custom-model.ts +49 -0
  235. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/03-custom-prompt.ts +62 -0
  236. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/04-skills.ts +55 -0
  237. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/05-tools.ts +44 -0
  238. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/06-extensions.ts +90 -0
  239. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/07-context-files.ts +42 -0
  240. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/08-prompt-templates.ts +51 -0
  241. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/09-api-keys-and-oauth.ts +48 -0
  242. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/10-settings.ts +53 -0
  243. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/11-sessions.ts +48 -0
  244. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/12-full-control.ts +73 -0
  245. package/pi.dev-src/pi-mono/coding-agent/examples/sdk/13-session-runtime.ts +67 -0
  246. package/pi.dev-src/pi-mono/coding-agent/scripts/migrate-sessions.sh +93 -0
  247. package/pi.dev-src/pi-mono/coding-agent/src/bun/cli.ts +6 -0
  248. package/pi.dev-src/pi-mono/coding-agent/src/bun/register-bedrock.ts +4 -0
  249. package/pi.dev-src/pi-mono/coding-agent/src/cli/args.ts +335 -0
  250. package/pi.dev-src/pi-mono/coding-agent/src/cli/config-selector.ts +52 -0
  251. package/pi.dev-src/pi-mono/coding-agent/src/cli/file-processor.ts +100 -0
  252. package/pi.dev-src/pi-mono/coding-agent/src/cli/initial-message.ts +43 -0
  253. package/pi.dev-src/pi-mono/coding-agent/src/cli/list-models.ts +110 -0
  254. package/pi.dev-src/pi-mono/coding-agent/src/cli/session-picker.ts +52 -0
  255. package/pi.dev-src/pi-mono/coding-agent/src/cli.ts +17 -0
  256. package/pi.dev-src/pi-mono/coding-agent/src/config.ts +261 -0
  257. package/pi.dev-src/pi-mono/coding-agent/src/core/agent-session-runtime.ts +394 -0
  258. package/pi.dev-src/pi-mono/coding-agent/src/core/agent-session-services.ts +196 -0
  259. package/pi.dev-src/pi-mono/coding-agent/src/core/agent-session.ts +3096 -0
  260. package/pi.dev-src/pi-mono/coding-agent/src/core/auth-storage.ts +493 -0
  261. package/pi.dev-src/pi-mono/coding-agent/src/core/bash-executor.ts +154 -0
  262. package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/branch-summarization.ts +355 -0
  263. package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/compaction.ts +839 -0
  264. package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/index.ts +7 -0
  265. package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/utils.ts +170 -0
  266. package/pi.dev-src/pi-mono/coding-agent/src/core/defaults.ts +3 -0
  267. package/pi.dev-src/pi-mono/coding-agent/src/core/diagnostics.ts +15 -0
  268. package/pi.dev-src/pi-mono/coding-agent/src/core/event-bus.ts +33 -0
  269. package/pi.dev-src/pi-mono/coding-agent/src/core/exec.ts +107 -0
  270. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/ansi-to-html.ts +258 -0
  271. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/index.ts +314 -0
  272. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/template.css +1017 -0
  273. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/template.html +55 -0
  274. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/template.js +1770 -0
  275. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/tool-renderer.ts +158 -0
  276. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/vendor/highlight.min.js +1213 -0
  277. package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/vendor/marked.min.js +6 -0
  278. package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/index.ts +171 -0
  279. package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/loader.ts +606 -0
  280. package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/runner.ts +1019 -0
  281. package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/types.ts +1542 -0
  282. package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/wrapper.ts +30 -0
  283. package/pi.dev-src/pi-mono/coding-agent/src/core/footer-data-provider.ts +354 -0
  284. package/pi.dev-src/pi-mono/coding-agent/src/core/index.ts +77 -0
  285. package/pi.dev-src/pi-mono/coding-agent/src/core/keybindings.ts +370 -0
  286. package/pi.dev-src/pi-mono/coding-agent/src/core/messages.ts +195 -0
  287. package/pi.dev-src/pi-mono/coding-agent/src/core/model-registry.ts +858 -0
  288. package/pi.dev-src/pi-mono/coding-agent/src/core/model-resolver.ts +629 -0
  289. package/pi.dev-src/pi-mono/coding-agent/src/core/output-guard.ts +74 -0
  290. package/pi.dev-src/pi-mono/coding-agent/src/core/package-manager.ts +2408 -0
  291. package/pi.dev-src/pi-mono/coding-agent/src/core/prompt-templates.ts +296 -0
  292. package/pi.dev-src/pi-mono/coding-agent/src/core/resolve-config-value.ts +142 -0
  293. package/pi.dev-src/pi-mono/coding-agent/src/core/resource-loader.ts +917 -0
  294. package/pi.dev-src/pi-mono/coding-agent/src/core/sdk.ts +380 -0
  295. package/pi.dev-src/pi-mono/coding-agent/src/core/session-cwd.ts +59 -0
  296. package/pi.dev-src/pi-mono/coding-agent/src/core/session-manager.ts +1425 -0
  297. package/pi.dev-src/pi-mono/coding-agent/src/core/settings-manager.ts +999 -0
  298. package/pi.dev-src/pi-mono/coding-agent/src/core/skills.ts +508 -0
  299. package/pi.dev-src/pi-mono/coding-agent/src/core/slash-commands.ts +39 -0
  300. package/pi.dev-src/pi-mono/coding-agent/src/core/source-info.ts +40 -0
  301. package/pi.dev-src/pi-mono/coding-agent/src/core/system-prompt.ts +172 -0
  302. package/pi.dev-src/pi-mono/coding-agent/src/core/telemetry.ts +13 -0
  303. package/pi.dev-src/pi-mono/coding-agent/src/core/timings.ts +31 -0
  304. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/bash.ts +448 -0
  305. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/edit-diff.ts +445 -0
  306. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/edit.ts +487 -0
  307. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/file-mutation-queue.ts +39 -0
  308. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/find.ts +370 -0
  309. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/grep.ts +384 -0
  310. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/index.ts +196 -0
  311. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/ls.ts +229 -0
  312. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/path-utils.ts +94 -0
  313. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/read.ts +273 -0
  314. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/render-utils.ts +64 -0
  315. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/tool-definition-wrapper.ts +45 -0
  316. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/truncate.ts +265 -0
  317. package/pi.dev-src/pi-mono/coding-agent/src/core/tools/write.ts +281 -0
  318. package/pi.dev-src/pi-mono/coding-agent/src/index.ts +352 -0
  319. package/pi.dev-src/pi-mono/coding-agent/src/main.ts +731 -0
  320. package/pi.dev-src/pi-mono/coding-agent/src/migrations.ts +314 -0
  321. package/pi.dev-src/pi-mono/coding-agent/src/modes/index.ts +9 -0
  322. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/assets/clankolas.png +0 -0
  323. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/armin.ts +382 -0
  324. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/assistant-message.ts +147 -0
  325. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/bash-execution.ts +218 -0
  326. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/bordered-loader.ts +68 -0
  327. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/branch-summary-message.ts +58 -0
  328. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/compaction-summary-message.ts +59 -0
  329. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/config-selector.ts +592 -0
  330. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/countdown-timer.ts +38 -0
  331. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/custom-editor.ts +80 -0
  332. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/custom-message.ts +99 -0
  333. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/daxnuts.ts +164 -0
  334. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/diff.ts +147 -0
  335. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/dynamic-border.ts +25 -0
  336. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/earendil-announcement.ts +53 -0
  337. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/extension-editor.ts +147 -0
  338. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/extension-input.ts +87 -0
  339. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/extension-selector.ts +107 -0
  340. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/footer.ts +220 -0
  341. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/index.ts +32 -0
  342. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/keybinding-hints.ts +24 -0
  343. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/login-dialog.ts +178 -0
  344. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/model-selector.ts +338 -0
  345. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/oauth-selector.ts +121 -0
  346. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/scoped-models-selector.ts +355 -0
  347. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/session-selector-search.ts +194 -0
  348. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/session-selector.ts +1026 -0
  349. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/settings-selector.ts +456 -0
  350. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/show-images-selector.ts +50 -0
  351. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/skill-invocation-message.ts +55 -0
  352. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/theme-selector.ts +67 -0
  353. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/thinking-selector.ts +74 -0
  354. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/tool-execution.ts +352 -0
  355. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/tree-selector.ts +1246 -0
  356. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/user-message-selector.ts +155 -0
  357. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/user-message.ts +35 -0
  358. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/visual-truncate.ts +50 -0
  359. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/interactive-mode.ts +5155 -0
  360. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/dark.json +85 -0
  361. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/light.json +84 -0
  362. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/theme-schema.json +335 -0
  363. package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/theme.ts +1141 -0
  364. package/pi.dev-src/pi-mono/coding-agent/src/modes/print-mode.ts +158 -0
  365. package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/jsonl.ts +58 -0
  366. package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/rpc-client.ts +515 -0
  367. package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/rpc-mode.ts +745 -0
  368. package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/rpc-types.ts +264 -0
  369. package/pi.dev-src/pi-mono/coding-agent/src/package-manager-cli.ts +270 -0
  370. package/pi.dev-src/pi-mono/coding-agent/src/utils/changelog.ts +99 -0
  371. package/pi.dev-src/pi-mono/coding-agent/src/utils/child-process.ts +86 -0
  372. package/pi.dev-src/pi-mono/coding-agent/src/utils/clipboard-image.ts +300 -0
  373. package/pi.dev-src/pi-mono/coding-agent/src/utils/clipboard-native.ts +22 -0
  374. package/pi.dev-src/pi-mono/coding-agent/src/utils/clipboard.ts +81 -0
  375. package/pi.dev-src/pi-mono/coding-agent/src/utils/exif-orientation.ts +183 -0
  376. package/pi.dev-src/pi-mono/coding-agent/src/utils/frontmatter.ts +39 -0
  377. package/pi.dev-src/pi-mono/coding-agent/src/utils/fs-watch.ts +30 -0
  378. package/pi.dev-src/pi-mono/coding-agent/src/utils/git.ts +192 -0
  379. package/pi.dev-src/pi-mono/coding-agent/src/utils/image-convert.ts +41 -0
  380. package/pi.dev-src/pi-mono/coding-agent/src/utils/image-resize.ts +176 -0
  381. package/pi.dev-src/pi-mono/coding-agent/src/utils/mime.ts +30 -0
  382. package/pi.dev-src/pi-mono/coding-agent/src/utils/paths.ts +20 -0
  383. package/pi.dev-src/pi-mono/coding-agent/src/utils/photon.ts +139 -0
  384. package/pi.dev-src/pi-mono/coding-agent/src/utils/shell.ts +210 -0
  385. package/pi.dev-src/pi-mono/coding-agent/src/utils/sleep.ts +18 -0
  386. package/pi.dev-src/pi-mono/coding-agent/src/utils/tools-manager.ts +287 -0
  387. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-auto-compaction-queue.test.ts +437 -0
  388. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-branching.test.ts +156 -0
  389. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-compaction.test.ts +208 -0
  390. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-concurrent.test.ts +618 -0
  391. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-dynamic-provider.test.ts +117 -0
  392. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-dynamic-tools.test.ts +182 -0
  393. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-retry.test.ts +318 -0
  394. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-runtime-events.test.ts +208 -0
  395. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-stats.test.ts +143 -0
  396. package/pi.dev-src/pi-mono/coding-agent/test/agent-session-tree-navigation.test.ts +323 -0
  397. package/pi.dev-src/pi-mono/coding-agent/test/args.test.ts +328 -0
  398. package/pi.dev-src/pi-mono/coding-agent/test/assistant-message.test.ts +57 -0
  399. package/pi.dev-src/pi-mono/coding-agent/test/auth-storage.test.ts +462 -0
  400. package/pi.dev-src/pi-mono/coding-agent/test/bash-close-hang-windows.test.ts +126 -0
  401. package/pi.dev-src/pi-mono/coding-agent/test/bash-execution-width.test.ts +80 -0
  402. package/pi.dev-src/pi-mono/coding-agent/test/block-images.test.ts +120 -0
  403. package/pi.dev-src/pi-mono/coding-agent/test/clipboard-image-bmp-conversion.test.ts +88 -0
  404. package/pi.dev-src/pi-mono/coding-agent/test/clipboard-image.test.ts +136 -0
  405. package/pi.dev-src/pi-mono/coding-agent/test/compaction-extensions-example.test.ts +66 -0
  406. package/pi.dev-src/pi-mono/coding-agent/test/compaction-extensions.test.ts +415 -0
  407. package/pi.dev-src/pi-mono/coding-agent/test/compaction-serialization.test.ts +79 -0
  408. package/pi.dev-src/pi-mono/coding-agent/test/compaction-summary-reasoning.test.ts +118 -0
  409. package/pi.dev-src/pi-mono/coding-agent/test/compaction-thinking-model.test.ts +223 -0
  410. package/pi.dev-src/pi-mono/coding-agent/test/compaction.test.ts +550 -0
  411. package/pi.dev-src/pi-mono/coding-agent/test/config.test.ts +30 -0
  412. package/pi.dev-src/pi-mono/coding-agent/test/edit-tool-legacy-input.test.ts +116 -0
  413. package/pi.dev-src/pi-mono/coding-agent/test/edit-tool-no-full-redraw.test.ts +235 -0
  414. package/pi.dev-src/pi-mono/coding-agent/test/export-html-whitespace.test.ts +12 -0
  415. package/pi.dev-src/pi-mono/coding-agent/test/export-html-xss.test.ts +28 -0
  416. package/pi.dev-src/pi-mono/coding-agent/test/extensions-discovery.test.ts +463 -0
  417. package/pi.dev-src/pi-mono/coding-agent/test/extensions-input-event.test.ts +112 -0
  418. package/pi.dev-src/pi-mono/coding-agent/test/extensions-runner.test.ts +805 -0
  419. package/pi.dev-src/pi-mono/coding-agent/test/file-mutation-queue.test.ts +163 -0
  420. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/assistant-message-with-thinking-code.json +33 -0
  421. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/before-compaction.jsonl +1003 -0
  422. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/empty-agent/.gitkeep +0 -0
  423. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/empty-cwd/.gitkeep +0 -0
  424. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/large-session.jsonl +1019 -0
  425. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/consecutive-hyphens/SKILL.md +8 -0
  426. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/disable-model-invocation/SKILL.md +9 -0
  427. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/invalid-name-chars/SKILL.md +8 -0
  428. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/invalid-yaml/SKILL.md +8 -0
  429. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/long-name/SKILL.md +8 -0
  430. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/missing-description/SKILL.md +7 -0
  431. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/multiline-description/SKILL.md +11 -0
  432. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/name-mismatch/SKILL.md +8 -0
  433. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/nested/child-skill/SKILL.md +8 -0
  434. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/no-frontmatter/SKILL.md +3 -0
  435. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/root-skill-preferred/SKILL.md +3 -0
  436. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/root-skill-preferred/nested-child/SKILL.md +3 -0
  437. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/unknown-field/SKILL.md +10 -0
  438. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/valid-skill/SKILL.md +8 -0
  439. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills-collision/first/calendar/SKILL.md +8 -0
  440. package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills-collision/second/calendar/SKILL.md +8 -0
  441. package/pi.dev-src/pi-mono/coding-agent/test/footer-data-provider.test.ts +265 -0
  442. package/pi.dev-src/pi-mono/coding-agent/test/footer-width.test.ts +115 -0
  443. package/pi.dev-src/pi-mono/coding-agent/test/frontmatter.test.ts +60 -0
  444. package/pi.dev-src/pi-mono/coding-agent/test/git-ssh-url.test.ts +78 -0
  445. package/pi.dev-src/pi-mono/coding-agent/test/git-update.test.ts +411 -0
  446. package/pi.dev-src/pi-mono/coding-agent/test/image-processing.test.ts +145 -0
  447. package/pi.dev-src/pi-mono/coding-agent/test/image-resize-callers.test.ts +53 -0
  448. package/pi.dev-src/pi-mono/coding-agent/test/initial-message.test.ts +48 -0
  449. package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-anthropic-warning.test.ts +73 -0
  450. package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-clone-command.test.ts +77 -0
  451. package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-compaction.test.ts +57 -0
  452. package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-import-command.test.ts +144 -0
  453. package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-status.test.ts +635 -0
  454. package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-suspend.test.ts +149 -0
  455. package/pi.dev-src/pi-mono/coding-agent/test/keybindings-migration.test.ts +88 -0
  456. package/pi.dev-src/pi-mono/coding-agent/test/model-registry.test.ts +1209 -0
  457. package/pi.dev-src/pi-mono/coding-agent/test/model-resolver.test.ts +436 -0
  458. package/pi.dev-src/pi-mono/coding-agent/test/package-command-paths.test.ts +144 -0
  459. package/pi.dev-src/pi-mono/coding-agent/test/package-manager-ssh.test.ts +97 -0
  460. package/pi.dev-src/pi-mono/coding-agent/test/package-manager.test.ts +1795 -0
  461. package/pi.dev-src/pi-mono/coding-agent/test/path-utils.test.ts +162 -0
  462. package/pi.dev-src/pi-mono/coding-agent/test/plan-mode-utils.test.ts +261 -0
  463. package/pi.dev-src/pi-mono/coding-agent/test/print-mode.test.ts +140 -0
  464. package/pi.dev-src/pi-mono/coding-agent/test/prompt-templates.test.ts +515 -0
  465. package/pi.dev-src/pi-mono/coding-agent/test/resource-loader.test.ts +576 -0
  466. package/pi.dev-src/pi-mono/coding-agent/test/rpc-client-clone.test.ts +29 -0
  467. package/pi.dev-src/pi-mono/coding-agent/test/rpc-example.ts +86 -0
  468. package/pi.dev-src/pi-mono/coding-agent/test/rpc-jsonl.test.ts +65 -0
  469. package/pi.dev-src/pi-mono/coding-agent/test/rpc-prompt-response-semantics.test.ts +285 -0
  470. package/pi.dev-src/pi-mono/coding-agent/test/rpc.test.ts +321 -0
  471. package/pi.dev-src/pi-mono/coding-agent/test/sdk-codex-cache-probe-tool-loop.ts +364 -0
  472. package/pi.dev-src/pi-mono/coding-agent/test/sdk-openrouter-attribution.test.ts +181 -0
  473. package/pi.dev-src/pi-mono/coding-agent/test/sdk-session-manager.test.ts +95 -0
  474. package/pi.dev-src/pi-mono/coding-agent/test/sdk-skills.test.ts +109 -0
  475. package/pi.dev-src/pi-mono/coding-agent/test/session-cwd.test.ts +91 -0
  476. package/pi.dev-src/pi-mono/coding-agent/test/session-info-modified-timestamp.test.ts +83 -0
  477. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/build-context.test.ts +268 -0
  478. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/custom-session-id.test.ts +109 -0
  479. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/file-operations.test.ts +208 -0
  480. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/labels.test.ts +198 -0
  481. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/migration.test.ts +78 -0
  482. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/save-entry.test.ts +55 -0
  483. package/pi.dev-src/pi-mono/coding-agent/test/session-manager/tree-traversal.test.ts +533 -0
  484. package/pi.dev-src/pi-mono/coding-agent/test/session-selector-path-delete.test.ts +315 -0
  485. package/pi.dev-src/pi-mono/coding-agent/test/session-selector-rename.test.ts +111 -0
  486. package/pi.dev-src/pi-mono/coding-agent/test/session-selector-search.test.ts +195 -0
  487. package/pi.dev-src/pi-mono/coding-agent/test/settings-manager-bug.test.ts +147 -0
  488. package/pi.dev-src/pi-mono/coding-agent/test/settings-manager.test.ts +319 -0
  489. package/pi.dev-src/pi-mono/coding-agent/test/skills.test.ts +432 -0
  490. package/pi.dev-src/pi-mono/coding-agent/test/stdout-cleanliness.test.ts +103 -0
  491. package/pi.dev-src/pi-mono/coding-agent/test/streaming-render-debug.ts +97 -0
  492. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-bash-persistence.test.ts +242 -0
  493. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-compaction.test.ts +343 -0
  494. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-model-extension.test.ts +325 -0
  495. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-prompt.test.ts +323 -0
  496. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-queue.test.ts +422 -0
  497. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-retry-events.test.ts +358 -0
  498. package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-runtime.test.ts +553 -0
  499. package/pi.dev-src/pi-mono/coding-agent/test/suite/harness.ts +208 -0
  500. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2023-queued-slash-command-followup.test.ts +80 -0
  501. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2753-reload-stale-resource-settings.test.ts +100 -0
  502. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2781-skill-collision-precedence.test.ts +120 -0
  503. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2791-fswatch-error-crash.test.ts +106 -0
  504. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2835-tools-allowlist-filters-extension-tools.test.ts +94 -0
  505. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2860-replaced-session-context.test.ts +274 -0
  506. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3217-scoped-model-order.test.ts +104 -0
  507. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3302-find-path-glob.test.ts +72 -0
  508. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3303-find-nested-gitignore.test.ts +83 -0
  509. package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3317-network-connection-lost-retry.test.ts +33 -0
  510. package/pi.dev-src/pi-mono/coding-agent/test/system-prompt.test.ts +102 -0
  511. package/pi.dev-src/pi-mono/coding-agent/test/test-harness.test.ts +321 -0
  512. package/pi.dev-src/pi-mono/coding-agent/test/test-harness.ts +446 -0
  513. package/pi.dev-src/pi-mono/coding-agent/test/test-theme-colors.ts +246 -0
  514. package/pi.dev-src/pi-mono/coding-agent/test/theme-export.test.ts +104 -0
  515. package/pi.dev-src/pi-mono/coding-agent/test/tool-execution-component.test.ts +331 -0
  516. package/pi.dev-src/pi-mono/coding-agent/test/tools.test.ts +889 -0
  517. package/pi.dev-src/pi-mono/coding-agent/test/tree-selector.test.ts +655 -0
  518. package/pi.dev-src/pi-mono/coding-agent/test/trigger-compact-extension.test.ts +57 -0
  519. package/pi.dev-src/pi-mono/coding-agent/test/truncate-to-width.test.ts +81 -0
  520. package/pi.dev-src/pi-mono/coding-agent/test/user-message.test.ts +25 -0
  521. package/pi.dev-src/pi-mono/coding-agent/test/utilities.ts +316 -0
  522. package/pi.dev-src/pi-mono/coding-agent/tsconfig.examples.json +16 -0
  523. package/pi.dev-src/pi-mono/coding-agent/vitest.config.ts +26 -0
  524. package/pi.dev-src/pi-mono/mom/dev.sh +30 -0
  525. package/pi.dev-src/pi-mono/mom/docker.sh +95 -0
  526. package/pi.dev-src/pi-mono/mom/scripts/migrate-timestamps.ts +121 -0
  527. package/pi.dev-src/pi-mono/mom/src/agent.ts +882 -0
  528. package/pi.dev-src/pi-mono/mom/src/context.ts +180 -0
  529. package/pi.dev-src/pi-mono/mom/src/download.ts +117 -0
  530. package/pi.dev-src/pi-mono/mom/src/events.ts +442 -0
  531. package/pi.dev-src/pi-mono/mom/src/fs-watch.ts +30 -0
  532. package/pi.dev-src/pi-mono/mom/src/log.ts +271 -0
  533. package/pi.dev-src/pi-mono/mom/src/main.ts +367 -0
  534. package/pi.dev-src/pi-mono/mom/src/sandbox.ts +221 -0
  535. package/pi.dev-src/pi-mono/mom/src/slack.ts +623 -0
  536. package/pi.dev-src/pi-mono/mom/src/store.ts +234 -0
  537. package/pi.dev-src/pi-mono/mom/src/tools/attach.ts +47 -0
  538. package/pi.dev-src/pi-mono/mom/src/tools/bash.ts +97 -0
  539. package/pi.dev-src/pi-mono/mom/src/tools/edit.ts +165 -0
  540. package/pi.dev-src/pi-mono/mom/src/tools/index.ts +19 -0
  541. package/pi.dev-src/pi-mono/mom/src/tools/read.ts +159 -0
  542. package/pi.dev-src/pi-mono/mom/src/tools/truncate.ts +236 -0
  543. package/pi.dev-src/pi-mono/mom/src/tools/write.ts +45 -0
  544. package/pi.dev-src/pi-mono/mom/test/events.test.ts +50 -0
  545. package/pi.dev-src/pi-mono/pods/scripts/model_run.sh +83 -0
  546. package/pi.dev-src/pi-mono/pods/scripts/pod_setup.sh +336 -0
  547. package/pi.dev-src/pi-mono/pods/src/cli.ts +360 -0
  548. package/pi.dev-src/pi-mono/pods/src/commands/models.ts +753 -0
  549. package/pi.dev-src/pi-mono/pods/src/commands/pods.ts +205 -0
  550. package/pi.dev-src/pi-mono/pods/src/commands/prompt.ts +84 -0
  551. package/pi.dev-src/pi-mono/pods/src/config.ts +80 -0
  552. package/pi.dev-src/pi-mono/pods/src/index.ts +2 -0
  553. package/pi.dev-src/pi-mono/pods/src/model-configs.ts +111 -0
  554. package/pi.dev-src/pi-mono/pods/src/models.json +295 -0
  555. package/pi.dev-src/pi-mono/pods/src/ssh.ts +151 -0
  556. package/pi.dev-src/pi-mono/pods/src/types.ts +27 -0
  557. package/pi.dev-src/pi-mono/tui/src/autocomplete.ts +783 -0
  558. package/pi.dev-src/pi-mono/tui/src/components/box.ts +137 -0
  559. package/pi.dev-src/pi-mono/tui/src/components/cancellable-loader.ts +40 -0
  560. package/pi.dev-src/pi-mono/tui/src/components/editor.ts +2280 -0
  561. package/pi.dev-src/pi-mono/tui/src/components/image.ts +104 -0
  562. package/pi.dev-src/pi-mono/tui/src/components/input.ts +503 -0
  563. package/pi.dev-src/pi-mono/tui/src/components/loader.ts +86 -0
  564. package/pi.dev-src/pi-mono/tui/src/components/markdown.ts +852 -0
  565. package/pi.dev-src/pi-mono/tui/src/components/select-list.ts +229 -0
  566. package/pi.dev-src/pi-mono/tui/src/components/settings-list.ts +250 -0
  567. package/pi.dev-src/pi-mono/tui/src/components/spacer.ts +28 -0
  568. package/pi.dev-src/pi-mono/tui/src/components/text.ts +106 -0
  569. package/pi.dev-src/pi-mono/tui/src/components/truncated-text.ts +65 -0
  570. package/pi.dev-src/pi-mono/tui/src/editor-component.ts +74 -0
  571. package/pi.dev-src/pi-mono/tui/src/fuzzy.ts +133 -0
  572. package/pi.dev-src/pi-mono/tui/src/index.ts +106 -0
  573. package/pi.dev-src/pi-mono/tui/src/keybindings.ts +244 -0
  574. package/pi.dev-src/pi-mono/tui/src/keys.ts +1400 -0
  575. package/pi.dev-src/pi-mono/tui/src/kill-ring.ts +46 -0
  576. package/pi.dev-src/pi-mono/tui/src/stdin-buffer.ts +386 -0
  577. package/pi.dev-src/pi-mono/tui/src/terminal-image.ts +414 -0
  578. package/pi.dev-src/pi-mono/tui/src/terminal.ts +373 -0
  579. package/pi.dev-src/pi-mono/tui/src/tui.ts +1243 -0
  580. package/pi.dev-src/pi-mono/tui/src/undo-stack.ts +28 -0
  581. package/pi.dev-src/pi-mono/tui/src/utils.ts +1085 -0
  582. package/pi.dev-src/pi-mono/tui/test/autocomplete.test.ts +542 -0
  583. package/pi.dev-src/pi-mono/tui/test/bug-regression-isimageline-startswith-bug.test.ts +237 -0
  584. package/pi.dev-src/pi-mono/tui/test/chat-simple.ts +129 -0
  585. package/pi.dev-src/pi-mono/tui/test/editor.test.ts +3812 -0
  586. package/pi.dev-src/pi-mono/tui/test/fuzzy.test.ts +98 -0
  587. package/pi.dev-src/pi-mono/tui/test/image-test.ts +56 -0
  588. package/pi.dev-src/pi-mono/tui/test/input.test.ts +580 -0
  589. package/pi.dev-src/pi-mono/tui/test/key-tester.ts +105 -0
  590. package/pi.dev-src/pi-mono/tui/test/keybindings.test.ts +38 -0
  591. package/pi.dev-src/pi-mono/tui/test/keys.test.ts +614 -0
  592. package/pi.dev-src/pi-mono/tui/test/markdown.test.ts +1236 -0
  593. package/pi.dev-src/pi-mono/tui/test/overlay-non-capturing.test.ts +609 -0
  594. package/pi.dev-src/pi-mono/tui/test/overlay-options.test.ts +538 -0
  595. package/pi.dev-src/pi-mono/tui/test/overlay-short-content.test.ts +56 -0
  596. package/pi.dev-src/pi-mono/tui/test/regression-regional-indicator-width.test.ts +52 -0
  597. package/pi.dev-src/pi-mono/tui/test/select-list.test.ts +116 -0
  598. package/pi.dev-src/pi-mono/tui/test/stdin-buffer.test.ts +422 -0
  599. package/pi.dev-src/pi-mono/tui/test/terminal-image.test.ts +279 -0
  600. package/pi.dev-src/pi-mono/tui/test/test-themes.ts +38 -0
  601. package/pi.dev-src/pi-mono/tui/test/truncate-to-width.test.ts +62 -0
  602. package/pi.dev-src/pi-mono/tui/test/truncated-text.test.ts +129 -0
  603. package/pi.dev-src/pi-mono/tui/test/tui-cell-size-input.test.ts +81 -0
  604. package/pi.dev-src/pi-mono/tui/test/tui-overlay-style-leak.test.ts +72 -0
  605. package/pi.dev-src/pi-mono/tui/test/tui-render.test.ts +509 -0
  606. package/pi.dev-src/pi-mono/tui/test/viewport-overwrite-repro.ts +106 -0
  607. package/pi.dev-src/pi-mono/tui/test/virtual-terminal.ts +218 -0
  608. package/pi.dev-src/pi-mono/tui/test/wrap-ansi.test.ts +207 -0
  609. package/pi.dev-src/pi-mono/tui/vitest.config.ts +7 -0
  610. package/pi.dev-src/pi-mono/web-ui/example/index.html +13 -0
  611. package/pi.dev-src/pi-mono/web-ui/example/src/app.css +1 -0
  612. package/pi.dev-src/pi-mono/web-ui/example/src/custom-messages.ts +99 -0
  613. package/pi.dev-src/pi-mono/web-ui/example/src/main.ts +421 -0
  614. package/pi.dev-src/pi-mono/web-ui/example/tsconfig.json +23 -0
  615. package/pi.dev-src/pi-mono/web-ui/example/vite.config.ts +6 -0
  616. package/pi.dev-src/pi-mono/web-ui/scripts/count-prompt-tokens.ts +88 -0
  617. package/pi.dev-src/pi-mono/web-ui/src/ChatPanel.ts +209 -0
  618. package/pi.dev-src/pi-mono/web-ui/src/app.css +68 -0
  619. package/pi.dev-src/pi-mono/web-ui/src/components/AgentInterface.ts +403 -0
  620. package/pi.dev-src/pi-mono/web-ui/src/components/AttachmentTile.ts +107 -0
  621. package/pi.dev-src/pi-mono/web-ui/src/components/ConsoleBlock.ts +72 -0
  622. package/pi.dev-src/pi-mono/web-ui/src/components/CustomProviderCard.ts +100 -0
  623. package/pi.dev-src/pi-mono/web-ui/src/components/ExpandableSection.ts +46 -0
  624. package/pi.dev-src/pi-mono/web-ui/src/components/Input.ts +113 -0
  625. package/pi.dev-src/pi-mono/web-ui/src/components/MessageEditor.ts +405 -0
  626. package/pi.dev-src/pi-mono/web-ui/src/components/MessageList.ts +98 -0
  627. package/pi.dev-src/pi-mono/web-ui/src/components/Messages.ts +383 -0
  628. package/pi.dev-src/pi-mono/web-ui/src/components/ProviderKeyInput.ts +153 -0
  629. package/pi.dev-src/pi-mono/web-ui/src/components/SandboxedIframe.ts +626 -0
  630. package/pi.dev-src/pi-mono/web-ui/src/components/StreamingMessageContainer.ts +103 -0
  631. package/pi.dev-src/pi-mono/web-ui/src/components/ThinkingBlock.ts +43 -0
  632. package/pi.dev-src/pi-mono/web-ui/src/components/message-renderer-registry.ts +28 -0
  633. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/ArtifactsRuntimeProvider.ts +220 -0
  634. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/AttachmentsRuntimeProvider.ts +66 -0
  635. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/ConsoleRuntimeProvider.ts +186 -0
  636. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/FileDownloadRuntimeProvider.ts +110 -0
  637. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/RuntimeMessageBridge.ts +82 -0
  638. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/RuntimeMessageRouter.ts +216 -0
  639. package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/SandboxRuntimeProvider.ts +52 -0
  640. package/pi.dev-src/pi-mono/web-ui/src/dialogs/ApiKeyPromptDialog.ts +75 -0
  641. package/pi.dev-src/pi-mono/web-ui/src/dialogs/AttachmentOverlay.ts +636 -0
  642. package/pi.dev-src/pi-mono/web-ui/src/dialogs/CustomProviderDialog.ts +274 -0
  643. package/pi.dev-src/pi-mono/web-ui/src/dialogs/ModelSelector.ts +370 -0
  644. package/pi.dev-src/pi-mono/web-ui/src/dialogs/PersistentStorageDialog.ts +144 -0
  645. package/pi.dev-src/pi-mono/web-ui/src/dialogs/ProvidersModelsTab.ts +212 -0
  646. package/pi.dev-src/pi-mono/web-ui/src/dialogs/SessionListDialog.ts +150 -0
  647. package/pi.dev-src/pi-mono/web-ui/src/dialogs/SettingsDialog.ts +218 -0
  648. package/pi.dev-src/pi-mono/web-ui/src/index.ts +120 -0
  649. package/pi.dev-src/pi-mono/web-ui/src/prompts/prompts.ts +282 -0
  650. package/pi.dev-src/pi-mono/web-ui/src/storage/app-storage.ts +60 -0
  651. package/pi.dev-src/pi-mono/web-ui/src/storage/backends/indexeddb-storage-backend.ts +193 -0
  652. package/pi.dev-src/pi-mono/web-ui/src/storage/store.ts +33 -0
  653. package/pi.dev-src/pi-mono/web-ui/src/storage/stores/custom-providers-store.ts +62 -0
  654. package/pi.dev-src/pi-mono/web-ui/src/storage/stores/provider-keys-store.ts +33 -0
  655. package/pi.dev-src/pi-mono/web-ui/src/storage/stores/sessions-store.ts +136 -0
  656. package/pi.dev-src/pi-mono/web-ui/src/storage/stores/settings-store.ts +34 -0
  657. package/pi.dev-src/pi-mono/web-ui/src/storage/types.ts +206 -0
  658. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ArtifactElement.ts +14 -0
  659. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ArtifactPill.ts +26 -0
  660. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/Console.ts +93 -0
  661. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/DocxArtifact.ts +213 -0
  662. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ExcelArtifact.ts +231 -0
  663. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/GenericArtifact.ts +117 -0
  664. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/HtmlArtifact.ts +195 -0
  665. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ImageArtifact.ts +116 -0
  666. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/MarkdownArtifact.ts +82 -0
  667. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/PdfArtifact.ts +201 -0
  668. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/SvgArtifact.ts +119 -0
  669. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/TextArtifact.ts +148 -0
  670. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/artifacts-tool-renderer.ts +310 -0
  671. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/artifacts.ts +713 -0
  672. package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/index.ts +7 -0
  673. package/pi.dev-src/pi-mono/web-ui/src/tools/extract-document.ts +275 -0
  674. package/pi.dev-src/pi-mono/web-ui/src/tools/index.ts +46 -0
  675. package/pi.dev-src/pi-mono/web-ui/src/tools/javascript-repl.ts +293 -0
  676. package/pi.dev-src/pi-mono/web-ui/src/tools/renderer-registry.ts +130 -0
  677. package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/BashRenderer.ts +52 -0
  678. package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/CalculateRenderer.ts +58 -0
  679. package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/DefaultRenderer.ts +103 -0
  680. package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/GetCurrentTimeRenderer.ts +92 -0
  681. package/pi.dev-src/pi-mono/web-ui/src/tools/types.ts +15 -0
  682. package/pi.dev-src/pi-mono/web-ui/src/utils/attachment-utils.ts +472 -0
  683. package/pi.dev-src/pi-mono/web-ui/src/utils/auth-token.ts +22 -0
  684. package/pi.dev-src/pi-mono/web-ui/src/utils/format.ts +42 -0
  685. package/pi.dev-src/pi-mono/web-ui/src/utils/i18n.ts +653 -0
  686. package/pi.dev-src/pi-mono/web-ui/src/utils/model-discovery.ts +277 -0
  687. package/pi.dev-src/pi-mono/web-ui/src/utils/proxy-utils.ts +139 -0
  688. package/pi.dev-src/pi-mono/web-ui/src/utils/test-sessions.ts +2357 -0
  689. package/pi.dev-src/pi-mono/web-ui/tsconfig.json +7 -0
  690. package/scripts/lib/extension-debug-harness.ts +3 -10
  691. package/scripts/lib/recording-extension-api.ts +71 -2
  692. package/scripts/pi-usereq-debug.sh +1 -1
  693. package/scripts/tool-args-to-params.ts +4 -15
  694. package/src/cli.ts +24 -68
  695. package/src/core/agent-tool-json.ts +53 -239
  696. package/src/core/compress-payload.ts +4 -74
  697. package/src/core/compress.ts +26 -15
  698. package/src/core/config.ts +546 -65
  699. package/src/core/debug-runtime.ts +542 -0
  700. package/src/core/extension-status.ts +324 -202
  701. package/src/core/find-constructs.ts +3 -3
  702. package/src/core/find-payload.ts +26 -132
  703. package/src/core/path-context.ts +346 -81
  704. package/src/core/pi-notify.ts +585 -315
  705. package/src/core/pi-usereq-tools.ts +57 -19
  706. package/src/core/prompt-command-catalog.ts +46 -0
  707. package/src/core/prompt-command-runtime.ts +1650 -0
  708. package/src/core/prompt-command-state.ts +211 -0
  709. package/src/core/prompts.ts +173 -41
  710. package/src/core/reference-payload.ts +5 -63
  711. package/src/core/resources.ts +61 -5
  712. package/src/core/settings-menu.ts +33 -7
  713. package/src/core/source-analyzer.ts +27 -7
  714. package/src/core/token-counter.ts +61 -79
  715. package/src/core/tool-runner.ts +38 -317
  716. package/src/index.ts +2629 -1220
  717. package/src/resources/images/favicon.svg +21 -0
  718. package/src/resources/images/pi.dev.png +0 -0
  719. package/src/resources/instructions/git_commit.md +16 -0
  720. package/src/resources/instructions/git_read-only.md +2 -0
  721. package/src/resources/prompts/analyze.md +12 -13
  722. package/src/resources/prompts/change.md +21 -59
  723. package/src/resources/prompts/check.md +14 -16
  724. package/src/resources/prompts/cover.md +21 -59
  725. package/src/resources/prompts/create.md +5 -4
  726. package/src/resources/prompts/fix.md +20 -58
  727. package/src/resources/prompts/flowchart.md +14 -49
  728. package/src/resources/prompts/implement.md +14 -50
  729. package/src/resources/prompts/new.md +20 -58
  730. package/src/resources/prompts/readme.md +14 -50
  731. package/src/resources/prompts/recreate.md +14 -45
  732. package/src/resources/prompts/refactor.md +20 -58
  733. package/src/resources/prompts/references.md +7 -43
  734. package/src/resources/prompts/renumber.md +8 -39
  735. package/src/resources/prompts/workflow.md +14 -50
  736. package/src/resources/prompts/write.md +5 -4
  737. package/tests/attended-results-scenarios.ts +30 -136
  738. package/tests/cli-command-option-parity.test.ts +148 -192
  739. package/tests/debug-extension-harness.test.ts +74 -73
  740. package/tests/extension-registration.test.ts +3626 -685
  741. package/tests/fixtures_attended_results/project/compress-line-numbers.json +1 -1
  742. package/tests/fixtures_attended_results/project/compress.json +1 -1
  743. package/tests/fixtures_attended_results/project/find-line-numbers.json +1 -1
  744. package/tests/fixtures_attended_results/project/find.json +1 -1
  745. package/tests/fixtures_attended_results/project/references.json +2 -2
  746. package/tests/fixtures_attended_results/standalone/files-compress/fixture_go.go.json +1 -1
  747. package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_go.go.json +1 -1
  748. package/tests/fixtures_attended_results/standalone/files-find/fixture_go.go.json +1 -1
  749. package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_go.go.json +1 -1
  750. package/tests/fixtures_attended_results/standalone/files-references/fixture_c.c.json +1 -1
  751. package/tests/fixtures_attended_results/standalone/files-references/fixture_cpp.cpp.json +1 -1
  752. package/tests/fixtures_attended_results/standalone/files-references/fixture_csharp.cs.json +1 -1
  753. package/tests/fixtures_attended_results/standalone/files-references/fixture_elixir.ex.json +1 -1
  754. package/tests/fixtures_attended_results/standalone/files-references/fixture_go.go.json +1 -1
  755. package/tests/fixtures_attended_results/standalone/files-references/fixture_haskell.hs.json +1 -1
  756. package/tests/fixtures_attended_results/standalone/files-references/fixture_java.java.json +1 -1
  757. package/tests/fixtures_attended_results/standalone/files-references/fixture_javascript.js.json +1 -1
  758. package/tests/fixtures_attended_results/standalone/files-references/fixture_kotlin.kt.json +1 -1
  759. package/tests/fixtures_attended_results/standalone/files-references/fixture_lua.lua.json +1 -1
  760. package/tests/fixtures_attended_results/standalone/files-references/fixture_perl.pl.json +1 -1
  761. package/tests/fixtures_attended_results/standalone/files-references/fixture_php.php.json +1 -1
  762. package/tests/fixtures_attended_results/standalone/files-references/fixture_python.py.json +1 -1
  763. package/tests/fixtures_attended_results/standalone/files-references/fixture_ruby.rb.json +1 -1
  764. package/tests/fixtures_attended_results/standalone/files-references/fixture_rust.rs.json +1 -1
  765. package/tests/fixtures_attended_results/standalone/files-references/fixture_scala.scala.json +1 -1
  766. package/tests/fixtures_attended_results/standalone/files-references/fixture_shell.sh.json +1 -1
  767. package/tests/fixtures_attended_results/standalone/files-references/fixture_swift.swift.json +1 -1
  768. package/tests/fixtures_attended_results/standalone/files-references/fixture_typescript.ts.json +1 -1
  769. package/tests/fixtures_attended_results/standalone/files-references/fixture_zig.zig.json +1 -1
  770. package/tests/helpers.ts +24 -15
  771. package/tests/oracle-project.test.ts +29 -30
  772. package/tests/oracle-standalone.test.ts +27 -1
  773. package/tests/prompt-rendering.test.ts +40 -9
  774. package/tests/python_oracle_stubs/tiktoken.py +76 -0
@@ -63,7 +63,7 @@
63
63
  - `main(...)`: parse argv, normalize config, dispatch selected runner, serialize result [`src/cli.ts`]
64
64
  - `parseArgs(...)`: map argv tokens into a structured command selection [`src/cli.ts`]
65
65
  - `takeUntilOption(...)`: collect positional operands until next option token [`src/cli.ts`]
66
- - `applyEnableStaticCheckSpecs(...)`: merge repeatable CLI static-check enable specs before command dispatch [`src/cli.ts`]
66
+ - `applyEnableStaticCheckSpecs(...)`: merge repeatable CLI static-check enable specs, preserve existing checker lists, and force targeted language flags on before command dispatch [`src/cli.ts`]
67
67
  - `loadMutableProjectConfig(...)`: load project config without intermediate persistence [`src/cli.ts`]
68
68
  - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
69
69
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
@@ -108,43 +108,13 @@
108
108
  - `extractLeadingDoxygenFields(...)`: extract file-level Doxygen fields when present [`src/core/token-counter.ts`]
109
109
  - `parseDoxygenComment(...)`: parse normalized Doxygen fields [`src/core/doxygen-parser.ts`]
110
110
  - `formatPackSummary(...)`: render aggregate summary [`src/core/token-counter.ts`]
111
- - `runFilesReferences(...)`: branch `--files-references`; emit structured explicit-file references JSON [`src/core/tool-runner.ts`]
112
- - `buildReferenceToolPayload(...)`: analyze requested files into the agent-oriented references payload [`src/core/reference-payload.ts`]
113
- - `canonicalizeReferencePath(...)`: normalize request and file paths against the caller base directory [`src/core/reference-payload.ts`]
114
- - `analyzeReferenceFile(...)`: analyze one processable file into structured imports, symbols, and comments [`src/core/reference-payload.ts`]
115
- - `detectLanguage(...)`: map extension to language key [`src/core/compress.ts`]
116
- - `SourceAnalyzer.analyze(...)`: parse source elements [`src/core/source-analyzer.ts`]
117
- - `inStringContext(...)`: suppress comment parsing inside strings [`src/core/source-analyzer.ts`]
118
- - `findComment(...)`: detect valid single-line comment boundary [`src/core/source-analyzer.ts`]
119
- - `findBlockEnd(...)`: compute construct end line [`src/core/source-analyzer.ts`]
120
- - `SourceAnalyzer.enrich(...)`: derive signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen bindings [`src/core/source-analyzer.ts`]
121
- - `cleanNames(...)`: normalize matched symbol names [`src/core/source-analyzer.ts`]
122
- - `extractSignatures(...)`: derive single-line signatures [`src/core/source-analyzer.ts`]
123
- - `detectHierarchy(...)`: assign parent-child relationships [`src/core/source-analyzer.ts`]
124
- - `extractVisibility(...)`: annotate visibility [`src/core/source-analyzer.ts`]
125
- - `parseVisibility(...)`: language-specific visibility classifier [`src/core/source-analyzer.ts`]
126
- - `extractInheritance(...)`: annotate inheritance [`src/core/source-analyzer.ts`]
127
- - `parseInheritance(...)`: language-specific inheritance parser [`src/core/source-analyzer.ts`]
128
- - `extractBodyAnnotations(...)`: capture body comments and exit points [`src/core/source-analyzer.ts`]
129
- - `inStringContext(...)`: suppress comment parsing inside strings [`src/core/source-analyzer.ts`]
130
- - `findComment(...)`: detect valid single-line comment boundary [`src/core/source-analyzer.ts`]
131
- - `cleanCommentLine(...)`: normalize comment payload [`src/core/source-analyzer.ts`]
132
- - `extractDoxygenFields(...)`: bind documentation comments to definitions [`src/core/source-analyzer.ts`]
133
- - `isPostfixDoxygenComment(...)`: detect postfix documentation markers [`src/core/source-analyzer.ts`]
134
- - `parseDoxygenComment(...)`: parse Doxygen tag/value map [`src/core/doxygen-parser.ts`]
135
- - `stripCommentDelimiters(...)`: remove language comment wrappers [`src/core/doxygen-parser.ts`]
136
- - `normalizeWhitespace(...)`: canonicalize tag body whitespace [`src/core/doxygen-parser.ts`]
137
- - `buildCommentMaps(...)`: associate comments with definitions and file descriptions [`src/core/reference-payload.ts`]
138
- - `collectFileLevelDoxygenFields(...)`: extract file-level Doxygen fields [`src/core/source-analyzer.ts`]
139
- - `parseDoxygenComment(...)`: parse Doxygen tag/value map [`src/core/doxygen-parser.ts`]
140
- - `collectElementDoxygenFields(...)`: merge direct and near-body Doxygen fields [`src/core/source-analyzer.ts`]
141
- - `parseDoxygenComment(...)`: parse Doxygen tag/value map [`src/core/doxygen-parser.ts`]
142
- - `structureDoxygenFields(...)`: normalize Doxygen fields into tag-specific JSON arrays and objects [`src/core/doxygen-parser.ts`]
143
- - `countDoxygenFieldValues(...)`: derive aggregate Doxygen counts [`src/core/doxygen-parser.ts`]
144
- - `resolveParentElement(...)`: link nested symbols to enclosing definitions [`src/core/reference-payload.ts`]
145
- - `buildCommentEntry(...)`: serialize normalized comment text and line ranges [`src/core/reference-payload.ts`]
146
- - `buildRepositoryTree(...)`: materialize the repository directory tree as structured JSON [`src/core/reference-payload.ts`]
147
- - `buildReferenceToolExecutionStderr(...)`: serialize skipped and analysis-error entries into stderr text [`src/core/reference-payload.ts`]
111
+ - `runFilesReferences(...)`: branch `--files-references`; emit monolithic explicit-file references markdown [`src/core/tool-runner.ts`]
112
+ - `generateMarkdown(...)`: analyze requested files and concatenate Python-compatible reference markdown sections [`src/core/generate-markdown.ts`]
113
+ - `detectLanguage(...)`: map extension to language key [`src/core/generate-markdown.ts`]
114
+ - `SourceAnalyzer.analyze(...)`: parse source elements [`src/core/source-analyzer.ts`]
115
+ - `SourceAnalyzer.enrich(...)`: derive signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen bindings [`src/core/source-analyzer.ts`]
116
+ - `formatMarkdown(...)`: render one file as the repository reference-markdown format [`src/core/source-analyzer.ts`]
117
+ - `normalizeSourceLineForExtraction(...)`: preserve leading tabs in source-derived markdown lines [`src/core/source-analyzer.ts`]
148
118
  - `runFilesCompress(...)`: branch `--files-compress`; compress explicit files [`src/core/tool-runner.ts`]
149
119
  - `compressFiles(...)`: compress each file into markdown blocks [`src/core/compress-files.ts`]
150
120
  - `detectLanguage(...)`: map extension to language key [`src/core/compress.ts`]
@@ -157,11 +127,12 @@
157
127
  - `countLogicalLines(...)`: count original source lines [`src/core/compress.ts`]
158
128
  - `isInString(...)`: suppress inline comment stripping inside strings [`src/core/compress.ts`]
159
129
  - `removeInlineComment(...)`: remove single-line comment suffixes [`src/core/compress.ts`]
130
+ - `normalizeRetainedLineIndentation(...)`: preserve full indentation or leading tabs before output normalization [`src/core/compress.ts`]
160
131
  - `buildCompressedLineEntry(...)`: normalize one retained line into structured output [`src/core/compress.ts`]
161
132
  - `formatCompressedSourceText(...)`: render compressed output text [`src/core/compress.ts`]
162
133
  - `formatOutputPath(...)`: normalize emitted file path [`src/core/compress-files.ts`]
163
- - `runFilesFind(...)`: branch `--files-find`; extract named constructs from explicit files [`src/core/tool-runner.ts`]
164
- - `findConstructsInFiles(...)`: select constructs by tag and regex [`src/core/find-constructs.ts`]
134
+ - `runFilesSearch(...)`: branch `--files-find`; extract named constructs from explicit files [`src/core/tool-runner.ts`]
135
+ - `searchConstructsInFiles(...)`: select constructs by tag and regex [`src/core/find-constructs.ts`]
165
136
  - `parseTagFilter(...)`: parse tag filter set [`src/core/find-constructs.ts`]
166
137
  - `detectLanguage(...)`: map extension to language key [`src/core/compress.ts`]
167
138
  - `languageSupportsTags(...)`: reject unsupported tag/language combinations [`src/core/find-constructs.ts`]
@@ -172,6 +143,7 @@
172
143
  - `SourceAnalyzer.enrich(...)`: derive signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen bindings [`src/core/source-analyzer.ts`]
173
144
  - `cleanNames(...)`: normalize matched symbol names [`src/core/source-analyzer.ts`]
174
145
  - `extractSignatures(...)`: derive single-line signatures [`src/core/source-analyzer.ts`]
146
+ - `normalizeSourceLineForExtraction(...)`: preserve leading tabs in source-derived signature lines [`src/core/source-analyzer.ts`]
175
147
  - `detectHierarchy(...)`: assign parent-child relationships [`src/core/source-analyzer.ts`]
176
148
  - `extractVisibility(...)`: annotate visibility [`src/core/source-analyzer.ts`]
177
149
  - `parseVisibility(...)`: language-specific visibility classifier [`src/core/source-analyzer.ts`]
@@ -217,12 +189,13 @@
217
189
  - `StaticCheckCommand.checkFile(...)`: run external executable against one file [`src/core/static-check.ts`]
218
190
  - `StaticCheckBase.headerLine(...)`: format checker header [`src/core/static-check.ts`]
219
191
  - `StaticCheckBase.emitLine(...)`: write checker output [`src/core/static-check.ts`]
220
- - `runFilesStaticCheck(...)`: branch `--files-static-check`; run configured checkers for explicit files [`src/core/tool-runner.ts`]
192
+ - `runFilesStaticCheck(...)`: branch `--files-static-check`; run enabled configured checkers for explicit files [`src/core/tool-runner.ts`]
221
193
  - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
222
194
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
223
195
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
224
196
  - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
225
197
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
198
+ - `getActiveStaticCheckEntries(...)`: derive the active checker list from per-language enable flags [`src/core/config.ts`]
226
199
  - `dispatchStaticCheckForFile(...)`: instantiate checker by configured module [`src/core/static-check.ts`]
227
200
  - `formatDispatchStaticCheckModules(...)`: render valid persisted modules for unknown-module failures [`src/core/static-check.ts`]
228
201
  - `StaticCheckBase.run(...)`: execute debug dummy checker [`src/core/static-check.ts`]
@@ -235,7 +208,7 @@
235
208
  - `StaticCheckCommand.checkFile(...)`: run external executable against one file [`src/core/static-check.ts`]
236
209
  - `StaticCheckBase.headerLine(...)`: format checker header [`src/core/static-check.ts`]
237
210
  - `StaticCheckBase.emitLine(...)`: write checker output [`src/core/static-check.ts`]
238
- - `runReferences(...)`: branch `--references`; emit structured project references JSON [`src/core/tool-runner.ts`]
211
+ - `runReferences(...)`: branch `--references`; emit monolithic project references markdown [`src/core/tool-runner.ts`]
239
212
  - `resolveProjectSrcDirs(...)`: load configured source directories [`src/core/tool-runner.ts`]
240
213
  - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
241
214
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
@@ -244,21 +217,14 @@
244
217
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
245
218
  - `collectSourceFiles(...)`: gather tracked and untracked source files under configured roots [`src/core/tool-runner.ts`]
246
219
  - `makeRelativeIfContainsProject(...)`: normalize configured root tokens [`src/core/utils.ts`]
247
- - `buildReferenceToolPayload(...)`: analyze configured source files into the agent-oriented references payload [`src/core/reference-payload.ts`]
248
- - `canonicalizeReferencePath(...)`: normalize request and file paths against the project base [`src/core/reference-payload.ts`]
249
- - `analyzeReferenceFile(...)`: analyze one processable file into structured imports, symbols, and comments [`src/core/reference-payload.ts`]
250
- - `detectLanguage(...)`: map extension to language key [`src/core/compress.ts`]
251
- - `SourceAnalyzer.analyze(...)`: parse source elements [`src/core/source-analyzer.ts`]
252
- - `SourceAnalyzer.enrich(...)`: derive signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen bindings [`src/core/source-analyzer.ts`]
253
- - `buildCommentMaps(...)`: associate comments with definitions and file descriptions [`src/core/reference-payload.ts`]
254
- - `collectFileLevelDoxygenFields(...)`: extract file-level Doxygen fields [`src/core/source-analyzer.ts`]
255
- - `collectElementDoxygenFields(...)`: merge direct and near-body Doxygen fields [`src/core/source-analyzer.ts`]
256
- - `structureDoxygenFields(...)`: normalize Doxygen fields into tag-specific JSON arrays and objects [`src/core/doxygen-parser.ts`]
257
- - `countDoxygenFieldValues(...)`: derive aggregate Doxygen counts [`src/core/doxygen-parser.ts`]
258
- - `resolveParentElement(...)`: link nested symbols to enclosing definitions [`src/core/reference-payload.ts`]
259
- - `buildCommentEntry(...)`: serialize normalized comment text and line ranges [`src/core/reference-payload.ts`]
260
- - `buildRepositoryTree(...)`: materialize the repository directory tree as structured JSON [`src/core/reference-payload.ts`]
261
- - `buildReferenceToolExecutionStderr(...)`: serialize skipped and analysis-error entries into stderr text [`src/core/reference-payload.ts`]
220
+ - `formatFilesStructureMarkdown(...)`: render the repository file-structure markdown block [`src/core/tool-runner.ts`]
221
+ - `buildAsciiTree(...)`: materialize the relative file tree as ASCII text [`src/core/tool-runner.ts`]
222
+ - `generateMarkdown(...)`: analyze configured source files and concatenate Python-compatible reference markdown sections [`src/core/generate-markdown.ts`]
223
+ - `detectLanguage(...)`: map extension to language key [`src/core/generate-markdown.ts`]
224
+ - `SourceAnalyzer.analyze(...)`: parse source elements [`src/core/source-analyzer.ts`]
225
+ - `SourceAnalyzer.enrich(...)`: derive signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen bindings [`src/core/source-analyzer.ts`]
226
+ - `formatMarkdown(...)`: render one file as the repository reference-markdown format [`src/core/source-analyzer.ts`]
227
+ - `normalizeSourceLineForExtraction(...)`: preserve leading tabs in source-derived markdown lines [`src/core/source-analyzer.ts`]
262
228
  - `runCompress(...)`: branch `--compress`; compress configured source files [`src/core/tool-runner.ts`]
263
229
  - `resolveProjectSrcDirs(...)`: load configured source directories [`src/core/tool-runner.ts`]
264
230
  - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
@@ -279,10 +245,11 @@
279
245
  - `countLogicalLines(...)`: count original source lines [`src/core/compress.ts`]
280
246
  - `isInString(...)`: suppress inline comment stripping inside strings [`src/core/compress.ts`]
281
247
  - `removeInlineComment(...)`: remove single-line comment suffixes [`src/core/compress.ts`]
248
+ - `normalizeRetainedLineIndentation(...)`: preserve full indentation or leading tabs before output normalization [`src/core/compress.ts`]
282
249
  - `buildCompressedLineEntry(...)`: normalize one retained line into structured output [`src/core/compress.ts`]
283
250
  - `formatCompressedSourceText(...)`: render compressed output text [`src/core/compress.ts`]
284
251
  - `formatOutputPath(...)`: normalize emitted file path [`src/core/compress-files.ts`]
285
- - `runFind(...)`: branch `--find`; extract project-wide named constructs [`src/core/tool-runner.ts`]
252
+ - `runSearch(...)`: branch `--find`; extract project-wide named constructs [`src/core/tool-runner.ts`]
286
253
  - `resolveProjectSrcDirs(...)`: load configured source directories [`src/core/tool-runner.ts`]
287
254
  - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
288
255
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
@@ -291,7 +258,7 @@
291
258
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
292
259
  - `collectSourceFiles(...)`: gather tracked and untracked source files under configured roots [`src/core/tool-runner.ts`]
293
260
  - `makeRelativeIfContainsProject(...)`: normalize configured root tokens [`src/core/utils.ts`]
294
- - `findConstructsInFiles(...)`: select constructs by tag and regex [`src/core/find-constructs.ts`]
261
+ - `searchConstructsInFiles(...)`: select constructs by tag and regex [`src/core/find-constructs.ts`]
295
262
  - `parseTagFilter(...)`: parse tag filter set [`src/core/find-constructs.ts`]
296
263
  - `detectLanguage(...)`: map extension to language key [`src/core/compress.ts`]
297
264
  - `languageSupportsTags(...)`: reject unsupported tag/language combinations [`src/core/find-constructs.ts`]
@@ -302,6 +269,7 @@
302
269
  - `SourceAnalyzer.enrich(...)`: derive signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen bindings [`src/core/source-analyzer.ts`]
303
270
  - `cleanNames(...)`: normalize matched symbol names [`src/core/source-analyzer.ts`]
304
271
  - `extractSignatures(...)`: derive single-line signatures [`src/core/source-analyzer.ts`]
272
+ - `normalizeSourceLineForExtraction(...)`: preserve leading tabs in source-derived signature lines [`src/core/source-analyzer.ts`]
305
273
  - `detectHierarchy(...)`: assign parent-child relationships [`src/core/source-analyzer.ts`]
306
274
  - `extractVisibility(...)`: annotate visibility [`src/core/source-analyzer.ts`]
307
275
  - `parseVisibility(...)`: language-specific visibility classifier [`src/core/source-analyzer.ts`]
@@ -379,68 +347,6 @@
379
347
  - `StaticCheckCommand.checkFile(...)`: run external executable against one file [`src/core/static-check.ts`]
380
348
  - `StaticCheckBase.headerLine(...)`: format checker header [`src/core/static-check.ts`]
381
349
  - `StaticCheckBase.emitLine(...)`: write checker output [`src/core/static-check.ts`]
382
- - `runGitCheck(...)`: branch `--git-check`; validate clean git state [`src/core/tool-runner.ts`]
383
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
384
- - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
385
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
386
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
387
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
388
- - `resolveEffectiveGitPath(...)`: derive the effective repository root constrained by `base-path` ancestry [`src/core/tool-runner.ts`]
389
- - `isSameOrAncestorPath(...)`: validate git-root ancestry against the base path [`src/core/path-context.ts`]
390
- - `isInsideGitRepo(...)`: probe git repository membership [`src/core/tool-runner.ts`]
391
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
392
- - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
393
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
394
- - `runCapture(...)`: verify worktree membership [`src/core/tool-runner.ts`]
395
- - `runCapture(...)`: inspect porcelain changes [`src/core/tool-runner.ts`]
396
- - `runCapture(...)`: resolve symbolic HEAD [`src/core/tool-runner.ts`]
397
- - `runCapture(...)`: resolve detached HEAD fallback [`src/core/tool-runner.ts`]
398
- - `runDocsCheck(...)`: branch `--docs-check`; validate canonical docs presence [`src/core/tool-runner.ts`]
399
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
400
- - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
401
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
402
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
403
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
404
- - `runGitWtName(...)`: branch `--git-wt-name`; generate standardized worktree name [`src/core/tool-runner.ts`]
405
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
406
- - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
407
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
408
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
409
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
410
- - `resolveEffectiveGitPath(...)`: derive the effective repository root constrained by `base-path` ancestry [`src/core/tool-runner.ts`]
411
- - `sanitizeBranchName(...)`: canonicalize current branch token [`src/core/tool-runner.ts`]
412
- - `runGitWtCreate(...)`: branch `--git-wt-create`; create worktree and copy config [`src/core/tool-runner.ts`]
413
- - `validateWtName(...)`: validate requested worktree name [`src/core/tool-runner.ts`]
414
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
415
- - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
416
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
417
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
418
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
419
- - `resolveEffectiveGitPath(...)`: derive the effective repository root constrained by `base-path` ancestry [`src/core/tool-runner.ts`]
420
- - `rollbackWorktreeCreate(...)`: remove partial worktree and branch on copy failure [`src/core/tool-runner.ts`]
421
- - `runGitWtDelete(...)`: branch `--git-wt-delete`; remove worktree and branch [`src/core/tool-runner.ts`]
422
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
423
- - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
424
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
425
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
426
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
427
- - `resolveEffectiveGitPath(...)`: derive the effective repository root constrained by `base-path` ancestry [`src/core/tool-runner.ts`]
428
- - `worktreePathExistsExact(...)`: verify exact registered worktree path [`src/core/tool-runner.ts`]
429
- - `runCapture(...)`: run git worktree list subprocess [`src/core/tool-runner.ts`]
430
- - `runGitPath(...)`: branch `--git-path`; print configured git root [`src/core/tool-runner.ts`]
431
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
432
- - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
433
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
434
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
435
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
436
- - `resolveEffectiveGitPath(...)`: derive the effective repository root constrained by `base-path` ancestry [`src/core/tool-runner.ts`]
437
- - `formatRuntimePathForDisplay(...)`: serialize the git path for CLI output [`src/core/path-context.ts`]
438
- - `runGetBasePath(...)`: branch `--get-base-path`; print configured base path [`src/core/tool-runner.ts`]
439
- - `resolveProjectBase(...)`: validate project base path [`src/core/tool-runner.ts`]
440
- - `formatRuntimePathForDisplay(...)`: serialize the base path for CLI output [`src/core/path-context.ts`]
441
- - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
442
- - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
443
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
444
350
  - `writeResult(...)`: emit selected runner result [`src/cli.ts`]
445
351
  - `writeStdout(...)`: write stdout payload [`src/cli.ts`]
446
352
  - `writeStderr(...)`: write stderr payload [`src/cli.ts`]
@@ -514,13 +420,14 @@
514
420
  - `registerPromptCommands(...)`: register bundled `req-*` prompt commands [`src/index.ts`]
515
421
  - `registerAgentTools(...)`: register structured agent tools [`src/index.ts`]
516
422
  - `registerConfigCommands(...)`: register configuration commands [`src/index.ts`]
517
- - `registerPiNotifyShortcut(...)`: register the configured successful-run sound shortcut when the runtime supports shortcuts [`src/index.ts`]
423
+ - `registerPiNotifyShortcut(...)`: register the configured sound-level shortcut when the runtime supports shortcuts [`src/index.ts`]
518
424
  - `loadProjectConfig(...)`: load the current project config for shortcut registration [`src/index.ts`]
519
425
  - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
520
426
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
521
427
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
522
428
  - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
523
429
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
430
+ - `normalizeGitWorktreePrefix(...)`: canonicalize persisted worktree prefix [`src/core/config.ts`]
524
431
  - `normalizePiNotifySoundLevel(...)`: normalize persisted sound level [`src/core/pi-notify.ts`]
525
432
  - `normalizePiNotifyShortcut(...)`: normalize persisted shortcut [`src/core/pi-notify.ts`]
526
433
  - `normalizePiNotifyCommand(...)`: normalize persisted sound commands [`src/core/pi-notify.ts`]
@@ -552,42 +459,55 @@
552
459
  - `RecordingExtensionAPI.getBuiltinTools(...)`: synthesize supported builtin tool descriptors [`scripts/lib/recording-extension-api.ts`]
553
460
  - `buildBuiltinToolDefinition(...)`: build one builtin tool descriptor [`scripts/lib/recording-extension-api.ts`]
554
461
  - `buildBuiltinSourceInfo(...)`: synthesize builtin provenance metadata [`scripts/lib/recording-extension-api.ts`]
555
- - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory [`src/index.ts`]
462
+ - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory in documented menu order [`src/index.ts`]
556
463
  - `RecordingExtensionAPI.getActiveTools(...)`: expose current active-tool set [`scripts/lib/recording-extension-api.ts`]
557
464
  - `RecordingExtensionAPI.setActiveTools(...)`: replace active-tool set with runtime-visible names [`scripts/lib/recording-extension-api.ts`]
558
465
  - `RecordingExtensionAPI.getAllTools(...)`: expose supported builtin plus extension tool inventory [`scripts/lib/recording-extension-api.ts`]
559
466
  - `setPiUsereqStatusConfig(...)`: cache docs/tests/src and pi-notify values for later status renders [`src/core/extension-status.ts`]
560
- - `updateExtensionStatus(...)`: refresh stored context usage, elapsed timers, cumulative runtime, and rendered status text [`src/core/extension-status.ts`]
467
+ - `updateExtensionStatus(...)`: refresh stored context usage, reset or restore elapsed timers, reset workflow state for startup/new/reload, and render status text [`src/core/extension-status.ts`]
561
468
  - `refreshContextUsage(...)`: sync the latest context-usage snapshot [`src/core/extension-status.ts`]
562
469
  - `RecordingCommandContext.getContextUsage(...)`: return the offline context-usage placeholder [`scripts/lib/recording-extension-api.ts`]
470
+ - `shouldResetElapsedStateOnSessionStart(...)`: detect `startup|reload` elapsed-reset boundaries [`src/core/extension-status.ts`]
471
+ - `resetElapsedState(...)`: clear in-memory and persisted completed timers [`src/core/extension-status.ts`]
472
+ - `restorePersistedElapsedState(...)`: restore persisted completed timers for `new|resume|fork` [`src/core/extension-status.ts`]
473
+ - `shouldResetWorkflowStateOnSessionStart(...)`: detect `startup|new|reload` workflow-reset boundaries [`src/core/extension-status.ts`]
474
+ - `persistElapsedState(...)`: mirror completed timers into process-scoped persistence [`src/core/extension-status.ts`]
563
475
  - `syncPiUsereqStatusTicker(...)`: start or stop the live elapsed ticker [`src/core/extension-status.ts`]
564
- - `renderPiUsereqStatus(...)`: render the base/context/elapsed/beep/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
476
+ - `renderPiUsereqStatus(...)`: render the status/current-path/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
565
477
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
566
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with consolidated elapsed semantics [`src/core/extension-status.ts`]
478
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, current-path, elapsed semantics, and sound status fields [`src/core/extension-status.ts`]
567
479
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
568
480
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
569
- - `formatContextUsageBar(...)`: render the 10-cell context bar or threshold-specific overlay [`src/core/extension-status.ts`]
570
- - `resolveContextUsageOverlay(...)`: choose `◀ CLEAR ▶ ` or ` ◀ FULL ▶ ` overlay states with CLI-supported theme tokens [`src/core/extension-status.ts`]
571
- - `formatContextUsageOverlay(...)`: paint the fixed-width overlay with preserved bar background [`src/core/extension-status.ts`]
481
+ - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
482
+ - `formatContextUsageBar(...)`: render the icon-based context gauge [`src/core/extension-status.ts`]
483
+ - `resolveContextUsageIconText(...)`: map normalized context usage to the fixed-width gauge icon [`src/core/extension-status.ts`]
572
484
  - `formatElapsedStatusValue(...)`: compose `⏱︎`, `⚑`, and `⌛︎` timer segments [`src/core/extension-status.ts`]
573
485
  - `formatCompletedStatusDuration(...)`: render completed timers or the unset placeholder [`src/core/extension-status.ts`]
574
486
  - `formatStatusDuration(...)`: render `M:SS` durations [`src/core/extension-status.ts`]
575
- - `formatPiNotifyBeepStatus(...)`: serialize enabled beep flags for the footer [`src/core/pi-notify.ts`]
576
- - `runPiNotifyEffects(...)`: dispatch configured terminal beeps and successful-run sound hooks on `agent_end` [`src/core/pi-notify.ts`]
577
- - `classifyPiNotifyOutcome(...)`: map assistant stop reasons to `end`, `esc`, or `err` [`src/core/pi-notify.ts`]
487
+ - `runPiNotifyEffects(...)`: dispatch configured command-notify, sound, and optional Pushover hooks on `agent_end` [`src/core/pi-notify.ts`]
488
+ - `classifyPiNotifyOutcome(...)`: map assistant stop reasons to `completed`, `interrupted`, or `failed` [`src/core/pi-notify.ts`]
578
489
  - `hasAgentEndStopReason(...)`: scan assistant stop reasons inside the `agent_end` payload [`src/core/pi-notify.ts`]
579
- - `buildPiNotifyTitle(...)`: build the stable pi-notify title [`src/core/pi-notify.ts`]
580
- - `buildPiNotifyBody(...)`: build the stable pi-notify body from the classified outcome [`src/core/pi-notify.ts`]
581
- - `notifyPiTerminal(...)`: route terminal notifications by runtime environment when the matching beep flag is enabled [`src/core/pi-notify.ts`]
582
- - `notifyWindows(...)`: emit Windows toast notifications [`src/core/pi-notify.ts`]
583
- - `notifyOSC99(...)`: emit Kitty OSC 99 notifications [`src/core/pi-notify.ts`]
584
- - `notifyOSC9(...)`: emit OSC 9 notifications [`src/core/pi-notify.ts`]
585
- - `notifyOSC777(...)`: emit OSC 777 notifications [`src/core/pi-notify.ts`]
586
- - `runPiNotifySoundCommand(...)`: execute the configured successful-run sound command when sound is enabled [`src/core/pi-notify.ts`]
490
+ - `shouldRunPiNotifyCommand(...)`: validate prompt-scoped command-notify prerequisites [`src/core/pi-notify.ts`]
491
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
492
+ - `runPiNotifyCommand(...)`: execute `PI_NOTIFY_CMD` with runtime placeholder substitution [`src/core/pi-notify.ts`]
493
+ - `substitutePiNotifyShellTemplate(...)`: replace installation, prompt, base, time, args, and result placeholders inside the shell template [`src/core/pi-notify.ts`]
494
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
495
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
496
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
497
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
498
+ - `substitutePiNotifyInstallPath(...)`: replace `%%INSTALLATION_PATH%%` before shell execution [`src/core/pi-notify.ts`]
499
+ - `quotePiNotifyInstallPath(...)`: quote the installation path for shell reuse [`src/core/pi-notify.ts`]
500
+ - `escapePiNotifyShellTemplateValue(...)`: escape prompt-scoped values for double-quoted shell insertion [`src/core/pi-notify.ts`]
501
+ - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
502
+ - `runPiNotifyShellCommand(...)`: spawn one detached shell command [`src/core/pi-notify.ts`]
503
+ - `shouldRunPiNotifySound(...)`: validate sound level plus the matching event toggle [`src/core/pi-notify.ts`]
504
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
505
+ - `runPiNotifySoundCommand(...)`: execute the configured sound command when the sound level and matching event toggle permit delivery [`src/core/pi-notify.ts`]
587
506
  - `resolvePiNotifySoundCommand(...)`: select the configured command for `low`, `mid`, or `high` [`src/core/pi-notify.ts`]
588
507
  - `substitutePiNotifyInstallPath(...)`: replace `%%INSTALLATION_PATH%%` before shell execution [`src/core/pi-notify.ts`]
589
508
  - `quotePiNotifyInstallPath(...)`: quote the installation path for shell reuse [`src/core/pi-notify.ts`]
590
- - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
509
+ - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
510
+ - `runPiNotifyShellCommand(...)`: spawn one detached shell command [`src/core/pi-notify.ts`]
591
511
  - `replayCommand(...)`: replay a recorded command handler and capture prompt/UI side effects [`scripts/lib/extension-debug-harness.ts`]
592
512
  - `registerExtensionOffline(...)`: rebuild the recorded extension registration surface [`scripts/lib/extension-debug-harness.ts`]
593
513
  - `RecordingCommandContext(...)`: initialize the recorded command-context UI adapter and deterministic theme-color encoding [`scripts/lib/recording-extension-api.ts`]
@@ -595,34 +515,40 @@
595
515
  - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources when invoking `req-*` handlers [`src/core/resources.ts`]
596
516
  - `getProjectBase(...)`: resolve command project base [`src/index.ts`]
597
517
  - `loadProjectConfig(...)`: load command runtime config [`src/index.ts`]
598
- - `renderPrompt(...)`: render prompt-command payloads with conditional pi.dev API-contract guidance [`src/core/prompts.ts`]
518
+ - `renderPrompt(...)`: render prompt-command payloads with bundled commit-instruction expansion plus conditional pi.dev governance guidance [`src/core/prompts.ts`]
599
519
  - `deliverPromptCommand(...)`: dispatch prompt replay into the current recorded session [`src/index.ts`]
600
520
  - External boundaries: `RecordingExtensionAPI.sendUserMessage(...)` records the delivered prompt payload.
601
521
  - `configurePiUsereq(...)`: execute the interactive configuration menu [`src/index.ts`]
602
- - `buildPiUsereqMenuChoices(...)`: serialize top-level settings actions plus the display-only config-path row [`src/index.ts`]
603
- - `formatProjectConfigPathForMenu(...)`: format the current config path relative to the user home when possible [`src/index.ts`]
522
+ - `buildPiUsereqMenuChoices(...)`: serialize top-level settings actions including effective worktree locking and the display-only config-path row [`src/index.ts`]
523
+ - `formatProjectConfigPathForMenu(...)`: format the current config path with the shared `~`-relative path formatter for menu display [`src/index.ts`]
604
524
  - `showPiUsereqSettingsMenu(...)`: render the shared settings-menu UI for top-level and submenu actions [`src/core/settings-menu.ts`]
605
525
  - `formatPiUsereqSettingsMenuTitle(...)`: rebuild the menu title with active-theme semantics [`src/core/settings-menu.ts`]
606
526
  - `buildPiUsereqSettingsListTheme(...)`: prefer shared CLI settings-list theming and fall back during offline replay [`src/core/settings-menu.ts`]
607
527
  - `buildFallbackPiUsereqSettingsListTheme(...)`: mirror CLI settings-list token roles from the callback-local theme [`src/core/settings-menu.ts`]
608
- - `buildSettingItems(...)`: map menu choices into settings-list rows and apply optional dim value tones [`src/core/settings-menu.ts`]
528
+ - `buildSettingItems(...)`: map menu choices into settings-list rows, apply optional dim tones, and disable non-selectable actions [`src/core/settings-menu.ts`]
609
529
  - `saveProjectConfig(...)`: persist menu updates on save-and-close [`src/index.ts`]
610
530
  - `setPiUsereqStatusConfig(...)`: cache the saved config for footer rendering [`src/core/extension-status.ts`]
611
- - `renderPiUsereqStatus(...)`: render the base/context/elapsed/beep/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
531
+ - `renderPiUsereqStatus(...)`: render the current-path/context/elapsed/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
612
532
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
613
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with consolidated elapsed semantics [`src/core/extension-status.ts`]
533
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with current-path, consolidated elapsed semantics, and sound status fields [`src/core/extension-status.ts`]
614
534
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
615
535
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
616
- - `formatContextUsageBar(...)`: render the 10-cell context bar or threshold-specific overlay [`src/core/extension-status.ts`]
536
+ - `formatContextUsageBar(...)`: render the icon-based context gauge [`src/core/extension-status.ts`]
617
537
  - `formatElapsedStatusValue(...)`: compose `⏱︎`, `⚑`, and `⌛︎` timer segments [`src/core/extension-status.ts`]
618
538
  - `formatCompletedStatusDuration(...)`: render completed timers or the unset placeholder [`src/core/extension-status.ts`]
619
539
  - `formatStatusDuration(...)`: render `M:SS` durations [`src/core/extension-status.ts`]
620
- - `formatPiNotifyBeepStatus(...)`: serialize enabled beep flags for the footer [`src/core/pi-notify.ts`]
621
- - `configureStaticCheckMenu(...)`: interactive static-check editor [`src/index.ts`]
622
- - `configurePiUsereqToolsMenu(...)`: interactive active-tool editor [`src/index.ts`]
623
- - `configurePiNotifyMenu(...)`: interactive pi-notify editor [`src/index.ts`]
624
- - `buildPiNotifyMenuChoices(...)`: serialize notification actions for the shared settings menu [`src/index.ts`]
625
- - `togglePiNotifyBeepFlag(...)`: toggle one prompt-end beep flag [`src/index.ts`]
540
+ - `configureStaticCheckMenu(...)`: interactive guided static-check editor with per-language enable toggles [`src/index.ts`]
541
+ - `configurePiUsereqToolsMenu(...)`: interactive active-tool editor without a status-reference action [`src/index.ts`]
542
+ - `configurePiNotifyMenu(...)`: interactive notify, sound, and Pushover editor with dedicated event submenus [`src/index.ts`]
543
+ - `buildPiNotifyMenuChoices(...)`: serialize command-notify, sound, and Pushover blocks plus shared-event submenu launchers [`src/index.ts`]
544
+ - `buildPiNotifyEventLauncherChoice(...)`: serialize one event-submenu launcher row with a compact enabled-toggle summary [`src/index.ts`]
545
+ - `buildPiNotifyPushoverRows(...)`: serialize direct Pushover rows plus the shared event-submenu launcher [`src/index.ts`]
546
+ - `configurePiNotifyEventMenu(...)`: interactive completed/interrupted/failed event editor for one notification transport [`src/index.ts`]
547
+ - `buildPiNotifyEventMenuChoices(...)`: serialize shared event rows plus submenu reset/save actions [`src/index.ts`]
548
+ - `resetPiNotifyEventMenuToDefaults(...)`: restore default event toggles for one notification transport [`src/index.ts`]
549
+ - `resolvePiNotifyEventLabel(...)`: map one event-toggle key to the human-readable menu label [`src/index.ts`]
550
+ - `togglePiNotifyFlag(...)`: toggle one persisted boolean notification setting [`src/index.ts`]
551
+ - `togglePiNotifyFlag(...)`: toggle one persisted boolean notification setting [`src/index.ts`]
626
552
  - `replayTool(...)`: replay a recorded tool execute handler and capture content/details [`scripts/lib/extension-debug-harness.ts`]
627
553
  - `registerExtensionOffline(...)`: rebuild the recorded extension registration surface [`scripts/lib/extension-debug-harness.ts`]
628
554
  - `RecordingCommandContext(...)`: initialize the recorded command-context UI adapter and deterministic theme-color encoding [`scripts/lib/recording-extension-api.ts`]
@@ -630,62 +556,27 @@
630
556
  - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources for tool executes that need them [`src/core/resources.ts`]
631
557
  - `getProjectBase(...)`: resolve tool project base [`src/index.ts`]
632
558
  - `loadProjectConfig(...)`: load tool runtime config [`src/index.ts`]
633
- - `buildTokenToolPayload(...)`: construct agent-oriented token JSON with separated source facts, metrics, and guidance [`src/core/token-counter.ts`]
634
- - `probeRequestedPath(...)`: classify requested paths as readable files, missing inputs, or non-file inputs [`src/core/token-counter.ts`]
635
- - `countFilesMetrics(...)`: read readable files and extract token, character, byte, line, heading, and optional Doxygen facts [`src/core/token-counter.ts`]
636
- - `buildCountFileMetricsResult(...)`: assemble direct-access per-file metrics and metadata [`src/core/token-counter.ts`]
637
- - `TokenCounter.countTokens(...)`: encode content and count tokens [`src/core/token-counter.ts`]
638
- - `TokenCounter.countChars(...)`: count characters [`src/core/token-counter.ts`]
639
- - `countLines(...)`: count logical lines [`src/core/token-counter.ts`]
640
- - `inferLanguageName(...)`: infer agent-oriented language labels [`src/core/token-counter.ts`]
641
- - `extractPrimaryHeadingText(...)`: extract the first markdown heading when present [`src/core/token-counter.ts`]
642
- - `extractLeadingDoxygenFields(...)`: extract file-level Doxygen fields when present [`src/core/token-counter.ts`]
643
- - `parseDoxygenComment(...)`: parse normalized Doxygen fields [`src/core/doxygen-parser.ts`]
644
- - `buildTokenToolExecuteResult(...)`: wrap token payloads into tool content and structured details [`src/index.ts`]
645
- - `buildTokenToolExecutionStderr(...)`: serialize skipped and error observations into stderr text [`src/index.ts`]
646
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
647
- - `buildReferenceToolPayload(...)`: construct token-optimized references JSON with repository structure, symbols, and Doxygen fields [`src/core/reference-payload.ts`]
648
- - `canonicalizeReferencePath(...)`: normalize request and file paths against the project base [`src/core/reference-payload.ts`]
649
- - `analyzeReferenceFile(...)`: analyze one processable file into structured imports, symbols, and comments [`src/core/reference-payload.ts`]
650
- - `buildRepositoryTree(...)`: materialize the repository directory tree as structured JSON [`src/core/reference-payload.ts`]
651
- - `buildReferenceToolExecuteResult(...)`: wrap references payloads into tool content and structured details [`src/index.ts`]
652
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
653
- - `buildCompressToolPayload(...)`: construct token-optimized compression JSON with structured line facts, symbols, and Doxygen fields [`src/core/compress-payload.ts`]
654
- - `analyzeCompressFile(...)`: compress one requested file and attach symbol metadata when available [`src/core/compress-payload.ts`]
655
- - `compressFileDetailed(...)`: compress one file into structured lines and rendered text [`src/core/compress.ts`]
656
- - `analyzeCompressedFileSymbols(...)`: extract symbol and Doxygen records for compressed files [`src/core/compress-payload.ts`]
657
- - `buildCompressionToolExecuteResult(...)`: wrap compression payloads into tool content and structured details [`src/index.ts`]
658
- - `buildCompressToolExecutionStderr(...)`: serialize skipped, error, and symbol-analysis warning entries [`src/core/compress-payload.ts`]
659
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
660
- - `buildFindToolSchemaDescription(...)`: synthesize find parameter-schema descriptions [`src/index.ts`]
661
- - `buildFindToolPromptGuidelines(...)`: synthesize agent-oriented find guidance strings [`src/index.ts`]
662
- - `buildFindToolSupportedTagGuidelines(...)`: emit per-language supported-tag guidance lines [`src/index.ts`]
663
- - `buildFindToolPayload(...)`: construct token-optimized construct-search JSON with structured file statuses, matches, line facts, and Doxygen fields [`src/core/find-payload.ts`]
664
- - `validateTagFilter(...)`: normalize requested construct tags [`src/core/find-payload.ts`]
665
- - `validateRegexPattern(...)`: compile the construct-name regex [`src/core/find-payload.ts`]
666
- - `analyzeFindFile(...)`: analyze one requested file into structured search status and match records [`src/core/find-payload.ts`]
667
- - `buildMatchEntry(...)`: structure one matched construct with typed lines and Doxygen fields [`src/core/find-payload.ts`]
668
- - `buildStrippedConstructLineEntries(...)`: strip comments into structured code lines [`src/core/find-constructs.ts`]
669
- - `buildFindToolExecuteResult(...)`: wrap construct-search payloads into tool content and structured details [`src/index.ts`]
670
- - `buildFindToolExecutionStderr(...)`: serialize invalid-request, skipped, no-match, and analysis-error diagnostics [`src/core/find-payload.ts`]
671
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
672
- - `runGitPath(...)`: query the resolved git-path value [`src/core/tool-runner.ts`]
673
- - `runGetBasePath(...)`: query the resolved base-path value [`src/core/tool-runner.ts`]
674
- - `buildPathQueryToolPayload(...)`: structure token-optimized path-query payloads for `git-path` and `get-base-path` [`src/core/agent-tool-json.ts`]
675
- - `runFilesStaticCheck(...)`: execute configured checkers for explicit-file requests [`src/core/tool-runner.ts`]
676
- - `collectProjectStaticCheckSelection(...)`: derive project static-check file selections and fixture exclusions [`src/index.ts`]
677
- - `runProjectStaticCheck(...)`: execute configured checkers for project source and test selections [`src/core/tool-runner.ts`]
678
- - `buildStaticCheckToolPayload(...)`: structure token-optimized static-check summary, file-selection, and execution facts [`src/core/agent-tool-json.ts`]
679
- - `runGitCheck(...)`: validate runtime repository cleanliness [`src/core/tool-runner.ts`]
680
- - `buildGitCheckToolPayload(...)`: structure token-optimized git-validation status and execution facts [`src/core/agent-tool-json.ts`]
681
- - `buildDocsCheckToolPayload(...)`: structure token-optimized canonical-doc presence and remediation facts [`src/core/agent-tool-json.ts`]
682
- - `runGitWtName(...)`: generate the standardized worktree name [`src/core/tool-runner.ts`]
683
- - `buildWorktreeNameToolPayload(...)`: structure token-optimized worktree-name generation facts [`src/core/agent-tool-json.ts`]
684
- - `runGitWtCreate(...)`: create a dedicated worktree and branch [`src/core/tool-runner.ts`]
685
- - `runGitWtDelete(...)`: delete a dedicated worktree and branch [`src/core/tool-runner.ts`]
686
- - `buildWorktreeMutationToolPayload(...)`: structure token-optimized worktree create-delete facts [`src/core/agent-tool-json.ts`]
687
- - `buildToolExecutionSection(...)`: normalize residual stdout, stderr, and exit-code metadata [`src/core/agent-tool-json.ts`]
688
- - `normalizeToolFailure(...)`: convert `ReqError` failures into structured execution records [`src/core/agent-tool-json.ts`]
559
+ - `executeMonolithicTool(...)`: execute one CLI-style runner and wrap one monolithic content block plus minimal execution details [`src/index.ts`]
560
+ - `runFilesTokens(...)`: execute the monolithic token pack-summary runner [`src/core/tool-runner.ts`]
561
+ - `countFilesMetrics(...)`: read readable files and extract token, character, byte, line, heading, and optional Doxygen facts [`src/core/token-counter.ts`]
562
+ - `TokenCounter(...)`: lazily resolve `js-tiktoken` only when token counting executes [`src/core/token-counter.ts`]
563
+ - `loadJsTiktokenModule(...)`: convert missing tokenizer dependencies into deterministic `ReqError` failures [`src/core/token-counter.ts`]
564
+ - `buildCountFileMetricsResult(...)`: assemble direct-access per-file metrics and metadata [`src/core/token-counter.ts`]
565
+ - `runFilesReferences(...)`: execute the monolithic explicit-file references markdown runner [`src/core/tool-runner.ts`]
566
+ - `generateMarkdown(...)`: analyze requested files and concatenate Python-compatible reference markdown sections [`src/core/generate-markdown.ts`]
567
+ - `runFilesCompress(...)`: execute the monolithic explicit-file compression markdown runner [`src/core/tool-runner.ts`]
568
+ - `compressFiles(...)`: compress each file into markdown blocks [`src/core/compress-files.ts`]
569
+ - `runFilesSearch(...)`: execute the monolithic explicit-file construct-search markdown runner [`src/core/tool-runner.ts`]
570
+ - `searchConstructsInFiles(...)`: select constructs by tag and regex [`src/core/find-constructs.ts`]
571
+ - `runReferences(...)`: execute the monolithic project references markdown runner [`src/core/tool-runner.ts`]
572
+ - `runCompress(...)`: execute the monolithic project compression markdown runner [`src/core/tool-runner.ts`]
573
+ - `runSearch(...)`: execute the monolithic project construct-search markdown runner [`src/core/tool-runner.ts`]
574
+ - `runTokens(...)`: execute the monolithic canonical-doc token runner [`src/core/tool-runner.ts`]
575
+ - `runFilesStaticCheck(...)`: execute configured checkers for explicit-file requests [`src/core/tool-runner.ts`]
576
+ - `runProjectStaticCheck(...)`: execute configured checkers for project source and test selections [`src/core/tool-runner.ts`]
577
+ - `buildMonolithicToolExecuteResult(...)`: wrap runner stdout or stderr into tool content plus execution details [`src/core/agent-tool-json.ts`]
578
+ - `buildToolExecutionSection(...)`: normalize residual stdout, stderr, and exit-code metadata [`src/core/agent-tool-json.ts`]
579
+ - `normalizeToolFailure(...)`: convert runner failures into deterministic execution records [`src/core/agent-tool-json.ts`]
689
580
  - `runSdkSmoke(...)`: replay offline `session_start`, probe the official SDK runtime, and compare inventories [`scripts/lib/sdk-smoke.ts`]
690
581
  - `replaySessionStart(...)`: capture the offline `session_start` contract [`scripts/lib/extension-debug-harness.ts`]
691
582
  - `probeSdkRuntime(...)`: load the official SDK runtime and extract extension-owned inventory [`scripts/lib/sdk-smoke.ts`]
@@ -730,41 +621,106 @@
730
621
  - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources [`src/core/resources.ts`]
731
622
  - `getBundledResourceRoot(...)`: resolve installation-owned resource root [`src/core/resources.ts`]
732
623
  - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
733
- - `registerPromptCommands(...)`: register one command per prompt name and cache prompt metadata for later successful-completion notifications [`src/index.ts`]
624
+ - `registerPromptCommands(...)`: register one command per prompt name using runtime prompt-front-matter descriptions, recover a live bootstrap cwd when stale command contexts still point at deleted worktrees, gate orchestration on `idle`, transition workflow state through `checking|running|error`, prepare a forked execution session with the active session directory, persist prompt metadata for switch-triggered rebinding, switch the active pi CLI session to the verified execution cwd before prompt handoff, append dedicated workflow-activation debug entries, capture the replacement-session context, dispatch the rendered prompt into the forked active session through that context, record `running` immediately after delivery handoff starts, and only then await the wrapped prompt-delivery promise whose stale post-restore rejections are suppressed [`src/index.ts`]
625
+ - `resolveLiveBootstrapCwd(...)`: recover a live bootstrap cwd from the command context, runtime path state, or process cwd when stale worktree paths no longer exist [`src/index.ts`]
626
+ - `syncContextCwdMirror(...)`: best-effort realign the command-context `cwd` mirror to the recovered live cwd before prompt preflight [`src/index.ts`]
627
+ - `transitionPromptWorkflowState(...)`: update workflow state and append gated `workflow_state` debug entries only after the transition completes [`src/index.ts`]
628
+ - `setPiUsereqWorkflowState(...)`: update workflow state before prompt preflight, prompt handoff, or command-side failure [`src/core/extension-status.ts`]
629
+ - `logPromptWorkflowStateChange(...)`: append selected prompt workflow-transition debug entries [`src/index.ts`]
630
+ - `renderPiUsereqStatus(...)`: render the status/current-path/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
631
+ - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
632
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, current-path, elapsed semantics, and sound status fields [`src/core/extension-status.ts`]
633
+ - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
634
+ - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
635
+ - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
636
+ - `formatContextUsageBar(...)`: render the icon-based context gauge [`src/core/extension-status.ts`]
637
+ - `resolveContextUsageIconText(...)`: map normalized context usage to the fixed-width gauge icon [`src/core/extension-status.ts`]
638
+ - `formatElapsedStatusValue(...)`: compose `⏱︎`, `⚑`, and `⌛︎` timer segments [`src/core/extension-status.ts`]
639
+ - `formatCompletedStatusDuration(...)`: render completed timers or the unset placeholder [`src/core/extension-status.ts`]
640
+ - `formatStatusDuration(...)`: render `M:SS` durations [`src/core/extension-status.ts`]
734
641
  - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources before prompt render [`src/core/resources.ts`]
735
642
  - `getBundledResourceRoot(...)`: resolve installation-owned resource root [`src/core/resources.ts`]
736
643
  - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
737
- - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
738
- - `loadProjectConfig(...)`: load config and normalize persisted directory paths for command context [`src/index.ts`]
739
- - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
644
+ - `getProjectBase(...)`: resolve project base from the recovered command-context cwd [`src/index.ts`]
645
+ - `loadProjectConfig(...)`: load config and normalize persisted directory paths for the recovered command-context cwd [`src/index.ts`]
646
+ - `getProjectBase(...)`: resolve project base from the recovered command-context cwd [`src/index.ts`]
740
647
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
741
648
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
742
649
  - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
743
650
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
744
- - `isInsideGitRepo(...)`: probe git repository membership [`src/core/tool-runner.ts`]
745
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
746
- - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
747
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
748
- - `renderPrompt(...)`: render prompt template with project substitutions and conditional pi.dev API-contract guidance [`src/core/prompts.ts`]
651
+ - `preparePromptCommandExecution(...)`: run prompt preflight, reject stale or off-project origin session files whose persisted header cwd no longer belongs to the active project base, create and verify a dedicated worktree when enabled, reuse the active session directory only when the origin session remains reusable, generate a process-unique timestamp execution identifier for each new worktree name, and plan the execution plus git-state metadata [`src/core/prompt-command-runtime.ts`]
652
+ - `validatePromptGitState(...)`: validate clean runtime repository state through slash-command-owned git checks while ignoring extension-owned debug-log artifacts [`src/core/prompt-command-runtime.ts`]
653
+ - `throwPromptGitStatusError(...)`: normalize prompt-command git-preflight failures [`src/core/prompt-command-runtime.ts`]
654
+ - `isUsablePromptSessionFile(...)`: accept only origin session files whose persisted header cwd still exists inside the active project base [`src/core/prompt-command-runtime.ts`]
655
+ - `resolvePromptSessionFile(...)`: reuse the current origin session only when reusable, otherwise allocate a fresh persisted session path rooted at the active project base [`src/core/prompt-command-runtime.ts`]
656
+ - `validatePromptRequiredDocs(...)`: verify the prompt-specific canonical-doc matrix and append selected required-doc debug entries [`src/core/prompt-command-runtime.ts`]
657
+ - `resolvePromptDocsRoot(...)`: resolve the configured docs root [`src/core/prompt-command-runtime.ts`]
658
+ - `getPromptRequiredDocs(...)`: map the prompt name to canonical-doc probes [`src/core/prompt-command-runtime.ts`]
659
+ - `logDebugPromptEvent(...)`: append selected prompt debug entries for required-doc checks [`src/core/debug-runtime.ts`]
660
+ - `buildPromptWorktreeName(...)`: generate the configured-prefix worktree name when worktrees are enabled [`src/core/prompt-command-runtime.ts`]
661
+ - `resolveCurrentPromptBranchName(...)`: read the current branch token for worktree naming and runtime state [`src/core/prompt-command-runtime.ts`]
662
+ - `sanitizePromptWorktreeBranchName(...)`: rewrite the current branch into a filesystem-safe token [`src/core/prompt-command-runtime.ts`]
663
+ - `getNextPromptWorktreeExecutionId(...)`: derive a process-unique `YYYYMMDDHHMMSS` execution identifier so back-to-back prompt starts never reuse a same-second worktree name [`src/core/prompt-command-runtime.ts`]
664
+ - `formatPromptWorktreeExecutionId(...)`: serialize one worktree execution timestamp as `YYYYMMDDHHMMSS` [`src/core/prompt-command-runtime.ts`]
665
+ - `validatePromptWorktreeName(...)`: reject invalid generated worktree names [`src/core/prompt-command-runtime.ts`]
666
+ - `createPromptWorktree(...)`: create and verify the dedicated worktree and branch when worktrees are enabled and append selected worktree-create debug entries [`src/core/prompt-command-runtime.ts`]
667
+ - `resolveWorktreePaths(...)`: derive `parent-path`, `base-dir`, worktree root, and `worktree-path` from the original project base and git root [`src/core/prompt-command-runtime.ts`]
668
+ - `promptWorktreeRegistered(...)`: verify exact worktree registration through `git worktree list --porcelain` [`src/core/prompt-command-runtime.ts`]
669
+ - `promptWorktreeBranchExists(...)`: verify exact branch presence through `git branch --list --format=%(refname:short)` [`src/core/prompt-command-runtime.ts`]
670
+ - `logDebugPromptEvent(...)`: append selected prompt debug entries for worktree creation [`src/core/debug-runtime.ts`]
671
+ - `cleanupPromptWorktreeCreation(...)`: rollback partial prompt-command worktree resources on verification or finalization failure [`src/core/prompt-command-runtime.ts`]
672
+ - `promptWorktreeRegistered(...)`: test whether the sibling worktree remains registered [`src/core/prompt-command-runtime.ts`]
673
+ - `createPromptExecutionSessionFile(...)`: fork the current persisted session into the worktree cwd when the origin session file already exists, or materialize an execution-session snapshot with header cwd=`worktree-path` plus the current in-memory branch when the origin session is not flushed yet [`src/core/prompt-command-runtime.ts`]
674
+ - `renderPrompt(...)`: render prompt template with project substitutions, bundled commit-instruction expansion, extension-owned runtime guidance, and conditional pi.dev governance guidance [`src/core/prompts.ts`]
749
675
  - `readBundledPrompt(...)`: read bundled prompt template [`src/core/resources.ts`]
750
676
  - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources [`src/core/resources.ts`]
751
677
  - `getBundledResourceRoot(...)`: resolve installation-owned resource root [`src/core/resources.ts`]
752
678
  - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
753
- - `buildPromptReplacementPaths(...)`: build replacement token map including installation-owned template and guideline paths [`src/core/config.ts`]
754
- - `buildRuntimePathContext(...)`: derive installation, execution, base, config, docs, tests, source, and git paths [`src/core/path-context.ts`]
755
- - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
756
- - `getConfigPath(...)`: derive the `.pi-usereq/config.json` path [`src/core/path-context.ts`]
757
- - `buildRuntimePathFacts(...)`: convert runtime paths into prompt-visible path strings [`src/core/path-context.ts`]
758
- - `formatRuntimePathForDisplay(...)`: serialize user-home-relative paths with environment variables [`src/core/path-context.ts`]
759
- - `formatRuntimePathForDisplay(...)`: serialize guideline file paths for prompt substitution [`src/core/path-context.ts`]
760
- - `applyReplacements(...)`: substitute token values [`src/core/prompts.ts`]
761
- - `injectPiDevConformanceBlock(...)`: add conditional pi.dev manifest review and API-contract guidance for prompt workflows [`src/core/prompts.ts`]
762
- - `buildPiDevConformanceBlock(...)`: resolve manifest-gated pi.dev review and API-compliance rules [`src/core/prompts.ts`]
679
+ - `buildPromptReplacements(...)`: merge shared path substitutions with `%%ARGS%%` and `%%PROMPT%%` [`src/core/prompts.ts`]
680
+ - `buildPromptReplacementPaths(...)`: build replacement token map including installation-owned template and guideline paths [`src/core/config.ts`]
681
+ - `buildRuntimePathContext(...)`: derive `install-path`, `base-path`, `context-path`, `config-path`, docs/tests/source absolute paths, and optional git/worktree facts [`src/core/path-context.ts`]
682
+ - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
683
+ - `getConfigPath(...)`: derive the `.pi-usereq.json` path [`src/core/path-context.ts`]
684
+ - `buildRuntimePathFacts(...)`: convert runtime paths into prompt-visible path strings [`src/core/path-context.ts`]
685
+ - `formatRuntimePathForDisplay(...)`: serialize user-home-relative paths with `~` when applicable [`src/core/path-context.ts`]
686
+ - `formatRuntimePathForDisplay(...)`: serialize guideline file paths for prompt substitution [`src/core/path-context.ts`]
687
+ - `renderBundledCommitInstruction(...)`: render `resources/instructions/git_commit.md` or `resources/instructions/git_read-only.md` for `%%COMMIT%%` [`src/core/prompts.ts`]
688
+ - `readBundledInstruction(...)`: read bundled commit instruction [`src/core/resources.ts`]
689
+ - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources [`src/core/resources.ts`]
690
+ - `getBundledResourceRoot(...)`: resolve installation-owned resource root [`src/core/resources.ts`]
691
+ - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
692
+ - `buildPromptReplacements(...)`: merge shared path substitutions with `%%ARGS%%` and `%%PROMPT%%` [`src/core/prompts.ts`]
693
+ - `applyReplacements(...)`: substitute token values including `%%COMMIT%%` [`src/core/prompts.ts`]
694
+ - `injectPromptExecutionBlock(...)`: prepend extension-owned runtime instructions for prompt commands [`src/core/prompts.ts`]
695
+ - `buildPromptExecutionBlock(...)`: serialize git/doc/worktree preflight facts for the prompt [`src/core/prompts.ts`]
696
+ - `getPromptRequiredDocs(...)`: map the prompt name to canonical-doc probes [`src/core/prompt-command-runtime.ts`]
697
+ - `injectPiDevConformanceBlock(...)`: add conditional pi.dev governance guidance for read-only docs, interface-contract review, and pi client validation [`src/core/prompts.ts`]
698
+ - `buildPiDevConformanceBlock(...)`: resolve manifest-gated pi.dev governance rules for read-only docs, interface contracts, and pi client validation [`src/core/prompts.ts`]
763
699
  - `adaptPromptForInternalTools(...)`: rewrite tool names for internal wrappers [`src/core/prompts.ts`]
764
- - `deliverPromptCommand(...)`: dispatch the rendered prompt into the current active session [`src/index.ts`]
765
- - `statusController.state.pendingPromptRequest`: cache the prompt command name and raw `%%ARGS%%` payload for the next successful completion [`src/core/extension-status.ts`]
766
- - External boundaries: `pi.sendUserMessage(...)` delivers the rendered prompt payload.
767
- - `registerAgentTools(...)`: register structured pi tools whose execute callbacks reuse internal runner families and agent-oriented payload builders [`src/index.ts`]
700
+ - `activatePromptCommandExecution(...)`: switch to the verified execution session through replacement-session-aware `ctx.switchSession(sessionPath, { withSession })` handling, reuse the persisted replacement-session context when later lifecycle hooks omit `switchSession()`, carry forward the returned replacement-session context for later session-bound work, re-align `process.cwd()` to the execution path, confirm `process.cwd()` plus the persisted execution-session file header cwd when the file is already persisted (treating a not-yet-flushed session file as a non-fatal lazy-persistence state because pi writes session files on first assistant flush), and store the verified runtime path plus reusable command-context state used by later tool execution and prompt-end handling [`src/core/prompt-command-runtime.ts`]
701
+ - `resolvePromptCommandSwitchContext(...)`: prefer the live command context or fall back to the persisted replacement-session context keyed by the execution-session file [`src/core/prompt-command-runtime.ts`]
702
+ - `switchPromptCommandSession(...)`: perform the session switch, tolerate the documented stale-extension-context side effect from invalidating the old closure, and let later verification prove whether the target session actually became active [`src/core/prompt-command-runtime.ts`]
703
+ - `isPromptCommandStaleContextError(...)`: classify stale-extension-context failures raised during prompt-command session switching [`src/core/prompt-command-runtime.ts`]
704
+ - `writePersistedPromptCommandSessionContext(...)`: store the reusable command-capable replacement-session context for later closure handling [`src/core/prompt-command-state.ts`]
705
+ - `clearPersistedPromptCommandSessionContext(...)`: drop reusable command-context persistence when worktree routing is inactive [`src/core/prompt-command-state.ts`]
706
+ - `logPromptWorkflowEvent(...)`: append selected workflow-activation debug entries [`src/index.ts`]
707
+ - `deliverPromptCommand(...)`: start dispatch of the rendered prompt into the current active session after execution-session activation is verified, preferring replacement-session `sendUserMessage(...)` when available, returning the delivery promise so the final `running` transition is recorded immediately after handoff begins instead of after the full prompt run completes, and suppressing the documented stale post-restore rejection once the prompt was already accepted [`src/index.ts`]
708
+ - `writePersistedPromptCommandRuntimeState(...)`: mirror the prepared prompt execution plan into process-scoped persistence before the worktree session switch returns control [`src/core/prompt-command-state.ts`]
709
+ - `isStaleExtensionContextError(...)`: classify stale post-restore delivery rejections from replacement-session `sendUserMessage(...)` [`src/core/extension-status.ts`]
710
+ - External boundaries: replacement-session `sendUserMessage(...)` or fallback `pi.sendUserMessage(...)` delivers the rendered prompt payload into the active `AgentSession`.
711
+ - `abortPromptCommandExecution(...)`: restore the original session-backed base path and delete created worktree resources when command-side preflight or prompt handoff fails [`src/core/prompt-command-runtime.ts`]
712
+ - `restorePromptCommandExecution(...)`: switch back to the original session through replacement-session-aware `ctx.switchSession(sessionPath, { withSession })` handling, reuse the persisted replacement-session context when lifecycle hooks omit `switchSession()`, carry forward the returned replacement-session context for later session-bound work, re-align `process.cwd()` to `base-path`, confirm `process.cwd()` plus the persisted original-session file header cwd when the file is already persisted, append optional workflow-restore debug entries, clear active worktree path facts, and best-effort realign the live `ctx.cwd` mirror when worktree routing was active without failing on stale or getter-only context mirrors [`src/core/prompt-command-runtime.ts`]
713
+ - `resolvePromptCommandSwitchContext(...)`: prefer the live command context or fall back to the persisted replacement-session context keyed by the execution-session file [`src/core/prompt-command-runtime.ts`]
714
+ - `switchPromptCommandSession(...)`: perform the session switch, tolerate the documented stale-extension-context side effect from invalidating the old closure, and let later verification prove whether the target session actually became active [`src/core/prompt-command-runtime.ts`]
715
+ - `isPromptCommandStaleContextError(...)`: classify stale-extension-context failures raised during prompt-command session switching [`src/core/prompt-command-runtime.ts`]
716
+ - `logDebugPromptWorkflowEvent(...)`: append selected workflow-restore debug entries [`src/core/debug-runtime.ts`]
717
+ - `clearPersistedPromptCommandSessionContext(...)`: drop reusable command-context persistence after base-path restoration succeeds [`src/core/prompt-command-state.ts`]
718
+ - `deletePromptWorktree(...)`: delete the dedicated worktree and branch and append selected worktree-delete debug entries [`src/core/prompt-command-runtime.ts`]
719
+ - `logDebugPromptEvent(...)`: append selected prompt debug entries for worktree deletion [`src/core/debug-runtime.ts`]
720
+ - `cleanupPromptWorktreeCreation(...)`: remove registered worktree entries, leftover directories, and matching branches [`src/core/prompt-command-runtime.ts`]
721
+ - `promptWorktreeRegistered(...)`: test whether the sibling worktree remains registered [`src/core/prompt-command-runtime.ts`]
722
+ - `promptWorktreeBranchExists(...)`: test whether the matching branch remains present [`src/core/prompt-command-runtime.ts`]
723
+ - `registerAgentTools(...)`: register structured pi tools whose execute callbacks reuse internal runner families, token-optimized payload builders, and compact-plus-expanded custom result renderers [`src/index.ts`]
768
724
  - `ensureBundledResourcesAccessible(...)`: validate installation-owned bundled resources for tool executes that need bundled assets [`src/core/resources.ts`]
769
725
  - `getBundledResourceRoot(...)`: resolve installation-owned resource root [`src/core/resources.ts`]
770
726
  - `getInstallationPath(...)`: resolve the installed extension root from the executing module [`src/core/path-context.ts`]
@@ -779,62 +735,24 @@
779
735
  - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
780
736
  - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
781
737
  - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
782
- - `runGitPath(...)`: query the resolved git-path value [`src/core/tool-runner.ts`]
783
- - `runGetBasePath(...)`: query the resolved base-path value [`src/core/tool-runner.ts`]
784
- - `buildPathQueryToolPayload(...)`: structure token-optimized path-query payloads for `git-path` and `get-base-path` [`src/core/agent-tool-json.ts`]
785
- - `buildTokenToolPayload(...)`: construct token-optimized token JSON with direct-access source facts and metrics [`src/core/token-counter.ts`]
786
- - `probeRequestedPath(...)`: classify requested paths as readable files, missing inputs, or non-file inputs [`src/core/token-counter.ts`]
787
- - `countFilesMetrics(...)`: read readable files and extract token, character, byte, line, heading, and optional Doxygen facts [`src/core/token-counter.ts`]
788
- - `buildCountFileMetricsResult(...)`: assemble direct-access per-file metrics and metadata [`src/core/token-counter.ts`]
789
- - `TokenCounter.countTokens(...)`: encode content and count tokens [`src/core/token-counter.ts`]
790
- - `TokenCounter.countChars(...)`: count characters [`src/core/token-counter.ts`]
791
- - `countLines(...)`: count logical lines [`src/core/token-counter.ts`]
792
- - `inferLanguageName(...)`: infer agent-oriented language labels [`src/core/token-counter.ts`]
793
- - `extractPrimaryHeadingText(...)`: extract the first markdown heading when present [`src/core/token-counter.ts`]
794
- - `extractLeadingDoxygenFields(...)`: extract file-level Doxygen fields when present [`src/core/token-counter.ts`]
795
- - `parseDoxygenComment(...)`: parse normalized Doxygen fields [`src/core/doxygen-parser.ts`]
796
- - `buildTokenToolExecuteResult(...)`: wrap token payloads into tool content and structured details [`src/index.ts`]
797
- - `buildTokenToolExecutionStderr(...)`: serialize skipped and error observations into stderr text [`src/index.ts`]
798
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
799
- - `buildReferenceToolPayload(...)`: construct token-optimized references JSON with repository structure, symbols, and Doxygen fields [`src/core/reference-payload.ts`]
800
- - `canonicalizeReferencePath(...)`: normalize request and file paths against the project base [`src/core/reference-payload.ts`]
801
- - `analyzeReferenceFile(...)`: analyze one processable file into structured imports, symbols, and comments [`src/core/reference-payload.ts`]
802
- - `buildRepositoryTree(...)`: materialize the repository directory tree as structured JSON [`src/core/reference-payload.ts`]
803
- - `buildReferenceToolExecuteResult(...)`: wrap references payloads into tool content and structured details [`src/index.ts`]
804
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
805
- - `buildCompressToolPayload(...)`: construct token-optimized compression JSON with structured line facts, symbols, and Doxygen fields [`src/core/compress-payload.ts`]
806
- - `analyzeCompressFile(...)`: compress one requested file and attach symbol metadata when available [`src/core/compress-payload.ts`]
807
- - `compressFileDetailed(...)`: compress one file into structured lines and rendered text [`src/core/compress.ts`]
808
- - `analyzeCompressedFileSymbols(...)`: extract symbol and Doxygen records for compressed files [`src/core/compress-payload.ts`]
809
- - `buildCompressionToolExecuteResult(...)`: wrap compression payloads into tool content and structured details [`src/index.ts`]
810
- - `buildCompressToolExecutionStderr(...)`: serialize skipped, error, and symbol-analysis warning entries [`src/core/compress-payload.ts`]
811
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
812
- - `buildFindToolSchemaDescription(...)`: synthesize find parameter-schema descriptions [`src/index.ts`]
813
- - `buildFindToolPromptGuidelines(...)`: synthesize agent-oriented find guidance strings [`src/index.ts`]
814
- - `buildFindToolSupportedTagGuidelines(...)`: emit per-language supported-tag guidance lines [`src/index.ts`]
815
- - `buildFindToolPayload(...)`: construct token-optimized construct-search JSON with structured file statuses, matches, line facts, and Doxygen fields [`src/core/find-payload.ts`]
816
- - `validateTagFilter(...)`: normalize requested construct tags [`src/core/find-payload.ts`]
817
- - `validateRegexPattern(...)`: compile the construct-name regex [`src/core/find-payload.ts`]
818
- - `analyzeFindFile(...)`: analyze one requested file into structured search status and match records [`src/core/find-payload.ts`]
819
- - `buildMatchEntry(...)`: structure one matched construct with typed lines and Doxygen fields [`src/core/find-payload.ts`]
820
- - `buildStrippedConstructLineEntries(...)`: strip comments into structured code lines [`src/core/find-constructs.ts`]
821
- - `buildFindToolExecuteResult(...)`: wrap construct-search payloads into tool content and structured details [`src/index.ts`]
822
- - `buildFindToolExecutionStderr(...)`: serialize invalid-request, skipped, no-match, and analysis-error diagnostics [`src/core/find-payload.ts`]
823
- - `buildStructuredToolExecuteResult(...)`: mirror the final JSON object into tool content and details [`src/core/agent-tool-json.ts`]
824
- - `runFilesStaticCheck(...)`: execute configured checkers for explicit-file requests [`src/core/tool-runner.ts`]
825
- - `collectProjectStaticCheckSelection(...)`: derive project static-check file selections and fixture exclusions [`src/index.ts`]
826
- - `runProjectStaticCheck(...)`: execute configured checkers for project source and test selections [`src/core/tool-runner.ts`]
827
- - `buildStaticCheckToolPayload(...)`: structure token-optimized static-check summary, file-selection, and execution facts [`src/core/agent-tool-json.ts`]
828
- - `runGitCheck(...)`: validate runtime repository cleanliness [`src/core/tool-runner.ts`]
829
- - `buildGitCheckToolPayload(...)`: structure token-optimized git-validation status and execution facts [`src/core/agent-tool-json.ts`]
830
- - `buildDocsCheckToolPayload(...)`: structure token-optimized canonical-doc presence and remediation facts [`src/core/agent-tool-json.ts`]
831
- - `runGitWtName(...)`: generate the standardized worktree name [`src/core/tool-runner.ts`]
832
- - `buildWorktreeNameToolPayload(...)`: structure token-optimized worktree-name generation facts [`src/core/agent-tool-json.ts`]
833
- - `runGitWtCreate(...)`: create a dedicated worktree and branch [`src/core/tool-runner.ts`]
834
- - `runGitWtDelete(...)`: delete a dedicated worktree and branch [`src/core/tool-runner.ts`]
835
- - `buildWorktreeMutationToolPayload(...)`: structure token-optimized worktree create-delete facts [`src/core/agent-tool-json.ts`]
836
- - `buildToolExecutionSection(...)`: normalize residual stdout, stderr, and exit-code metadata [`src/core/agent-tool-json.ts`]
837
- - `normalizeToolFailure(...)`: convert `ReqError` failures into structured execution records [`src/core/agent-tool-json.ts`]
738
+ - `buildSearchToolSchemaDescription(...)`: synthesize search parameter-schema descriptions [`src/index.ts`]
739
+ - `buildSearchToolPromptGuidelines(...)`: synthesize agent-oriented search guidance strings [`src/index.ts`]
740
+ - `buildSearchToolSupportedTagGuidelines(...)`: emit per-language supported-tag guidance lines [`src/index.ts`]
741
+ - `buildStructuredToolRenderResult(...)`: attach compact invocation-parameter summaries and expanded monolithic result renderers to every agent tool [`src/index.ts`]
742
+ - `executeMonolithicTool(...)`: execute one CLI-style runner and wrap one monolithic content block plus minimal execution details [`src/index.ts`]
743
+ - `runFilesTokens(...)`: execute the monolithic token pack-summary runner [`src/core/tool-runner.ts`]
744
+ - `runFilesReferences(...)`: execute the monolithic explicit-file references markdown runner [`src/core/tool-runner.ts`]
745
+ - `runFilesCompress(...)`: execute the monolithic explicit-file compression markdown runner [`src/core/tool-runner.ts`]
746
+ - `runFilesSearch(...)`: execute the monolithic explicit-file construct-search markdown runner [`src/core/tool-runner.ts`]
747
+ - `runReferences(...)`: execute the monolithic project references markdown runner [`src/core/tool-runner.ts`]
748
+ - `runCompress(...)`: execute the monolithic project compression markdown runner [`src/core/tool-runner.ts`]
749
+ - `runSearch(...)`: execute the monolithic project construct-search markdown runner [`src/core/tool-runner.ts`]
750
+ - `runTokens(...)`: execute the monolithic canonical-doc token runner [`src/core/tool-runner.ts`]
751
+ - `runFilesStaticCheck(...)`: execute configured checkers for explicit-file requests [`src/core/tool-runner.ts`]
752
+ - `runProjectStaticCheck(...)`: execute configured checkers for project source and test selections [`src/core/tool-runner.ts`]
753
+ - `buildMonolithicToolExecuteResult(...)`: wrap runner stdout or stderr into tool content plus execution details [`src/core/agent-tool-json.ts`]
754
+ - `buildToolExecutionSection(...)`: normalize residual stdout, stderr, and exit-code metadata [`src/core/agent-tool-json.ts`]
755
+ - `normalizeToolFailure(...)`: convert runner failures into deterministic execution records [`src/core/agent-tool-json.ts`]
838
756
  - `registerConfigCommands(...)`: register interactive configuration commands [`src/index.ts`]
839
757
  - `configurePiUsereq(...)`: interactive configuration menu root [`src/index.ts`]
840
758
  - `configurePiUsereq(...)`: serve the inline `show-config` action inside the shared settings-menu flow [`src/index.ts`]
@@ -843,6 +761,7 @@
843
761
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
844
762
  - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
845
763
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
764
+ - `normalizeGitWorktreePrefix(...)`: canonicalize persisted worktree prefix [`src/core/config.ts`]
846
765
  - `normalizePiNotifySoundLevel(...)`: normalize persisted sound level [`src/core/pi-notify.ts`]
847
766
  - `normalizePiNotifyShortcut(...)`: normalize persisted shortcut [`src/core/pi-notify.ts`]
848
767
  - `normalizePiNotifyCommand(...)`: normalize persisted sound commands [`src/core/pi-notify.ts`]
@@ -850,73 +769,152 @@
850
769
  - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
851
770
  - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
852
771
  - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
853
- - `registerPiNotifyShortcut(...)`: register the configured successful-run sound shortcut when the runtime supports shortcuts [`src/index.ts`]
772
+ - `registerPiNotifyShortcut(...)`: register the configured sound-level shortcut when the runtime supports shortcuts [`src/index.ts`]
773
+ - `getProcessCwdSafe(...)`: resolve a fallback-safe process cwd for extension-load registration [`src/index.ts`]
854
774
  - `loadProjectConfig(...)`: load config for shortcut registration [`src/index.ts`]
855
775
  - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
856
776
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
857
777
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
858
778
  - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
859
779
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
780
+ - `normalizeGitWorktreePrefix(...)`: canonicalize persisted worktree prefix [`src/core/config.ts`]
860
781
  - `normalizePiNotifySoundLevel(...)`: normalize persisted sound level [`src/core/pi-notify.ts`]
861
782
  - `normalizePiNotifyShortcut(...)`: normalize persisted shortcut [`src/core/pi-notify.ts`]
862
783
  - `normalizePiNotifyCommand(...)`: normalize persisted sound commands [`src/core/pi-notify.ts`]
863
- - `isInsideGitRepo(...)`: probe git repository membership [`src/core/tool-runner.ts`]
864
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
865
- - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
866
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
867
- - `registerExtensionStatusHooks(...)`: register shared wrappers for lifecycle telemetry hooks [`src/index.ts`]
868
- - `handleExtensionStatusEvent(...)`: process intercepted hook payloads through shared status helpers [`src/index.ts`]
869
- - `loadProjectConfig(...)`: session-start configuration load [`src/index.ts`]
870
- - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
784
+ - `registerExtensionStatusHooks(...)`: register shared wrappers for lifecycle telemetry hooks and suppress the documented stale-extension-context callbacks that can arrive after successful session replacement [`src/index.ts`]
785
+ - `handleExtensionStatusEvent(...)`: process intercepted hook payloads through shared status helpers, tool-result debug logging, dedicated workflow-closure plus shutdown diagnostics built from pre-shutdown prompt snapshots, workflow-state transitions, recover a live bootstrap cwd during `session_start` when stale context mirrors still point at deleted worktrees, matched-success prompt-command restoration to `base-path` plus merge and worktree deletion, stale-safe closure notifications, and matched-failure base-path restoration plus closure-error notification using persisted replacement-session contexts when event hooks omit `switchSession()` [`src/index.ts`]
786
+ - `resolveLiveBootstrapCwd(...)`: recover a live bootstrap cwd from the startup context, runtime path state, or process cwd when stale worktree paths no longer exist [`src/index.ts`]
787
+ - `syncContextCwdMirror(...)`: best-effort realign the startup context `cwd` mirror to the recovered live cwd before startup config loads [`src/index.ts`]
788
+ - `loadProjectConfig(...)`: session-start configuration load from the recovered live cwd [`src/index.ts`]
789
+ - `getProjectBase(...)`: resolve project base from the recovered live cwd [`src/index.ts`]
871
790
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
872
791
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
873
792
  - `getDefaultConfig(...)`: build default config [`src/core/config.ts`]
874
793
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
875
- - `isInsideGitRepo(...)`: probe git repository membership [`src/core/tool-runner.ts`]
876
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
877
- - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
878
- - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
879
794
  - `applyConfiguredPiUsereqTools(...)`: enable configured active tools on `session_start` [`src/index.ts`]
880
795
  - `getConfiguredEnabledPiUsereqTools(...)`: canonicalize configured enabled tools [`src/index.ts`]
881
796
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
882
- - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory [`src/index.ts`]
797
+ - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory in documented menu order [`src/index.ts`]
883
798
  - `setPiUsereqStatusConfig(...)`: cache docs/tests/src and pi-notify values for later status renders [`src/core/extension-status.ts`]
884
- - `updateExtensionStatus(...)`: refresh stored context usage, elapsed timers, prompt-request state, cumulative runtime, and rendered status text [`src/core/extension-status.ts`]
799
+ - `activatePromptCommandExecution(...)`: re-verify the prepared execution session through replacement-session-aware `ctx.switchSession(sessionPath, { withSession })` handling, reuse persisted replacement-session contexts when lifecycle hooks omit `switchSession()`, re-align `process.cwd()` to the execution path, confirm `process.cwd()` plus the persisted execution-session file header cwd when the file is already persisted before agent start, and refresh reusable command-context persistence [`src/core/prompt-command-runtime.ts`]
800
+ - `resolveDebugProjectBase(...)`: prefer static `base-path` for debug-log writes during worktree-backed prompt runs and recover a live bootstrap cwd when no prompt plan is active [`src/index.ts`]
801
+ - `notifyContextSafely(...)`: suppress stale replacement-context notification failures after session replacement while preserving closure progress [`src/index.ts`]
802
+ - `logDebugToolExecution(...)`: append selected tool-result debug entries [`src/core/debug-runtime.ts`]
803
+ - `updateExtensionStatus(...)`: refresh stored context usage, reset or restore persisted elapsed timers on `session_start`, restore persisted prompt-command state when the active session matches the forked execution session, resynchronize that state on later lifecycle hooks after switch-triggered rebinding, preserve in-memory prompt-command state plus process-scoped persistence across `session_shutdown`, accumulate completed runtime, and render status text while tolerating stale replacement contexts [`src/core/extension-status.ts`]
885
804
  - `refreshContextUsage(...)`: sync the latest context-usage snapshot [`src/core/extension-status.ts`]
805
+ - `shouldResetElapsedStateOnSessionStart(...)`: detect `startup|reload` reset boundaries [`src/core/extension-status.ts`]
806
+ - `resetElapsedState(...)`: clear in-memory and persisted completed timers [`src/core/extension-status.ts`]
807
+ - `restorePersistedElapsedState(...)`: restore persisted completed timers for `new|resume|fork` [`src/core/extension-status.ts`]
808
+ - `restorePersistedPromptCommandState(...)`: restore persisted workflow state plus prompt execution plans when the current session file matches the forked execution session [`src/core/extension-status.ts`]
809
+ - `getContextSessionFile(...)`: read the active session file from the current extension context for prompt-state resynchronization [`src/core/extension-status.ts`]
810
+ - `restorePersistedPromptCommandRuntimeStateForSession(...)`: read the process-scoped prompt execution store for the current session file [`src/core/prompt-command-state.ts`]
811
+ - `shouldResetWorkflowStateOnSessionStart(...)`: detect `startup|new|reload` workflow-reset boundaries [`src/core/extension-status.ts`]
812
+ - `persistElapsedState(...)`: mirror completed timers into process-scoped persistence [`src/core/extension-status.ts`]
813
+ - `shouldPreservePromptCommandStateOnShutdown(...)`: detect switch-triggered `session_shutdown` events that must keep in-memory prompt state plus prompt execution persistence intact [`src/core/extension-status.ts`]
814
+ - `isStaleExtensionContextError(...)`: detect stale replacement-session render failures after session replacement [`src/core/extension-status.ts`]
815
+ - `persistPromptCommandState(...)`: mirror workflow state plus pending or active prompt execution plans into process-scoped persistence [`src/core/extension-status.ts`]
816
+ - `writePersistedPromptCommandRuntimeState(...)`: store workflow state plus pending or active prompt execution plans on `globalThis` [`src/core/prompt-command-state.ts`]
886
817
  - `syncPiUsereqStatusTicker(...)`: start or stop the live elapsed ticker [`src/core/extension-status.ts`]
887
- - `renderPiUsereqStatus(...)`: render the base/context/elapsed/beep/sound/pushover footer with CLI-theme token overlays [`src/core/extension-status.ts`]
818
+ - `renderPiUsereqStatus(...)`: render the status/current-path/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
888
819
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
889
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with consolidated elapsed semantics plus the Pushover enable field [`src/core/extension-status.ts`]
820
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, current-path, elapsed semantics, and sound status fields [`src/core/extension-status.ts`]
890
821
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
891
822
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
892
- - `formatContextUsageBar(...)`: render the 10-cell context bar or threshold-specific overlay [`src/core/extension-status.ts`]
893
- - `resolveContextUsageOverlay(...)`: choose `◀ CLEAR ▶ ` or ` ◀ FULL ▶ ` overlay states with CLI-supported theme tokens [`src/core/extension-status.ts`]
894
- - `formatContextUsageOverlay(...)`: paint the fixed-width overlay with preserved bar background [`src/core/extension-status.ts`]
823
+ - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
824
+ - `formatContextUsageBar(...)`: render the icon-based context gauge [`src/core/extension-status.ts`]
825
+ - `resolveContextUsageIconText(...)`: map normalized context usage to the fixed-width gauge icon [`src/core/extension-status.ts`]
895
826
  - `formatElapsedStatusValue(...)`: compose `⏱︎`, `⚑`, and `⌛︎` timer segments [`src/core/extension-status.ts`]
896
827
  - `formatCompletedStatusDuration(...)`: render completed timers or the unset placeholder [`src/core/extension-status.ts`]
897
828
  - `formatStatusDuration(...)`: render `M:SS` durations [`src/core/extension-status.ts`]
898
- - `formatPiNotifyBeepStatus(...)`: serialize enabled beep flags for the footer [`src/core/pi-notify.ts`]
899
- - `formatPiNotifyPushoverStatus(...)`: serialize the dedicated Pushover enable flag for the footer [`src/core/pi-notify.ts`]
900
- - `runPiNotifyEffects(...)`: dispatch configured terminal beeps, successful-run sound hooks, and optional Pushover API requests on `agent_end` [`src/core/pi-notify.ts`]
901
- - `classifyPiNotifyOutcome(...)`: map assistant stop reasons to `end`, `esc`, or `err` [`src/core/pi-notify.ts`]
829
+ - `runPiNotifyEffects(...)`: dispatch configured command-notify, sound, and optional Pushover API requests on `agent_end` [`src/core/pi-notify.ts`]
830
+ - `classifyPiNotifyOutcome(...)`: map assistant stop reasons to `completed`, `interrupted`, or `failed` [`src/core/pi-notify.ts`]
902
831
  - `hasAgentEndStopReason(...)`: scan assistant stop reasons inside the `agent_end` payload [`src/core/pi-notify.ts`]
903
- - `buildPiNotifyTitle(...)`: build the stable pi-notify title [`src/core/pi-notify.ts`]
904
- - `buildPiNotifyBody(...)`: build the stable pi-notify body from the classified outcome [`src/core/pi-notify.ts`]
905
- - `notifyPiTerminal(...)`: route terminal notifications by runtime environment when the matching beep flag is enabled [`src/core/pi-notify.ts`]
906
- - `notifyWindows(...)`: emit Windows toast notifications [`src/core/pi-notify.ts`]
907
- - `notifyOSC99(...)`: emit Kitty OSC 99 notifications [`src/core/pi-notify.ts`]
908
- - `notifyOSC9(...)`: emit OSC 9 notifications [`src/core/pi-notify.ts`]
909
- - `notifyOSC777(...)`: emit OSC 777 notifications [`src/core/pi-notify.ts`]
910
- - `runPiNotifySoundCommand(...)`: execute the configured successful-run sound command when sound is enabled [`src/core/pi-notify.ts`]
832
+ - `shouldRunPiNotifyCommand(...)`: validate prompt-scoped command-notify prerequisites [`src/core/pi-notify.ts`]
833
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
834
+ - `runPiNotifyCommand(...)`: execute `PI_NOTIFY_CMD` with runtime placeholder substitution [`src/core/pi-notify.ts`]
835
+ - `substitutePiNotifyShellTemplate(...)`: replace installation, prompt, base, time, args, and result placeholders inside the shell template [`src/core/pi-notify.ts`]
836
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
837
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
838
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
839
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
840
+ - `substitutePiNotifyInstallPath(...)`: replace `%%INSTALLATION_PATH%%` before shell execution [`src/core/pi-notify.ts`]
841
+ - `quotePiNotifyInstallPath(...)`: quote the installation path for shell reuse [`src/core/pi-notify.ts`]
842
+ - `escapePiNotifyShellTemplateValue(...)`: escape prompt-scoped values for double-quoted shell insertion [`src/core/pi-notify.ts`]
843
+ - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
844
+ - `runPiNotifyShellCommand(...)`: spawn one detached shell command [`src/core/pi-notify.ts`]
845
+ - `shouldRunPiNotifySound(...)`: validate sound level plus the matching event toggle [`src/core/pi-notify.ts`]
846
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
847
+ - `runPiNotifySoundCommand(...)`: execute the configured sound command when the sound level and matching event toggle permit delivery [`src/core/pi-notify.ts`]
911
848
  - `resolvePiNotifySoundCommand(...)`: select the configured command for `low`, `mid`, or `high` [`src/core/pi-notify.ts`]
912
849
  - `substitutePiNotifyInstallPath(...)`: replace `%%INSTALLATION_PATH%%` before shell execution [`src/core/pi-notify.ts`]
913
850
  - `quotePiNotifyInstallPath(...)`: quote the installation path for shell reuse [`src/core/pi-notify.ts`]
914
- - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
915
- - `runPiNotifyPushoverRequest(...)`: POST the successful prompt payload to the Pushover Message API when credentials and flags permit delivery [`src/core/pi-notify.ts`]
851
+ - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
852
+ - `runPiNotifyShellCommand(...)`: spawn one detached shell command [`src/core/pi-notify.ts`]
853
+ - `shouldRunPiNotifyPushover(...)`: validate global Pushover enablement, the matching event toggle, and required credentials [`src/core/pi-notify.ts`]
854
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
855
+ - `runPiNotifyPushoverRequest(...)`: POST the prompt-end payload to the Pushover Message API when credentials and flags permit delivery [`src/core/pi-notify.ts`]
916
856
  - `buildPiNotifyPushoverPayload(...)`: serialize token, user, title, priority, and message fields [`src/core/pi-notify.ts`]
917
- - `buildPiNotifyPushoverTitle(...)`: compose `<prompt> @ <base-path> [<time>]` for successful completion [`src/core/pi-notify.ts`]
918
- - `buildPiNotifyPushoverBody(...)`: reuse the raw prompt argument payload [`src/core/pi-notify.ts`]
919
- - `configurePiUsereq(...)`: interactive configuration menu runtime root [`src/index.ts`]
857
+ - `buildPiNotifyPushoverTitle(...)`: resolve the configured Pushover title template [`src/core/pi-notify.ts`]
858
+ - `substitutePiNotifyTextTemplate(...)`: replace prompt-scoped placeholders inside the title template [`src/core/pi-notify.ts`]
859
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
860
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
861
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
862
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
863
+ - `buildPiNotifyPushoverBody(...)`: resolve the configured Pushover text template [`src/core/pi-notify.ts`]
864
+ - `substitutePiNotifyTextTemplate(...)`: replace prompt-scoped placeholders inside the text template [`src/core/pi-notify.ts`]
865
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
866
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
867
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
868
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
869
+ - `classifyPromptCommandOutcome(...)`: map agent-end payloads to `completed|interrupted|failed` [`src/core/prompt-command-runtime.ts`]
870
+ - `logPromptWorkflowEvent(...)`: append selected workflow-closure and workflow-session-shutdown debug entries [`src/index.ts`]
871
+ - `transitionPromptWorkflowState(...)`: transition workflow state for matched-success merge handling and final idle restoration, and append gated workflow-state debug entries immediately after each transition [`src/index.ts`]
872
+ - `setPiUsereqWorkflowState(...)`: transition workflow state for matched-success merge handling and final idle restoration [`src/core/extension-status.ts`]
873
+ - `renderPiUsereqStatus(...)`: render the status/current-path/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
874
+ - `logPromptWorkflowStateChange(...)`: append selected prompt workflow-transition debug entries [`src/index.ts`]
875
+ - `finalizePromptCommandExecution(...)`: verify persisted execution-session header metadata plus live worktree artifacts, restore the original session-backed base path through the persisted replacement-session context when lifecycle hooks omit `switchSession()`, merge the matched successful worktree branch with `--ff-only` from `base-path`, delete the worktree and branch after merge success, and append selected merge plus workflow-restore debug entries [`src/core/prompt-command-runtime.ts`]
876
+ - `verifyPromptCommandClosureArtifacts(...)`: verify execution-session header cwd, worktree registration, branch presence, and worktree-path existence without requiring worktree-session reactivation after prompt end [`src/core/prompt-command-runtime.ts`]
877
+ - `restorePromptCommandExecution(...)`: switch back to the original session-backed base path, reuse the persisted replacement-session context keyed by the execution-session file, append optional workflow-restore debug entries, clear active worktree path facts, and realign the live `ctx.cwd` mirror before merge or merge-abort return [`src/core/prompt-command-runtime.ts`]
878
+ - `deletePromptWorktree(...)`: delete the merged worktree and branch after successful fast-forward merge [`src/core/prompt-command-runtime.ts`]
879
+ - `restorePromptCommandExecution(...)`: switch back to the original session-backed base path when interrupted, failed, or unmatched prompt-end events skip merge and retain the worktree for manual recovery, reusing the persisted replacement-session context when lifecycle hooks omit `switchSession()` [`src/core/prompt-command-runtime.ts`]
880
+ - `shouldRunPiNotifyCommand(...)`: validate prompt-scoped command-notify prerequisites [`src/core/pi-notify.ts`]
881
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
882
+ - `runPiNotifyCommand(...)`: execute `PI_NOTIFY_CMD` with runtime placeholder substitution [`src/core/pi-notify.ts`]
883
+ - `substitutePiNotifyShellTemplate(...)`: replace installation, prompt, base, time, args, and result placeholders inside the shell template [`src/core/pi-notify.ts`]
884
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
885
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
886
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
887
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
888
+ - `substitutePiNotifyInstallPath(...)`: replace `%%INSTALLATION_PATH%%` before shell execution [`src/core/pi-notify.ts`]
889
+ - `quotePiNotifyInstallPath(...)`: quote the installation path for shell reuse [`src/core/pi-notify.ts`]
890
+ - `escapePiNotifyShellTemplateValue(...)`: escape prompt-scoped values for double-quoted shell insertion [`src/core/pi-notify.ts`]
891
+ - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
892
+ - `runPiNotifyShellCommand(...)`: spawn one detached shell command [`src/core/pi-notify.ts`]
893
+ - `shouldRunPiNotifySound(...)`: validate sound level plus the matching event toggle [`src/core/pi-notify.ts`]
894
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
895
+ - `runPiNotifySoundCommand(...)`: execute the configured sound command when the sound level and matching event toggle permit delivery [`src/core/pi-notify.ts`]
896
+ - `resolvePiNotifySoundCommand(...)`: select the configured command for `low`, `mid`, or `high` [`src/core/pi-notify.ts`]
897
+ - `substitutePiNotifyInstallPath(...)`: replace `%%INSTALLATION_PATH%%` before shell execution [`src/core/pi-notify.ts`]
898
+ - `quotePiNotifyInstallPath(...)`: quote the installation path for shell reuse [`src/core/pi-notify.ts`]
899
+ - `getInstallationPath(...)`: resolve the installed extension root [`src/core/path-context.ts`]
900
+ - `runPiNotifyShellCommand(...)`: spawn one detached shell command [`src/core/pi-notify.ts`]
901
+ - `shouldRunPiNotifyPushover(...)`: validate global Pushover enablement, the matching event toggle, and required credentials [`src/core/pi-notify.ts`]
902
+ - `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
903
+ - `runPiNotifyPushoverRequest(...)`: POST the prompt-end payload to the Pushover Message API when credentials and flags permit delivery [`src/core/pi-notify.ts`]
904
+ - `buildPiNotifyPushoverPayload(...)`: serialize token, user, title, priority, and message fields [`src/core/pi-notify.ts`]
905
+ - `buildPiNotifyPushoverTitle(...)`: resolve the configured Pushover title template [`src/core/pi-notify.ts`]
906
+ - `substitutePiNotifyTextTemplate(...)`: replace prompt-scoped placeholders inside the title template [`src/core/pi-notify.ts`]
907
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
908
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
909
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
910
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
911
+ - `buildPiNotifyPushoverBody(...)`: resolve the configured Pushover text template [`src/core/pi-notify.ts`]
912
+ - `substitutePiNotifyTextTemplate(...)`: replace prompt-scoped placeholders inside the text template [`src/core/pi-notify.ts`]
913
+ - `buildPiNotifyRuntimeTemplateValues(...)`: resolve raw prompt-scoped placeholder values [`src/core/pi-notify.ts`]
914
+ - `formatPiNotifyBasePath(...)`: render `%%BASE%%` as `~`-relative when possible [`src/core/pi-notify.ts`]
915
+ - `formatPiNotifyDuration(...)`: render `%%TIME%%` as `M:SS` [`src/core/pi-notify.ts`]
916
+ - `formatPiNotifyResult(...)`: map prompt-end outcomes to `successed|aborted|failed` [`src/core/pi-notify.ts`]
917
+ - `configurePiUsereq(...)`: interactive configuration menu runtime root for directories, `Auto git commit`, locked-or-editable worktree rows, tools, notifications, and debug settings [`src/index.ts`]
920
918
  - `loadProjectConfig(...)`: load config and normalize persisted directory paths for command context [`src/index.ts`]
921
919
  - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
922
920
  - `loadConfig(...)`: load config or defaults [`src/core/config.ts`]
@@ -928,72 +926,98 @@
928
926
  - `resolveGitRoot(...)`: resolve repository root [`src/core/tool-runner.ts`]
929
927
  - `runCapture(...)`: run git subprocess [`src/core/tool-runner.ts`]
930
928
  - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
931
- - `buildPiUsereqMenuChoices(...)`: serialize top-level settings actions plus the display-only config-path row [`src/index.ts`]
932
- - `formatProjectConfigPathForMenu(...)`: format the current config path relative to the user home when possible [`src/index.ts`]
929
+ - `buildPiUsereqMenuChoices(...)`: serialize top-level settings actions including effective worktree locking, notification and debug summaries, the display-only config-path row, and reset-only terminal rows [`src/index.ts`]
930
+ - `formatDebugMenuSummary(...)`: summarize global debug mode plus selected tool and prompt counts [`src/index.ts`]
931
+ - `formatProjectConfigPathForMenu(...)`: format the current config path with the shared `~`-relative path formatter for menu display [`src/index.ts`]
932
+ - `buildTerminalSettingsMenuChoices(...)`: append the canonical `Reset defaults` row without `Save and close` [`src/index.ts`]
933
933
  - `showPiUsereqSettingsMenu(...)`: render the shared settings-menu UI for top-level and submenu actions [`src/core/settings-menu.ts`]
934
934
  - `formatPiUsereqSettingsMenuTitle(...)`: rebuild the menu title with active-theme semantics [`src/core/settings-menu.ts`]
935
935
  - `buildPiUsereqSettingsListTheme(...)`: prefer shared CLI settings-list theming and fall back during offline replay [`src/core/settings-menu.ts`]
936
936
  - `buildFallbackPiUsereqSettingsListTheme(...)`: mirror CLI settings-list token roles from the callback-local theme [`src/core/settings-menu.ts`]
937
- - `buildSettingItems(...)`: map menu choices into settings-list rows and apply optional dim value tones [`src/core/settings-menu.ts`]
938
- - `saveProjectConfig(...)`: persist config on save-and-close [`src/index.ts`]
937
+ - `buildSettingItems(...)`: map menu choices into settings-list rows, apply optional dim tones, and disable non-selectable actions [`src/core/settings-menu.ts`]
938
+ - `persistConfigChange(...)`: persist config immediately after every settings mutation and refresh status rendering [`src/index.ts`]
939
939
  - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
940
940
  - `saveConfig(...)`: persist config JSON [`src/core/config.ts`]
941
941
  - `getProjectConfigPath(...)`: resolve config file path [`src/core/config.ts`]
942
+ - `writePersistedProjectConfigToEditor(...)`: read the already-persisted config file and write its exact text into the editor [`src/index.ts`]
943
+ - `getProjectBase(...)`: resolve project base from command context cwd [`src/index.ts`]
944
+ - `getProjectConfigPath(...)`: resolve the persisted config path [`src/core/config.ts`]
942
945
  - `setPiUsereqStatusConfig(...)`: cache the just-saved docs/tests/src and pi-notify values for status rendering [`src/core/extension-status.ts`]
943
- - `renderPiUsereqStatus(...)`: render the base/context/elapsed/beep/sound/pushover footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
946
+ - `renderPiUsereqStatus(...)`: render the status/current-path/context/elapsed/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
944
947
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
945
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with consolidated elapsed semantics plus the Pushover enable field [`src/core/extension-status.ts`]
948
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, current-path, elapsed semantics, and sound status fields [`src/core/extension-status.ts`]
946
949
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
947
950
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
948
- - `formatContextUsageBar(...)`: render the 10-cell context bar or threshold-specific overlay [`src/core/extension-status.ts`]
949
- - `resolveContextUsageOverlay(...)`: choose `◀ CLEAR ▶ ` or ` ◀ FULL ▶ ` overlay states with CLI-supported theme tokens [`src/core/extension-status.ts`]
950
- - `formatContextUsageOverlay(...)`: paint the fixed-width overlay with preserved bar background [`src/core/extension-status.ts`]
951
+ - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
952
+ - `formatContextUsageBar(...)`: render the icon-based context gauge [`src/core/extension-status.ts`]
953
+ - `resolveContextUsageIconText(...)`: map normalized context usage to the fixed-width gauge icon [`src/core/extension-status.ts`]
951
954
  - `formatElapsedStatusValue(...)`: compose `⏱︎`, `⚑`, and `⌛︎` timer segments [`src/core/extension-status.ts`]
952
955
  - `formatCompletedStatusDuration(...)`: render completed timers or the unset placeholder [`src/core/extension-status.ts`]
953
956
  - `formatStatusDuration(...)`: render `M:SS` durations [`src/core/extension-status.ts`]
954
- - `formatPiNotifyBeepStatus(...)`: serialize enabled beep flags for the footer [`src/core/pi-notify.ts`]
955
- - `configureStaticCheckMenu(...)`: interactive static-check editor [`src/index.ts`]
956
- - `formatStaticCheckLanguagesSummary(...)`: summarize configured checker languages [`src/index.ts`]
957
- - `renderStaticCheckReference(...)`: render static-check reference text [`src/index.ts`]
958
- - `formatStaticCheckLanguagesSummary(...)`: summarize configured checker languages [`src/index.ts`]
959
- - `formatStaticCheckEntry(...)`: format one configured checker entry [`src/index.ts`]
957
+ - `configureStaticCheckMenu(...)`: interactive guided static-check editor with per-language enable toggles [`src/index.ts`]
958
+ - `getStaticCheckLanguageConfigForMenu(...)`: resolve a menu-facing per-language static-check object [`src/index.ts`]
959
+ - `countConfiguredStaticCheckLanguages(...)`: count languages that retain checker entries [`src/index.ts`]
960
+ - `countEnabledStaticCheckLanguages(...)`: count languages whose enable flag is on [`src/index.ts`]
961
+ - `formatStaticCheckLanguagesSummary(...)`: summarize enabled and configured checker languages [`src/index.ts`]
962
+ - `buildStaticCheckMenuChoices(...)`: serialize guided add/remove actions plus direct per-language toggle rows [`src/index.ts`]
960
963
  - `getSupportedStaticCheckLanguageSupport(...)`: enumerate supported languages and extensions [`src/core/static-check.ts`]
961
964
  - `getSupportedStaticCheckLanguages(...)`: enumerate canonical supported languages [`src/core/static-check.ts`]
962
- - `buildSupportedStaticCheckLanguageChoices(...)`: serialize supported languages with configured counts [`src/index.ts`]
965
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows to the selector menu [`src/index.ts`]
966
+ - `buildSupportedStaticCheckLanguageChoices(...)`: serialize supported languages with enablement, configured counts, and terminal rows [`src/index.ts`]
967
+ - `getSupportedStaticCheckLanguageSupport(...)`: enumerate supported languages and extensions [`src/core/static-check.ts`]
968
+ - `getSupportedStaticCheckLanguages(...)`: enumerate canonical supported languages [`src/core/static-check.ts`]
969
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows to the selector menu [`src/index.ts`]
970
+ - `buildConfiguredStaticCheckLanguageChoices(...)`: serialize configured languages plus terminal rows for removal flows [`src/index.ts`]
971
+ - `getSupportedStaticCheckLanguageSupport(...)`: enumerate supported languages and extensions [`src/core/static-check.ts`]
972
+ - `getSupportedStaticCheckLanguages(...)`: enumerate canonical supported languages [`src/core/static-check.ts`]
973
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows to the selector menu [`src/index.ts`]
974
+ - `resetStaticCheckConfig(...)`: restore documented per-language static-check defaults [`src/index.ts`]
975
+ - `getDefaultStaticCheckConfig(...)`: build documented per-language static-check defaults [`src/core/config.ts`]
976
+ - `createStaticCheckLanguageConfig(...)`: clone checker entries and derive the enable flag [`src/core/config.ts`]
977
+ - `createStaticCheckLanguageConfig(...)`: create empty per-language configs for toggle and removal flows [`src/core/config.ts`]
963
978
  - `shellSplit(...)`: parse optional parameter input [`src/core/utils.ts`]
964
- - `parseEnableStaticCheck(...)`: parse `LANG=Command,CMD[,PARAM...]` specification [`src/core/static-check.ts`]
965
- - `splitCsvLikeTokens(...)`: split comma-like spec payload with quoting support [`src/core/static-check.ts`]
966
- - `formatStaticCheckModules(...)`: render valid user modules for error paths [`src/core/static-check.ts`]
967
- - `configurePiUsereqToolsMenu(...)`: interactive active-tool editor [`src/index.ts`]
979
+ - `configurePiUsereqToolsMenu(...)`: interactive active-tool editor without a status-reference action [`src/index.ts`]
968
980
  - `applyConfiguredPiUsereqTools(...)`: enforce configured active-tool set [`src/index.ts`]
969
981
  - `getConfiguredEnabledPiUsereqTools(...)`: canonicalize configured enabled tools [`src/index.ts`]
970
982
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
971
- - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory [`src/index.ts`]
972
- - `renderPiUsereqToolsReference(...)`: render configurable active-tool reference text [`src/index.ts`]
973
- - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory [`src/index.ts`]
974
- - `getConfiguredEnabledPiUsereqTools(...)`: canonicalize configured enabled tools [`src/index.ts`]
975
- - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
976
- - `getPiUsereqToolKind(...)`: classify builtin versus extension tools for UI rendering [`src/index.ts`]
983
+ - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory in documented menu order [`src/index.ts`]
977
984
  - `setConfiguredPiUsereqTools(...)`: persist selected enabled tools in memory [`src/index.ts`]
978
985
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
979
986
  - `applyConfiguredPiUsereqTools(...)`: enforce configured active-tool set [`src/index.ts`]
980
987
  - `getConfiguredEnabledPiUsereqTools(...)`: canonicalize configured enabled tools [`src/index.ts`]
981
988
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
982
- - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory [`src/index.ts`]
983
- - `buildPiUsereqToolToggleChoices(...)`: serialize per-tool startup-toggle rows [`src/index.ts`]
984
- - `getPiUsereqToolKind(...)`: classify builtin versus extension tools for UI rendering [`src/index.ts`]
985
- - `configurePiNotifyMenu(...)`: interactive pi-notify editor [`src/index.ts`]
986
- - `buildPiNotifyMenuChoices(...)`: serialize notification actions plus the nested Pushover submenu entry for the shared settings menu [`src/index.ts`]
987
- - `togglePiNotifyBeepFlag(...)`: toggle one prompt-end beep flag [`src/index.ts`]
988
- - `configurePiNotifyPushoverMenu(...)`: interactive Pushover editor nested under the notifications menu [`src/index.ts`]
989
- - `buildPiNotifyPushoverMenuChoices(...)`: serialize Pushover global-disable, enable, credential, and priority actions [`src/index.ts`]
990
- - `selectPiNotifyPushoverPriority(...)`: present the `0=Normal` and `1=High Priority` selector [`src/index.ts`]
991
- - `getDefaultConfig(...)`: restore default config on reset [`src/core/config.ts`]
989
+ - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory in documented menu order [`src/index.ts`]
990
+ - `buildPiUsereqToolToggleChoices(...)`: serialize per-tool startup-toggle rows plus terminal reset/save actions [`src/index.ts`]
991
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows to the selector menu [`src/index.ts`]
992
+ - `configureDebugMenu(...)`: interactive debug editor for global enablement, log path, status-change logging, dedicated workflow-event logging, workflow filters, reset confirmation, and per-tool plus per-prompt toggles [`src/index.ts`]
993
+ - `buildDebugMenuChoices(...)`: serialize global debug controls, workflow-event toggles, canonical tool and prompt toggles, and terminal rows [`src/index.ts`]
994
+ - `buildDebugMenuChoice(...)`: dim and disable locked debug rows while global debug is off [`src/index.ts`]
995
+ - `getDebugToolToggleNames(...)`: enumerate debuggable tool names in canonical grouped order [`src/index.ts`]
996
+ - `selectDebugLogOnStatus(...)`: select one explicit workflow-state filter or `any` [`src/index.ts`]
997
+ - `confirmResetChanges(...)`: require explicit approval before applying reset mutations [`src/index.ts`]
998
+ - `resetDebugConfigToDefaults(...)`: restore the debug configuration subtree to documented defaults [`src/index.ts`]
999
+ - `configurePiNotifyMenu(...)`: interactive notify, sound, and Pushover editor with credential-locked enablement, immediate-save mutations, reset confirmation, and dedicated event submenus [`src/index.ts`]
1000
+ - `buildPiNotifyMenuChoices(...)`: serialize command-notify, sound, and Pushover blocks plus shared-event submenu launchers and terminal rows [`src/index.ts`]
1001
+ - `buildPiNotifyEventLauncherChoice(...)`: serialize one event-submenu launcher row with a compact enabled-toggle summary [`src/index.ts`]
1002
+ - `buildPiNotifyPushoverRows(...)`: serialize direct Pushover rows with locked enablement plus the shared event-submenu launcher [`src/index.ts`]
1003
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows [`src/index.ts`]
1004
+ - `configurePiNotifyEventMenu(...)`: interactive completed/interrupted/failed event editor for one notification transport [`src/index.ts`]
1005
+ - `buildPiNotifyEventMenuChoices(...)`: serialize shared event rows plus submenu reset/save actions [`src/index.ts`]
1006
+ - `resetPiNotifyEventMenuToDefaults(...)`: restore default event toggles for one notification transport [`src/index.ts`]
1007
+ - `resolvePiNotifyEventLabel(...)`: map one event-toggle key to the human-readable menu label [`src/index.ts`]
1008
+ - `togglePiNotifyFlag(...)`: toggle one persisted boolean notification setting [`src/index.ts`]
1009
+ - `togglePiNotifyFlag(...)`: toggle one persisted boolean notification setting [`src/index.ts`]
1010
+ - `selectPiNotifySoundLevel(...)`: present the `Enable sound` selector with subtree-local reset/save actions [`src/index.ts`]
1011
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows to the selector menu [`src/index.ts`]
1012
+ - `selectPiNotifyPushoverPriority(...)`: present the `Normal|High` priority selector with subtree-local reset/save actions [`src/index.ts`]
1013
+ - `buildTerminalSettingsMenuChoices(...)`: append canonical terminal rows to the selector menu [`src/index.ts`]
1014
+ - `resetPiNotifyConfigToDefaults(...)`: restore notification settings to documented defaults [`src/index.ts`]
1015
+ - `getDefaultConfig(...)`: restore default config on reset and subtree-local selector resets [`src/core/config.ts`]
992
1016
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
993
1017
  - `applyConfiguredPiUsereqTools(...)`: re-apply active tools after reset [`src/index.ts`]
994
1018
  - `getConfiguredEnabledPiUsereqTools(...)`: canonicalize configured enabled tools [`src/index.ts`]
995
1019
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize configurable active tools [`src/core/pi-usereq-tools.ts`]
996
- - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory [`src/index.ts`]
1020
+ - `getPiUsereqStartupTools(...)`: enumerate configurable tools from runtime inventory in documented menu order [`src/index.ts`]
997
1021
  - External Boundaries:
998
1022
  - pi ExtensionAPI plus command-context APIs for command registration, tool registration, shortcut registration, user-message delivery, session events, active-tool mutation, editor updates, notifications, selections, and text input.
999
1023
  - Filesystem access for home resource cache, bundled prompt reads, and project config persistence.