@code-yeongyu/senpi 2026.8.1 → 2026.8.3-3

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 (1053) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +10 -0
  3. package/dist/cli/args.d.ts +2 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +28 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/credential-print.d.ts +23 -0
  8. package/dist/cli/credential-print.d.ts.map +1 -0
  9. package/dist/cli/credential-print.js +116 -0
  10. package/dist/cli/credential-print.js.map +1 -0
  11. package/dist/client/index.d.ts +3 -0
  12. package/dist/client/index.d.ts.map +1 -0
  13. package/dist/client/index.js +3 -0
  14. package/dist/client/index.js.map +1 -0
  15. package/dist/client/remote-session.d.ts +53 -0
  16. package/dist/client/remote-session.d.ts.map +1 -0
  17. package/dist/client/remote-session.js +340 -0
  18. package/dist/client/remote-session.js.map +1 -0
  19. package/dist/client/transcript.d.ts +12 -0
  20. package/dist/client/transcript.d.ts.map +1 -0
  21. package/dist/client/transcript.js +98 -0
  22. package/dist/client/transcript.js.map +1 -0
  23. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  24. package/dist/core/agent-session-runtime.js +3 -0
  25. package/dist/core/agent-session-runtime.js.map +1 -1
  26. package/dist/core/agent-session.d.ts +40 -1
  27. package/dist/core/agent-session.d.ts.map +1 -1
  28. package/dist/core/agent-session.js +434 -53
  29. package/dist/core/agent-session.js.map +1 -1
  30. package/dist/core/auth-storage.d.ts +5 -0
  31. package/dist/core/auth-storage.d.ts.map +1 -1
  32. package/dist/core/auth-storage.js +72 -11
  33. package/dist/core/auth-storage.js.map +1 -1
  34. package/dist/core/dynamic-prompt/verification.d.ts +2 -2
  35. package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
  36. package/dist/core/dynamic-prompt/verification.js +2 -2
  37. package/dist/core/dynamic-prompt/verification.js.map +1 -1
  38. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts +17 -0
  39. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -0
  40. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js +56 -0
  41. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js.map +1 -0
  42. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts +1 -0
  43. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -1
  44. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.js.map +1 -1
  45. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +32 -0
  46. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -0
  47. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +43 -0
  48. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -0
  49. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts +18 -0
  50. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -0
  51. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js +46 -0
  52. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +1 -0
  53. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +81 -0
  54. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -0
  55. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +127 -0
  56. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -0
  57. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts +10 -0
  58. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts.map +1 -0
  59. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js +34 -0
  60. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js.map +1 -0
  61. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +56 -0
  62. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -0
  63. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +174 -0
  64. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -0
  65. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts +24 -0
  66. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -0
  67. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js +34 -0
  68. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js.map +1 -0
  69. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +34 -0
  70. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -0
  71. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +85 -0
  72. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -0
  73. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts +2 -13
  74. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -1
  75. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js +34 -55
  76. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -1
  77. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -1
  78. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +35 -93
  79. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -1
  80. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +13 -11
  81. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
  82. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +44 -55
  83. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
  84. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts +3 -1
  85. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -1
  86. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +101 -126
  87. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
  88. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts +2 -31
  89. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -1
  90. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +26 -98
  91. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
  92. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts +14 -0
  93. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts.map +1 -0
  94. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js +42 -0
  95. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js.map +1 -0
  96. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts +32 -0
  97. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -0
  98. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js +8 -0
  99. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js.map +1 -0
  100. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts +16 -0
  101. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts.map +1 -0
  102. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js +92 -0
  103. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js.map +1 -0
  104. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
  105. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +48 -88
  106. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
  107. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts +1 -0
  108. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
  109. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js +1 -0
  110. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -1
  111. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts +18 -1
  112. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
  113. package/dist/core/extensions/builtin/compaction/checkpoint-state.js +32 -0
  114. package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
  115. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +1 -1
  116. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
  117. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +4 -0
  118. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
  119. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +21 -0
  120. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -0
  121. package/dist/core/extensions/builtin/compaction/idle-retry.js +24 -0
  122. package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -0
  123. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/compaction/index.js +91 -13
  125. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  126. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +71 -0
  127. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts.map +1 -0
  128. package/dist/core/extensions/builtin/compaction/lane-policy.js +94 -0
  129. package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -0
  130. package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
  131. package/dist/core/extensions/builtin/compaction/log.js +1 -0
  132. package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
  133. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts +59 -0
  134. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -0
  135. package/dist/core/extensions/builtin/compaction/overflow-retry.js +155 -0
  136. package/dist/core/extensions/builtin/compaction/overflow-retry.js.map +1 -0
  137. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  138. package/dist/core/extensions/builtin/compaction/speculative.js +17 -98
  139. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  140. package/dist/core/extensions/builtin/compaction/transient-failure.d.ts.map +1 -1
  141. package/dist/core/extensions/builtin/compaction/transient-failure.js +3 -0
  142. package/dist/core/extensions/builtin/compaction/transient-failure.js.map +1 -1
  143. package/dist/core/extensions/builtin/goal/continuation.d.ts +2 -1
  144. package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
  145. package/dist/core/extensions/builtin/goal/continuation.js +2 -1
  146. package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
  147. package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
  148. package/dist/core/extensions/builtin/goal/index.js +14 -1
  149. package/dist/core/extensions/builtin/goal/index.js.map +1 -1
  150. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +3 -2
  151. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  152. package/dist/core/extensions/builtin/goal/monitor-continuation.js +89 -46
  153. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  154. package/dist/core/extensions/builtin/goal/wait-progress.d.ts +11 -0
  155. package/dist/core/extensions/builtin/goal/wait-progress.d.ts.map +1 -0
  156. package/dist/core/extensions/builtin/goal/wait-progress.js +30 -0
  157. package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -0
  158. package/dist/core/extensions/builtin/goal/wait-ticker.d.ts +38 -0
  159. package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -0
  160. package/dist/core/extensions/builtin/goal/wait-ticker.js +71 -0
  161. package/dist/core/extensions/builtin/goal/wait-ticker.js.map +1 -0
  162. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts +1 -0
  163. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
  164. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js +13 -1
  165. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  166. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +1 -1
  167. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
  168. package/dist/core/extensions/builtin/gpt-apply-patch/index.js +1 -1
  169. package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
  170. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -0
  171. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
  172. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +23 -5
  173. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  174. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
  175. package/dist/core/extensions/builtin/loop-guard/detectors.js +42 -1
  176. package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -1
  177. package/dist/core/extensions/builtin/mcp/health.d.ts.map +1 -1
  178. package/dist/core/extensions/builtin/mcp/health.js +2 -1
  179. package/dist/core/extensions/builtin/mcp/health.js.map +1 -1
  180. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -1
  181. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  182. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +5 -3
  183. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  184. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
  185. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +8 -1
  186. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  187. package/dist/core/extensions/builtin/rules/config.d.ts +3 -0
  188. package/dist/core/extensions/builtin/rules/config.d.ts.map +1 -0
  189. package/dist/core/extensions/builtin/rules/config.js +24 -0
  190. package/dist/core/extensions/builtin/rules/config.js.map +1 -0
  191. package/dist/core/extensions/builtin/rules/index.d.ts.map +1 -1
  192. package/dist/core/extensions/builtin/rules/index.js +5 -3
  193. package/dist/core/extensions/builtin/rules/index.js.map +1 -1
  194. package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -1
  195. package/dist/core/extensions/builtin/rules/rules/formatter.js +21 -5
  196. package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -1
  197. package/dist/core/extensions/builtin/rules/rules/types.d.ts +1 -1
  198. package/dist/core/extensions/builtin/rules/rules/types.js.map +1 -1
  199. package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
  200. package/dist/core/extensions/builtin/service-tier.js +2 -3
  201. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  202. package/dist/core/extensions/builtin/terminal/tools/context.d.ts +1 -1
  203. package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
  204. package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
  205. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
  206. package/dist/core/extensions/builtin/terminal/tools/monitor.js +1 -0
  207. package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
  208. package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
  209. package/dist/core/extensions/builtin/tool-pair-guard/index.js +1 -1
  210. package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
  211. package/dist/core/extensions/index.d.ts +1 -1
  212. package/dist/core/extensions/index.d.ts.map +1 -1
  213. package/dist/core/extensions/index.js.map +1 -1
  214. package/dist/core/extensions/loader.d.ts.map +1 -1
  215. package/dist/core/extensions/loader.js +14 -18
  216. package/dist/core/extensions/loader.js.map +1 -1
  217. package/dist/core/extensions/runner.d.ts +4 -1
  218. package/dist/core/extensions/runner.d.ts.map +1 -1
  219. package/dist/core/extensions/runner.js +18 -0
  220. package/dist/core/extensions/runner.js.map +1 -1
  221. package/dist/core/extensions/types.d.ts +16 -1
  222. package/dist/core/extensions/types.d.ts.map +1 -1
  223. package/dist/core/extensions/types.js.map +1 -1
  224. package/dist/core/footer-data-provider.d.ts +10 -0
  225. package/dist/core/footer-data-provider.d.ts.map +1 -1
  226. package/dist/core/footer-data-provider.js +1 -1
  227. package/dist/core/footer-data-provider.js.map +1 -1
  228. package/dist/core/keybindings.d.ts +24 -0
  229. package/dist/core/keybindings.d.ts.map +1 -1
  230. package/dist/core/model-registry.d.ts +2 -1
  231. package/dist/core/model-registry.d.ts.map +1 -1
  232. package/dist/core/model-registry.js +3 -0
  233. package/dist/core/model-registry.js.map +1 -1
  234. package/dist/core/model-resolver.d.ts.map +1 -1
  235. package/dist/core/model-resolver.js +1 -0
  236. package/dist/core/model-resolver.js.map +1 -1
  237. package/dist/core/model-runtime.d.ts +2 -0
  238. package/dist/core/model-runtime.d.ts.map +1 -1
  239. package/dist/core/model-runtime.js +2 -2
  240. package/dist/core/model-runtime.js.map +1 -1
  241. package/dist/core/package-manager.d.ts +0 -1
  242. package/dist/core/package-manager.d.ts.map +1 -1
  243. package/dist/core/package-manager.js +18 -34
  244. package/dist/core/package-manager.js.map +1 -1
  245. package/dist/core/pi-manifest.d.ts +9 -0
  246. package/dist/core/pi-manifest.d.ts.map +1 -0
  247. package/dist/core/pi-manifest.js +25 -0
  248. package/dist/core/pi-manifest.js.map +1 -0
  249. package/dist/core/provider-composer.d.ts.map +1 -1
  250. package/dist/core/provider-composer.js +8 -3
  251. package/dist/core/provider-composer.js.map +1 -1
  252. package/dist/core/provider-display-names.d.ts.map +1 -1
  253. package/dist/core/provider-display-names.js +1 -0
  254. package/dist/core/provider-display-names.js.map +1 -1
  255. package/dist/core/resource-loader.d.ts +15 -0
  256. package/dist/core/resource-loader.d.ts.map +1 -1
  257. package/dist/core/resource-loader.js +55 -6
  258. package/dist/core/resource-loader.js.map +1 -1
  259. package/dist/core/retry-fallback/hint-policy.d.ts +29 -0
  260. package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -0
  261. package/dist/core/retry-fallback/hint-policy.js +54 -0
  262. package/dist/core/retry-fallback/hint-policy.js.map +1 -0
  263. package/dist/core/retry-fallback/probe-scheduler.d.ts +60 -0
  264. package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -0
  265. package/dist/core/retry-fallback/probe-scheduler.js +206 -0
  266. package/dist/core/retry-fallback/probe-scheduler.js.map +1 -0
  267. package/dist/core/retry-fallback/settings.d.ts +9 -0
  268. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  269. package/dist/core/retry-fallback/settings.js +14 -0
  270. package/dist/core/retry-fallback/settings.js.map +1 -1
  271. package/dist/core/session-log.js +1 -1
  272. package/dist/core/session-log.js.map +1 -1
  273. package/dist/core/settings-manager.d.ts +10 -1
  274. package/dist/core/settings-manager.d.ts.map +1 -1
  275. package/dist/core/settings-manager.js +21 -1
  276. package/dist/core/settings-manager.js.map +1 -1
  277. package/dist/extensions/llama/provider.js +1 -1
  278. package/dist/extensions/llama/provider.js.map +1 -1
  279. package/dist/index.d.ts +2 -2
  280. package/dist/index.d.ts.map +1 -1
  281. package/dist/index.js.map +1 -1
  282. package/dist/main.d.ts.map +1 -1
  283. package/dist/main.js +44 -0
  284. package/dist/main.js.map +1 -1
  285. package/dist/modes/interactive/components/assistant-message.d.ts +5 -2
  286. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  287. package/dist/modes/interactive/components/assistant-message.js +16 -4
  288. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  289. package/dist/modes/interactive/components/continuity-notice.d.ts +21 -0
  290. package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -0
  291. package/dist/modes/interactive/components/continuity-notice.js +58 -0
  292. package/dist/modes/interactive/components/continuity-notice.js.map +1 -0
  293. package/dist/modes/interactive/components/custom-editor.d.ts +5 -0
  294. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  295. package/dist/modes/interactive/components/custom-editor.js +22 -1
  296. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  297. package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
  298. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  299. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  300. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  301. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  302. package/dist/modes/interactive/components/model-selector.js +4 -1
  303. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  304. package/dist/modes/interactive/components/settings-selector.d.ts +6 -2
  305. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  306. package/dist/modes/interactive/components/settings-selector.js +20 -0
  307. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  308. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  309. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  310. package/dist/modes/interactive/components/user-message.js +8 -2
  311. package/dist/modes/interactive/components/user-message.js.map +1 -1
  312. package/dist/modes/interactive/help-content.d.ts.map +1 -1
  313. package/dist/modes/interactive/help-content.js +1 -0
  314. package/dist/modes/interactive/help-content.js.map +1 -1
  315. package/dist/modes/interactive/interactive-mode.d.ts +21 -0
  316. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  317. package/dist/modes/interactive/interactive-mode.js +151 -50
  318. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  319. package/dist/modes/interactive/theme/dark.json +1 -0
  320. package/dist/modes/interactive/theme/grok-day.json +1 -0
  321. package/dist/modes/interactive/theme/grok-night.json +1 -0
  322. package/dist/modes/interactive/theme/light.json +1 -0
  323. package/dist/modes/interactive/theme/theme-schema.json +5 -1
  324. package/dist/modes/interactive/theme/theme.d.ts +2 -2
  325. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  326. package/dist/modes/interactive/theme/theme.js +13 -3
  327. package/dist/modes/interactive/theme/theme.js.map +1 -1
  328. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  329. package/dist/modes/rpc/connection-handler.js +13 -0
  330. package/dist/modes/rpc/connection-handler.js.map +1 -1
  331. package/dist/utils/clipboard.d.ts +1 -1
  332. package/dist/utils/clipboard.d.ts.map +1 -1
  333. package/dist/utils/clipboard.js +22 -2
  334. package/dist/utils/clipboard.js.map +1 -1
  335. package/docs/AGENTS.md +1 -6
  336. package/docs/custom-provider.md +10 -3
  337. package/docs/development.md +1 -2
  338. package/docs/extensions.md +24 -1
  339. package/docs/keybindings.md +13 -0
  340. package/docs/mcp.md +63 -4
  341. package/docs/models.md +1 -0
  342. package/docs/providers.md +39 -0
  343. package/docs/release-guide.md +5 -3
  344. package/docs/session-format.md +2 -0
  345. package/docs/settings.md +2 -0
  346. package/docs/skills.md +29 -0
  347. package/docs/themes.md +5 -3
  348. package/docs/usage.md +5 -0
  349. package/examples/extensions/custom-compaction.ts +1 -2
  350. package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
  351. package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
  352. package/examples/extensions/handoff.ts +2 -3
  353. package/examples/extensions/qna.ts +2 -2
  354. package/examples/rpc-extension-ui.ts +11 -2
  355. package/examples/sdk/02-custom-model.ts +1 -2
  356. package/examples/sdk/12-full-control.ts +2 -0
  357. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +36 -0
  358. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  359. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +14 -3
  360. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  361. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +156 -67
  362. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  363. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts +3 -0
  364. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts.map +1 -0
  365. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js +70 -0
  366. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js.map +1 -0
  367. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +4 -0
  368. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
  369. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +22 -0
  370. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
  371. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts +13 -0
  372. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts.map +1 -0
  373. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js +304 -0
  374. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js.map +1 -0
  375. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts +17 -0
  376. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts.map +1 -0
  377. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js +60 -0
  378. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js.map +1 -0
  379. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts +6 -0
  380. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts.map +1 -0
  381. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js +107 -0
  382. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js.map +1 -0
  383. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts +28 -0
  384. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts.map +1 -0
  385. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js +61 -0
  386. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js.map +1 -0
  387. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts +8 -0
  388. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts.map +1 -0
  389. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js +22 -0
  390. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js.map +1 -0
  391. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -10
  392. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  393. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +154 -77
  394. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  395. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +49 -23
  396. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  397. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  398. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +6 -6
  399. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  400. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -6
  401. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  402. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
  403. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  404. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  405. package/node_modules/@earendil-works/pi-ai/README.md +5 -2
  406. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  407. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +46 -10
  408. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  409. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts +3 -0
  410. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts.map +1 -0
  411. package/{dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js → node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js} +3 -3
  412. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js.map +1 -0
  413. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  414. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +5 -1
  415. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  416. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  417. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +64 -4
  418. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  419. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  420. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +12 -2
  421. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  422. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
  423. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -6
  424. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  425. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  426. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
  427. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  428. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  429. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +19 -10
  430. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  431. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  432. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +84 -47
  433. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  434. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  435. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +18 -9
  436. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  437. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  438. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -1
  439. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  440. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  441. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +7 -3
  442. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  443. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +3 -2
  444. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
  445. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
  446. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  447. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  448. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
  449. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  450. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts +3 -1
  451. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts.map +1 -1
  452. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +81 -26
  453. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js.map +1 -1
  454. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
  455. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  456. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +16 -8
  457. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  458. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  459. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
  460. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  461. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  462. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  463. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  464. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  465. package/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
  466. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  467. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +2 -1
  468. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
  469. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +3 -1
  470. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  471. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  472. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  473. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  474. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  475. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  476. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  477. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  478. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  479. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  480. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  481. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  482. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  483. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  484. package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  485. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  486. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  487. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  488. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  489. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +4 -1
  490. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  491. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts +9 -0
  492. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts.map +1 -0
  493. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js +142 -0
  494. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js.map +1 -0
  495. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +1 -1
  496. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  497. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -2
  498. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  499. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  500. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
  501. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +23 -4
  502. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
  503. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  504. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +10 -1
  505. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  506. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +3 -0
  507. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  508. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +13 -12
  509. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  510. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts +24 -0
  511. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts.map +1 -0
  512. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js +233 -0
  513. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js.map +1 -0
  514. package/node_modules/@earendil-works/pi-ai/package.json +10 -6
  515. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  516. package/node_modules/@earendil-works/pi-tui/README.md +77 -14
  517. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts +83 -0
  518. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts.map +1 -0
  519. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js +687 -0
  520. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js.map +1 -0
  521. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts +5 -0
  522. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts.map +1 -0
  523. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js +5 -0
  524. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js.map +1 -0
  525. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts +13 -0
  526. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -0
  527. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js +36 -0
  528. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js.map +1 -0
  529. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  530. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
  531. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  532. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +7 -0
  533. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -0
  534. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js +43 -0
  535. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -0
  536. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  537. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +4 -4
  538. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  539. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
  540. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  541. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -2
  542. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  543. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +51 -0
  544. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -0
  545. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +163 -0
  546. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -0
  547. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  548. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +3 -6
  549. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  550. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +32 -0
  551. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -0
  552. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js +109 -0
  553. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -0
  554. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +8 -0
  555. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -0
  556. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js +21 -0
  557. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -0
  558. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +10 -4
  559. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  560. package/node_modules/@earendil-works/pi-tui/dist/index.js +10 -4
  561. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  562. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +30 -0
  563. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  564. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +18 -0
  565. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  566. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +40 -0
  567. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts.map +1 -0
  568. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js +6 -0
  569. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js.map +1 -0
  570. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +40 -0
  571. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -0
  572. package/node_modules/@earendil-works/pi-tui/dist/layout.js +315 -0
  573. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -0
  574. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.d.ts.map +1 -1
  575. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js +36 -8
  576. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js.map +1 -1
  577. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +10 -0
  578. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  579. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +61 -3
  580. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  581. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +1 -0
  582. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -1
  583. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +12 -2
  584. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -1
  585. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +38 -16
  586. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  587. package/node_modules/@earendil-works/pi-tui/dist/tui.js +121 -51
  588. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  589. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +10 -0
  590. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  591. package/node_modules/@earendil-works/pi-tui/dist/utils.js +95 -4
  592. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  593. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  594. package/node_modules/typebox/build/compile/validator.d.mts +3 -11
  595. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  596. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  597. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  598. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  599. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  600. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  601. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  602. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  603. package/node_modules/typebox/build/guard/guard.d.mts +5 -9
  604. package/node_modules/typebox/build/guard/guard.mjs +10 -15
  605. package/node_modules/typebox/build/guard/string.mjs +16 -4
  606. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  607. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  608. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  609. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  610. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  611. package/node_modules/typebox/build/schema/engine/schema.mjs +6 -11
  612. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  613. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  614. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  615. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  616. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  617. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  618. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  619. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  620. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  621. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  622. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  623. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  624. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  625. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  626. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  627. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  628. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  629. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  630. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  631. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  632. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  633. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  634. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  635. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  636. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  637. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  638. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  639. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  640. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  641. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  642. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  643. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  644. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  645. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  646. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  647. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  648. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  649. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  650. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  651. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  652. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  653. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  654. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  655. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  656. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  657. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  658. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  659. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  660. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  661. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  662. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  663. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  664. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  665. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  666. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  667. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  668. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  669. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  670. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  671. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  672. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  673. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  674. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  675. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  676. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  677. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  678. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  679. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  680. package/node_modules/typebox/build/type/action/readonly_object.mjs +3 -0
  681. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  682. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  683. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  684. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  685. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  686. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  687. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  688. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  689. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  690. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  691. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  692. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  693. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  694. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  695. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  696. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  697. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  698. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  699. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  700. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  701. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  702. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  703. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  704. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  705. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  706. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  707. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  708. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  709. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  710. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  711. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  712. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  713. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  714. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  715. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  716. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  717. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  718. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  719. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  720. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  721. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  722. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  723. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  724. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  725. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  726. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  727. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  728. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  729. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  730. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  731. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  732. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  733. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  734. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  735. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  736. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  737. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  738. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  739. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  740. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  741. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  742. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  743. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  744. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  745. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  746. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  747. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  748. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  749. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  750. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  751. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  752. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  753. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  754. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  755. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  756. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  757. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  758. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  759. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  760. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  761. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  762. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  763. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  764. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  765. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  766. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  767. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  768. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  769. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  770. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  771. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  772. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  773. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  774. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  775. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  776. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  777. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  778. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  779. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  780. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  781. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  782. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  783. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  784. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  785. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  786. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  787. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  788. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  789. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  790. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  791. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  792. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  793. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  794. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  795. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  796. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  797. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  798. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  799. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  800. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  801. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  802. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  803. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  804. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  805. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  806. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  807. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  808. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  809. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  810. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  811. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  812. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  813. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  814. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  815. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  816. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  817. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  818. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  819. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  820. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  821. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  822. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  823. package/node_modules/typebox/build/type/script/mapping.d.mts +86 -98
  824. package/node_modules/typebox/build/type/script/mapping.mjs +95 -92
  825. package/node_modules/typebox/build/type/script/parser.d.mts +42 -40
  826. package/node_modules/typebox/build/type/script/parser.mjs +23 -22
  827. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  828. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  829. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  830. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  831. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  832. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  833. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  834. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  835. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  836. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  837. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  838. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  839. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  840. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  841. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  842. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  843. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  844. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  845. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  846. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  847. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  848. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  849. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  850. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  851. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  852. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  853. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  854. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  855. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  856. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  857. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  858. package/node_modules/typebox/build/typebox.d.mts +3 -7
  859. package/node_modules/typebox/build/typebox.mjs +3 -7
  860. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  861. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  862. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  863. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  864. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  865. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  866. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  867. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  868. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  869. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  870. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  871. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  872. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  873. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  874. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  875. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  876. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  877. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  878. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  879. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  880. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  881. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  882. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  883. package/node_modules/typebox/build/value/index.d.mts +0 -1
  884. package/node_modules/typebox/build/value/index.mjs +0 -1
  885. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  886. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  887. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  888. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  889. package/node_modules/typebox/build/value/value.d.mts +0 -1
  890. package/node_modules/typebox/build/value/value.mjs +0 -1
  891. package/node_modules/typebox/package.json +33 -33
  892. package/node_modules/typebox/readme.md +117 -103
  893. package/package.json +16 -11
  894. package/vendor/pi-client/client.d.ts +25 -0
  895. package/vendor/pi-client/client.d.ts.map +1 -0
  896. package/vendor/pi-client/client.js +386 -0
  897. package/vendor/pi-client/client.js.map +1 -0
  898. package/vendor/pi-client/connection.d.ts +25 -0
  899. package/vendor/pi-client/connection.d.ts.map +1 -0
  900. package/vendor/pi-client/connection.js +204 -0
  901. package/vendor/pi-client/connection.js.map +1 -0
  902. package/vendor/pi-client/errors.d.ts +23 -0
  903. package/vendor/pi-client/errors.d.ts.map +1 -0
  904. package/vendor/pi-client/errors.js +42 -0
  905. package/vendor/pi-client/errors.js.map +1 -0
  906. package/vendor/pi-client/index.d.ts +6 -0
  907. package/vendor/pi-client/index.d.ts.map +1 -0
  908. package/vendor/pi-client/index.js +3 -0
  909. package/vendor/pi-client/index.js.map +1 -0
  910. package/vendor/pi-client/promise.d.ts +8 -0
  911. package/vendor/pi-client/promise.d.ts.map +1 -0
  912. package/vendor/pi-client/promise.js +11 -0
  913. package/vendor/pi-client/promise.js.map +1 -0
  914. package/vendor/pi-client/session-handle.d.ts +54 -0
  915. package/vendor/pi-client/session-handle.d.ts.map +1 -0
  916. package/vendor/pi-client/session-handle.js +50 -0
  917. package/vendor/pi-client/session-handle.js.map +1 -0
  918. package/vendor/pi-client/state.d.ts +22 -0
  919. package/vendor/pi-client/state.d.ts.map +1 -0
  920. package/vendor/pi-client/state.js +149 -0
  921. package/vendor/pi-client/state.js.map +1 -0
  922. package/vendor/pi-client/transport.d.ts +17 -0
  923. package/vendor/pi-client/transport.d.ts.map +1 -0
  924. package/vendor/pi-client/transport.js +2 -0
  925. package/vendor/pi-client/transport.js.map +1 -0
  926. package/vendor/pi-client/types.d.ts +23 -0
  927. package/vendor/pi-client/types.d.ts.map +1 -0
  928. package/vendor/pi-client/types.js +2 -0
  929. package/vendor/pi-client/types.js.map +1 -0
  930. package/vendor/pi-client/unix.d.ts +8 -0
  931. package/vendor/pi-client/unix.d.ts.map +1 -0
  932. package/vendor/pi-client/unix.js +151 -0
  933. package/vendor/pi-client/unix.js.map +1 -0
  934. package/vendor/pi-protocol/cbor/decoder.d.ts +4 -0
  935. package/vendor/pi-protocol/cbor/decoder.d.ts.map +1 -0
  936. package/vendor/pi-protocol/cbor/decoder.js +163 -0
  937. package/vendor/pi-protocol/cbor/decoder.js.map +1 -0
  938. package/vendor/pi-protocol/cbor/encoder.d.ts +4 -0
  939. package/vendor/pi-protocol/cbor/encoder.d.ts.map +1 -0
  940. package/vendor/pi-protocol/cbor/encoder.js +199 -0
  941. package/vendor/pi-protocol/cbor/encoder.js.map +1 -0
  942. package/vendor/pi-protocol/cbor/index.d.ts +4 -0
  943. package/vendor/pi-protocol/cbor/index.d.ts.map +1 -0
  944. package/vendor/pi-protocol/cbor/index.js +4 -0
  945. package/vendor/pi-protocol/cbor/index.js.map +1 -0
  946. package/vendor/pi-protocol/cbor/options.d.ts +26 -0
  947. package/vendor/pi-protocol/cbor/options.d.ts.map +1 -0
  948. package/vendor/pi-protocol/cbor/options.js +29 -0
  949. package/vendor/pi-protocol/cbor/options.js.map +1 -0
  950. package/vendor/pi-protocol/codec.d.ts +29 -0
  951. package/vendor/pi-protocol/codec.d.ts.map +1 -0
  952. package/vendor/pi-protocol/codec.js +140 -0
  953. package/vendor/pi-protocol/codec.js.map +1 -0
  954. package/vendor/pi-protocol/framing.d.ts +29 -0
  955. package/vendor/pi-protocol/framing.d.ts.map +1 -0
  956. package/vendor/pi-protocol/framing.js +152 -0
  957. package/vendor/pi-protocol/framing.js.map +1 -0
  958. package/vendor/pi-protocol/index.d.ts +5 -0
  959. package/vendor/pi-protocol/index.d.ts.map +1 -0
  960. package/vendor/pi-protocol/index.js +5 -0
  961. package/vendor/pi-protocol/index.js.map +1 -0
  962. package/vendor/pi-protocol/schemas.d.ts +13818 -0
  963. package/vendor/pi-protocol/schemas.d.ts.map +1 -0
  964. package/vendor/pi-protocol/schemas.js +382 -0
  965. package/vendor/pi-protocol/schemas.js.map +1 -0
  966. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts +0 -3
  967. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +0 -1
  968. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +0 -1
  969. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
  970. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
  971. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -100
  972. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
  973. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -42
  974. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
  975. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -286
  976. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
  977. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
  978. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
  979. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -44
  980. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +0 -1
  981. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +0 -33
  982. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
  983. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -163
  984. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +0 -1
  985. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
  986. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
  987. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -39
  988. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +0 -1
  989. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  990. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  991. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  992. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  993. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  994. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  995. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  996. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  997. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  998. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  999. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  1000. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  1001. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  1002. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  1003. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  1004. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  1005. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  1006. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  1007. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  1008. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  1009. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  1010. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  1011. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  1012. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  1013. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  1014. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  1015. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  1016. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  1017. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  1018. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  1019. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  1020. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  1021. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  1022. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  1023. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  1024. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  1025. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  1026. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  1027. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  1028. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  1029. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  1030. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  1031. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  1032. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  1033. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  1034. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  1035. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  1036. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  1037. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  1038. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  1039. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  1040. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  1041. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  1042. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  1043. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  1044. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  1045. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  1046. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  1047. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  1048. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  1049. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  1050. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  1051. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  1052. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  1053. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Strict 429 retry-hint extractor with canonical marker helpers.
3
+ *
4
+ * Precedence (first match wins, malformed source falls through):
5
+ * 1. retry-after-ms header (strict `^\d+(?:\.\d+)?$`, ceil)
6
+ * 2. retry-after header (strict integer delta-seconds `^\d+$`, else HTTP-date)
7
+ * 3. x-ratelimit-reset{,-requests,-tokens} (epoch seconds, max-wins)
8
+ * 4. JSON retryDelay strings (ms/s/m units, recursive, max-wins; numeric rejected)
9
+ * 5. body prose (ms-marker, seconds-marker, relative, resets-at ISO8601)
10
+ *
11
+ * Eligibility gate: status 429 OR body marks rate-limit error.
12
+ * Explicit zero = 0 (beats lower-precedence positives).
13
+ * Past absolute times clamp to 0.
14
+ * Absolute times resolve against response Date header (clock-skew safe), else nowMs.
15
+ */
16
+ export interface RetryHintInput {
17
+ status?: number;
18
+ headers?: Headers;
19
+ bodyText: string;
20
+ }
21
+ export declare function extract429RetryAfterMs(input: RetryHintInput, nowMs?: number): number | undefined;
22
+ export declare function appendRetryAfterMsMarker(message: string, hintMs: number): string;
23
+ export declare function parseRetryAfterMsMarker(message: string): number | undefined;
24
+ //# sourceMappingURL=retry-hint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry-hint.d.ts","sourceRoot":"","sources":["../../src/utils/retry-hint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACjB;AA+KD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAuBhG;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI3E"}
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Strict 429 retry-hint extractor with canonical marker helpers.
3
+ *
4
+ * Precedence (first match wins, malformed source falls through):
5
+ * 1. retry-after-ms header (strict `^\d+(?:\.\d+)?$`, ceil)
6
+ * 2. retry-after header (strict integer delta-seconds `^\d+$`, else HTTP-date)
7
+ * 3. x-ratelimit-reset{,-requests,-tokens} (epoch seconds, max-wins)
8
+ * 4. JSON retryDelay strings (ms/s/m units, recursive, max-wins; numeric rejected)
9
+ * 5. body prose (ms-marker, seconds-marker, relative, resets-at ISO8601)
10
+ *
11
+ * Eligibility gate: status 429 OR body marks rate-limit error.
12
+ * Explicit zero = 0 (beats lower-precedence positives).
13
+ * Past absolute times clamp to 0.
14
+ * Absolute times resolve against response Date header (clock-skew safe), else nowMs.
15
+ */
16
+ const MARKER_RE = /\(retry-after-ms: (\d+)\)$/;
17
+ const RATE_LIMIT_BODY_RE = /\b(rate_limit_error|rate_limit_exceeded|too_many_requests|resource_exhausted|rate limit (?:exceeded|hit)|too many requests)\b/i;
18
+ const RATE_LIMIT_JSON_VALUES = new Set([
19
+ "rate_limit_error",
20
+ "rate_limit_exceeded",
21
+ "too_many_requests",
22
+ "resource_exhausted",
23
+ ]);
24
+ const RETRY_AFTER_MS_RE = /^\d+(?:\.\d+)?$/;
25
+ const DELTA_SECONDS_RE = /^\d+$/;
26
+ /* ---------- eligibility ---------- */
27
+ function isRateLimited(status, bodyText) {
28
+ if (status === 429)
29
+ return true;
30
+ if (RATE_LIMIT_BODY_RE.test(bodyText))
31
+ return true;
32
+ // JSON type/code fields or retryDelay presence (rate-limit signal)
33
+ const json = tryParseJSON(bodyText);
34
+ if (json !== undefined) {
35
+ const found = scanValue(json, (v, k) => {
36
+ if (k !== undefined && k.toLowerCase() === "retrydelay" && typeof v === "string")
37
+ return true;
38
+ if (typeof v === "string" && RATE_LIMIT_JSON_VALUES.has(v))
39
+ return true;
40
+ if (v === 429)
41
+ return true;
42
+ return false;
43
+ });
44
+ if (found)
45
+ return true;
46
+ }
47
+ return false;
48
+ }
49
+ /* ---------- 1. retry-after-ms header ---------- */
50
+ function fromRetryAfterMsHeader(h) {
51
+ const raw = h?.get("retry-after-ms");
52
+ if (raw === null || raw === undefined)
53
+ return undefined;
54
+ if (!RETRY_AFTER_MS_RE.test(raw))
55
+ return undefined;
56
+ const val = Number.parseFloat(raw);
57
+ if (!Number.isFinite(val) || val < 0)
58
+ return undefined;
59
+ return Math.ceil(val);
60
+ }
61
+ /* ---------- 2. retry-after header ---------- */
62
+ function fromRetryAfterHeader(h, nowMs) {
63
+ const raw = h?.get("retry-after");
64
+ if (raw === null || raw === undefined)
65
+ return undefined;
66
+ // integer delta-seconds
67
+ if (DELTA_SECONDS_RE.test(raw)) {
68
+ return Number.parseInt(raw, 10) * 1000;
69
+ }
70
+ // HTTP-date — must contain alphabetic chars to be a real date string
71
+ if (/[a-zA-Z]/.test(raw)) {
72
+ const parsed = Date.parse(raw);
73
+ if (!Number.isNaN(parsed)) {
74
+ const base = dateHeaderMs(h) ?? nowMs;
75
+ return clampAbsolute(parsed, base);
76
+ }
77
+ }
78
+ return undefined;
79
+ }
80
+ /* ---------- 3. x-ratelimit-reset* headers ---------- */
81
+ function fromXRateLimitReset(h, nowMs) {
82
+ let best;
83
+ for (const key of ["x-ratelimit-reset", "x-ratelimit-reset-requests", "x-ratelimit-reset-tokens"]) {
84
+ const raw = h?.get(key);
85
+ if (raw === null || raw === undefined)
86
+ continue;
87
+ const epoch = Number.parseFloat(raw);
88
+ if (!Number.isFinite(epoch) || epoch < 0)
89
+ continue;
90
+ // reject "12abc" — strict number check
91
+ if (!/^\d+(?:\.\d+)?$/.test(raw))
92
+ continue;
93
+ const delta = Math.ceil(epoch * 1000 - nowMs);
94
+ const clamped = Math.max(0, delta);
95
+ if (best === undefined || clamped > best)
96
+ best = clamped;
97
+ }
98
+ return best;
99
+ }
100
+ /* ---------- 4. JSON retryDelay (recursive, max-wins) ---------- */
101
+ const RETRY_DELAY_RE = /^(\d+(?:\.\d+)?)\s*(ms|s|m)$/;
102
+ function fromJsonRetryDelay(bodyText) {
103
+ const json = tryParseJSON(bodyText);
104
+ if (json === undefined)
105
+ return undefined;
106
+ let best;
107
+ scanValue(json, (v) => {
108
+ if (typeof v !== "string")
109
+ return false;
110
+ const m = v.match(RETRY_DELAY_RE);
111
+ if (!m)
112
+ return false;
113
+ const num = Number.parseFloat(m[1]);
114
+ const unit = m[2];
115
+ const ms = unit === "ms" ? num : unit === "s" ? num * 1000 : num * 60_000;
116
+ const intMs = Math.ceil(ms);
117
+ if (best === undefined || intMs > best)
118
+ best = intMs;
119
+ return false; // keep scanning
120
+ });
121
+ return best;
122
+ }
123
+ /* ---------- 5. body prose ---------- */
124
+ function fromBodyProse(bodyText, nowMs) {
125
+ // ms-marker: retry-after-ms: <N>
126
+ let m = bodyText.match(/retry-after-ms:\s*(\d+)/i);
127
+ if (m)
128
+ return Number.parseInt(m[1], 10);
129
+ // seconds-marker: retry-after: <N>
130
+ m = bodyText.match(/retry-after:\s*(\d+)/i);
131
+ if (m)
132
+ return Number.parseInt(m[1], 10) * 1000;
133
+ // relative prose: try again | retry | wait after ... [in] N <unit>
134
+ m = bodyText.match(/(?:try again|retry|wait after).*?(?:in\s+)?(\d+(?:\.\d+)?)\s*(ms|s|sec|seconds?|m|min|minutes?)\b/i);
135
+ if (m)
136
+ return convertUnit(Number.parseFloat(m[1]), m[2]);
137
+ // resets at <ISO8601-with-tz>
138
+ m = bodyText.match(/resets?\s+at\s+(\S+)/i);
139
+ if (m) {
140
+ const parsed = Date.parse(m[1]);
141
+ if (!Number.isNaN(parsed))
142
+ return clampAbsolute(parsed, nowMs);
143
+ }
144
+ return undefined;
145
+ }
146
+ /* ---------- helpers ---------- */
147
+ function dateHeaderMs(h) {
148
+ const raw = h?.get("date");
149
+ if (raw === null || raw === undefined)
150
+ return undefined;
151
+ const parsed = Date.parse(raw);
152
+ return Number.isNaN(parsed) ? undefined : parsed;
153
+ }
154
+ function clampAbsolute(targetMs, baseMs) {
155
+ return Math.max(0, targetMs - baseMs);
156
+ }
157
+ function convertUnit(num, unit) {
158
+ const u = unit.toLowerCase();
159
+ if (u === "ms")
160
+ return Math.ceil(num);
161
+ if (u === "s" || u === "sec" || u === "second" || u === "seconds")
162
+ return Math.ceil(num * 1000);
163
+ return Math.ceil(num * 60_000); // m / min / minute / minutes
164
+ }
165
+ /** Recursively walk JSON, calling fn on every leaf value with its key. */
166
+ function scanValue(value, fn, key) {
167
+ if (value === null)
168
+ return fn(null, key);
169
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
170
+ return fn(value, key);
171
+ if (Array.isArray(value)) {
172
+ for (const item of value) {
173
+ if (scanValue(item, fn, key))
174
+ return true;
175
+ }
176
+ return false;
177
+ }
178
+ if (typeof value === "object") {
179
+ for (const [k, v] of Object.entries(value)) {
180
+ if (scanValue(v, fn, k))
181
+ return true;
182
+ }
183
+ return false;
184
+ }
185
+ return false;
186
+ }
187
+ function tryParseJSON(text) {
188
+ // strip SSE data: prefix lines
189
+ const cleaned = text.replace(/^data:\s*/gm, "").trim();
190
+ if (!cleaned.startsWith("{") && !cleaned.startsWith("["))
191
+ return undefined;
192
+ try {
193
+ return JSON.parse(cleaned);
194
+ }
195
+ catch {
196
+ return undefined;
197
+ }
198
+ }
199
+ /* ---------- main extractor ---------- */
200
+ export function extract429RetryAfterMs(input, nowMs) {
201
+ const now = nowMs ?? Date.now();
202
+ if (!isRateLimited(input.status, input.bodyText))
203
+ return undefined;
204
+ // 1. retry-after-ms header
205
+ const fromMs = fromRetryAfterMsHeader(input.headers);
206
+ if (fromMs !== undefined)
207
+ return fromMs;
208
+ // 2. retry-after header
209
+ const fromRa = fromRetryAfterHeader(input.headers, now);
210
+ if (fromRa !== undefined)
211
+ return fromRa;
212
+ // 3. x-ratelimit-reset* headers
213
+ const fromXrl = fromXRateLimitReset(input.headers, now);
214
+ if (fromXrl !== undefined)
215
+ return fromXrl;
216
+ // 4. JSON retryDelay
217
+ const fromJson = fromJsonRetryDelay(input.bodyText);
218
+ if (fromJson !== undefined)
219
+ return fromJson;
220
+ // 5. body prose
221
+ return fromBodyProse(input.bodyText, now);
222
+ }
223
+ /* ---------- marker helpers ---------- */
224
+ export function appendRetryAfterMsMarker(message, hintMs) {
225
+ return `${message} (retry-after-ms: ${hintMs})`;
226
+ }
227
+ export function parseRetryAfterMsMarker(message) {
228
+ const m = message.match(MARKER_RE);
229
+ if (!m)
230
+ return undefined;
231
+ return Number.parseInt(m[1], 10);
232
+ }
233
+ //# sourceMappingURL=retry-hint.js.map
@@ -0,0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,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACtD,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\n * Strict 429 retry-hint extractor with canonical marker helpers.\n *\n * Precedence (first match wins, malformed source falls through):\n * 1. retry-after-ms header (strict `^\\d+(?:\\.\\d+)?$`, ceil)\n * 2. retry-after header (strict integer delta-seconds `^\\d+$`, else HTTP-date)\n * 3. x-ratelimit-reset{,-requests,-tokens} (epoch seconds, max-wins)\n * 4. JSON retryDelay strings (ms/s/m units, recursive, max-wins; numeric rejected)\n * 5. body prose (ms-marker, seconds-marker, relative, resets-at ISO8601)\n *\n * Eligibility gate: status 429 OR body marks rate-limit error.\n * Explicit zero = 0 (beats lower-precedence positives).\n * Past absolute times clamp to 0.\n * Absolute times resolve against response Date header (clock-skew safe), else nowMs.\n */\n\nconst MARKER_RE = /\\(retry-after-ms: (\\d+)\\)$/;\nconst RATE_LIMIT_BODY_RE =\n\t/\\b(rate_limit_error|rate_limit_exceeded|too_many_requests|resource_exhausted|rate limit (?:exceeded|hit)|too many requests)\\b/i;\nconst RATE_LIMIT_JSON_VALUES = new Set([\n\t\"rate_limit_error\",\n\t\"rate_limit_exceeded\",\n\t\"too_many_requests\",\n\t\"resource_exhausted\",\n]);\nconst RETRY_AFTER_MS_RE = /^\\d+(?:\\.\\d+)?$/;\nconst DELTA_SECONDS_RE = /^\\d+$/;\n\n/* ---------- public types ---------- */\n\nexport interface RetryHintInput {\n\tstatus?: number;\n\theaders?: Headers;\n\tbodyText: string;\n}\n\n/* ---------- eligibility ---------- */\n\nfunction isRateLimited(status: number | undefined, bodyText: string): boolean {\n\tif (status === 429) return true;\n\tif (RATE_LIMIT_BODY_RE.test(bodyText)) return true;\n\t// JSON type/code fields or retryDelay presence (rate-limit signal)\n\tconst json = tryParseJSON(bodyText);\n\tif (json !== undefined) {\n\t\tconst found = scanValue(json, (v, k) => {\n\t\t\tif (k !== undefined && k.toLowerCase() === \"retrydelay\" && typeof v === \"string\") return true;\n\t\t\tif (typeof v === \"string\" && RATE_LIMIT_JSON_VALUES.has(v)) return true;\n\t\t\tif (v === 429) return true;\n\t\t\treturn false;\n\t\t});\n\t\tif (found) return true;\n\t}\n\treturn false;\n}\n\n/* ---------- 1. retry-after-ms header ---------- */\n\nfunction fromRetryAfterMsHeader(h: Headers | undefined): number | undefined {\n\tconst raw = h?.get(\"retry-after-ms\");\n\tif (raw === null || raw === undefined) return undefined;\n\tif (!RETRY_AFTER_MS_RE.test(raw)) return undefined;\n\tconst val = Number.parseFloat(raw);\n\tif (!Number.isFinite(val) || val < 0) return undefined;\n\treturn Math.ceil(val);\n}\n\n/* ---------- 2. retry-after header ---------- */\n\nfunction fromRetryAfterHeader(h: Headers | undefined, nowMs: number): number | undefined {\n\tconst raw = h?.get(\"retry-after\");\n\tif (raw === null || raw === undefined) return undefined;\n\t// integer delta-seconds\n\tif (DELTA_SECONDS_RE.test(raw)) {\n\t\treturn Number.parseInt(raw, 10) * 1000;\n\t}\n\t// HTTP-date — must contain alphabetic chars to be a real date string\n\tif (/[a-zA-Z]/.test(raw)) {\n\t\tconst parsed = Date.parse(raw);\n\t\tif (!Number.isNaN(parsed)) {\n\t\t\tconst base = dateHeaderMs(h) ?? nowMs;\n\t\t\treturn clampAbsolute(parsed, base);\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/* ---------- 3. x-ratelimit-reset* headers ---------- */\n\nfunction fromXRateLimitReset(h: Headers | undefined, nowMs: number): number | undefined {\n\tlet best: number | undefined;\n\tfor (const key of [\"x-ratelimit-reset\", \"x-ratelimit-reset-requests\", \"x-ratelimit-reset-tokens\"]) {\n\t\tconst raw = h?.get(key);\n\t\tif (raw === null || raw === undefined) continue;\n\t\tconst epoch = Number.parseFloat(raw);\n\t\tif (!Number.isFinite(epoch) || epoch < 0) continue;\n\t\t// reject \"12abc\" — strict number check\n\t\tif (!/^\\d+(?:\\.\\d+)?$/.test(raw)) continue;\n\t\tconst delta = Math.ceil(epoch * 1000 - nowMs);\n\t\tconst clamped = Math.max(0, delta);\n\t\tif (best === undefined || clamped > best) best = clamped;\n\t}\n\treturn best;\n}\n\n/* ---------- 4. JSON retryDelay (recursive, max-wins) ---------- */\n\nconst RETRY_DELAY_RE = /^(\\d+(?:\\.\\d+)?)\\s*(ms|s|m)$/;\n\nfunction fromJsonRetryDelay(bodyText: string): number | undefined {\n\tconst json = tryParseJSON(bodyText);\n\tif (json === undefined) return undefined;\n\tlet best: number | undefined;\n\tscanValue(json, (v) => {\n\t\tif (typeof v !== \"string\") return false;\n\t\tconst m = v.match(RETRY_DELAY_RE);\n\t\tif (!m) return false;\n\t\tconst num = Number.parseFloat(m[1]);\n\t\tconst unit = m[2];\n\t\tconst ms = unit === \"ms\" ? num : unit === \"s\" ? num * 1000 : num * 60_000;\n\t\tconst intMs = Math.ceil(ms);\n\t\tif (best === undefined || intMs > best) best = intMs;\n\t\treturn false; // keep scanning\n\t});\n\treturn best;\n}\n\n/* ---------- 5. body prose ---------- */\n\nfunction fromBodyProse(bodyText: string, nowMs: number): number | undefined {\n\t// ms-marker: retry-after-ms: <N>\n\tlet m = bodyText.match(/retry-after-ms:\\s*(\\d+)/i);\n\tif (m) return Number.parseInt(m[1], 10);\n\n\t// seconds-marker: retry-after: <N>\n\tm = bodyText.match(/retry-after:\\s*(\\d+)/i);\n\tif (m) return Number.parseInt(m[1], 10) * 1000;\n\n\t// relative prose: try again | retry | wait after ... [in] N <unit>\n\tm = bodyText.match(\n\t\t/(?:try again|retry|wait after).*?(?:in\\s+)?(\\d+(?:\\.\\d+)?)\\s*(ms|s|sec|seconds?|m|min|minutes?)\\b/i,\n\t);\n\tif (m) return convertUnit(Number.parseFloat(m[1]), m[2]);\n\n\t// resets at <ISO8601-with-tz>\n\tm = bodyText.match(/resets?\\s+at\\s+(\\S+)/i);\n\tif (m) {\n\t\tconst parsed = Date.parse(m[1]);\n\t\tif (!Number.isNaN(parsed)) return clampAbsolute(parsed, nowMs);\n\t}\n\n\treturn undefined;\n}\n\n/* ---------- helpers ---------- */\n\nfunction dateHeaderMs(h: Headers | undefined): number | undefined {\n\tconst raw = h?.get(\"date\");\n\tif (raw === null || raw === undefined) return undefined;\n\tconst parsed = Date.parse(raw);\n\treturn Number.isNaN(parsed) ? undefined : parsed;\n}\n\nfunction clampAbsolute(targetMs: number, baseMs: number): number {\n\treturn Math.max(0, targetMs - baseMs);\n}\n\nfunction convertUnit(num: number, unit: string): number {\n\tconst u = unit.toLowerCase();\n\tif (u === \"ms\") return Math.ceil(num);\n\tif (u === \"s\" || u === \"sec\" || u === \"second\" || u === \"seconds\") return Math.ceil(num * 1000);\n\treturn Math.ceil(num * 60_000); // m / min / minute / minutes\n}\n\n/** Recursively walk JSON, calling fn on every leaf value with its key. */\nfunction scanValue(\n\tvalue: unknown,\n\tfn: (v: string | number | boolean | null, key?: string) => boolean,\n\tkey?: string,\n): boolean {\n\tif (value === null) return fn(null, key);\n\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") return fn(value, key);\n\tif (Array.isArray(value)) {\n\t\tfor (const item of value) {\n\t\t\tif (scanValue(item, fn, key)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tif (typeof value === \"object\") {\n\t\tfor (const [k, v] of Object.entries(value)) {\n\t\t\tif (scanValue(v, fn, k)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\treturn false;\n}\n\nfunction tryParseJSON(text: string): unknown {\n\t// strip SSE data: prefix lines\n\tconst cleaned = text.replace(/^data:\\s*/gm, \"\").trim();\n\tif (!cleaned.startsWith(\"{\") && !cleaned.startsWith(\"[\")) return undefined;\n\ttry {\n\t\treturn JSON.parse(cleaned);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/* ---------- main extractor ---------- */\n\nexport function extract429RetryAfterMs(input: RetryHintInput, nowMs?: number): number | undefined {\n\tconst now = nowMs ?? Date.now();\n\n\tif (!isRateLimited(input.status, input.bodyText)) return undefined;\n\n\t// 1. retry-after-ms header\n\tconst fromMs = fromRetryAfterMsHeader(input.headers);\n\tif (fromMs !== undefined) return fromMs;\n\n\t// 2. retry-after header\n\tconst fromRa = fromRetryAfterHeader(input.headers, now);\n\tif (fromRa !== undefined) return fromRa;\n\n\t// 3. x-ratelimit-reset* headers\n\tconst fromXrl = fromXRateLimitReset(input.headers, now);\n\tif (fromXrl !== undefined) return fromXrl;\n\n\t// 4. JSON retryDelay\n\tconst fromJson = fromJsonRetryDelay(input.bodyText);\n\tif (fromJson !== undefined) return fromJson;\n\n\t// 5. body prose\n\treturn fromBodyProse(input.bodyText, now);\n}\n\n/* ---------- marker helpers ---------- */\n\nexport function appendRetryAfterMsMarker(message: string, hintMs: number): string {\n\treturn `${message} (retry-after-ms: ${hintMs})`;\n}\n\nexport function parseRetryAfterMsMarker(message: string): number | undefined {\n\tconst m = message.match(MARKER_RE);\n\tif (!m) return undefined;\n\treturn Number.parseInt(m[1], 10);\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-ai",
3
3
  "private": true,
4
- "version": "2026.8.1",
4
+ "version": "2026.8.3-3",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -28,6 +28,10 @@
28
28
  "types": "./dist/api/*.d.ts",
29
29
  "import": "./dist/api/*.js"
30
30
  },
31
+ "./utils/*": {
32
+ "types": "./dist/utils/*.d.ts",
33
+ "import": "./dist/utils/*.js"
34
+ },
31
35
  "./oauth": {
32
36
  "types": "./dist/oauth.d.ts",
33
37
  "import": "./dist/oauth.js"
@@ -59,12 +63,12 @@
59
63
  "generate-model-catalog": "tsx scripts/generate-models.ts --strict --json-only --json-output ../../.artifacts/model-catalog",
60
64
  "generate-image-models": "tsx scripts/generate-image-models.ts --strict",
61
65
  "check:model-data": "tsx scripts/check-model-data.ts",
62
- "build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && shx rm -rf dist/providers/data && shx cp -r src/providers/data dist/providers/data",
63
- "build:offline": "npm run check:model-data && tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && shx rm -rf dist/providers/data && shx cp -r src/providers/data dist/providers/data",
64
- "dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
65
- "dev:tsc": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
66
+ "build": "tsc -p tsconfig.build.json && shx chmod +x dist/cli.js && shx rm -rf dist/providers/data && shx cp -r src/providers/data dist/providers/data",
67
+ "build:offline": "npm run check:model-data && tsc -p tsconfig.build.json && shx chmod +x dist/cli.js && shx rm -rf dist/providers/data && shx cp -r src/providers/data dist/providers/data",
68
+ "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
69
+ "dev:tsc": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
66
70
  "test": "vitest --run",
67
- "prepublishOnly": "shx rm -rf dist && tsx scripts/generate-models.ts && tsx scripts/generate-image-models.ts && tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js"
71
+ "prepublishOnly": "shx rm -rf dist && tsx scripts/generate-models.ts && tsx scripts/generate-image-models.ts && tsc -p tsconfig.build.json && shx chmod +x dist/cli.js"
68
72
  },
69
73
  "dependencies": {
70
74
  "@anthropic-ai/sdk": "0.91.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-pty",
3
3
  "private": true,
4
- "version": "2026.8.1",
4
+ "version": "2026.8.3-3",
5
5
  "description": "Typed PTY session loader for Senpi persistent terminals",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "scripts": {
34
34
  "clean": "shx rm -rf dist",
35
- "build": "tsgo -p tsconfig.build.json",
35
+ "build": "tsc -p tsconfig.build.json",
36
36
  "test": "vitest --run test",
37
37
  "check:prebuild": "node native/check-prebuild-fresh.mjs",
38
38
  "prepublishOnly": "npm run clean && npm run build"
@@ -4,25 +4,27 @@ Minimal terminal UI framework with differential rendering and synchronized outpu
4
4
 
5
5
  ## Features
6
6
 
7
- - **Differential Rendering**: Three-strategy rendering system that only updates what changed
7
+ - **Interchangeable Renderers**: Shared `TUI` interface with main-screen and alternate-screen implementations
8
+ - **Differential Rendering**: Updates only changed lines or viewport rows
9
+ - **Application-owned Scrolling**: Alternate-screen viewport supports mouse, trackpad, and keyboard navigation
8
10
  - **Synchronized Output**: Uses CSI 2026 for atomic screen updates (no flicker)
9
11
  - **Bracketed Paste Mode**: Handles large pastes correctly with markers for >10 line pastes
10
12
  - **Component-based**: Simple Component interface with render() method
11
13
  - **Theme Support**: Components accept theme interfaces for customizable styling
12
- - **Built-in Components**: Text, TruncatedText, Input, Editor, Markdown, Loader, SelectList, SettingsList, Spacer, Image, Box, Container
14
+ - **Built-in Components**: Text, TruncatedText, Input, Editor, Markdown, Loader, SelectList, SettingsList, Spacer, Image, Box, Container, VStack, HStack, ScrollView
13
15
  - **Inline Images**: Renders images in terminals that support Kitty or iTerm2 graphics protocols
14
16
  - **Autocomplete Support**: File paths and slash commands
15
17
 
16
18
  ## Quick Start
17
19
 
18
20
  ```typescript
19
- import { TUI, Text, Editor, ProcessTerminal, matchesKey } from "@earendil-works/pi-tui";
21
+ import { type TUI, Text, Editor, ProcessTerminal, TuiMainScreen, matchesKey } from "@earendil-works/pi-tui";
20
22
 
21
23
  // Create terminal
22
24
  const terminal = new ProcessTerminal();
23
25
 
24
- // Create TUI
25
- const tui = new TUI(terminal);
26
+ // Create the default main-screen renderer through the shared TUI interface
27
+ const tui: TUI = new TuiMainScreen(terminal);
26
28
 
27
29
  // Add components
28
30
  tui.addChild(new Text("Welcome to my app!"));
@@ -52,12 +54,20 @@ tui.start();
52
54
 
53
55
  ## Core API
54
56
 
55
- ### TUI
57
+ ### TUI interface and renderers
56
58
 
57
- Main container that manages components and rendering.
59
+ `TUI` is the shared interface for component management, focus, overlays, input, lifecycle, terminal queries, and rendering. Choose a concrete renderer only when constructing the application:
60
+
61
+ - `TuiMainScreen` renders into the main terminal buffer and preserves terminal scrollback.
62
+ - `TuiAltScreen` renders a fixed-height viewport in the alternate terminal buffer with application-owned scrolling. When stopped, it restores the main buffer and prints the complete final document.
58
63
 
59
64
  ```typescript
60
- const tui = new TUI(terminal);
65
+ import { type TUI, TuiAltScreen, TuiMainScreen } from "@earendil-works/pi-tui";
66
+
67
+ const tui: TUI = new TuiMainScreen(terminal);
68
+ // To use an application-owned viewport in the alternate terminal buffer instead:
69
+ // const tui: TUI = new TuiAltScreen(terminal);
70
+
61
71
  tui.addChild(component);
62
72
  tui.removeChild(component);
63
73
  tui.start();
@@ -68,6 +78,53 @@ tui.requestRender(); // Request a re-render
68
78
  tui.onDebug = () => console.log("Debug triggered");
69
79
  ```
70
80
 
81
+ ### Alternate-screen viewport layouts
82
+
83
+ `TuiAltScreen` can render an explicit terminal-height layout. `VStack` and `HStack` allocate constrained regions, while `ScrollView` owns scrolling for one region. These semantics are intentionally unavailable on `TuiMainScreen`, where the terminal owns scrollback.
84
+
85
+ ```typescript
86
+ import {
87
+ Container,
88
+ isViewportTUI,
89
+ ScrollView,
90
+ Text,
91
+ VStack,
92
+ } from "@earendil-works/pi-tui";
93
+
94
+ const transcript = new Container();
95
+ transcript.addChild(new Text("History"));
96
+
97
+ const editorAndFooter = new VStack([
98
+ editor,
99
+ new Text("status"),
100
+ ]);
101
+
102
+ if (isViewportTUI(tui)) {
103
+ tui.setLayoutRoot(new VStack([
104
+ {
105
+ component: new ScrollView(transcript, {
106
+ follow: "end",
107
+ primary: true,
108
+ overscroll: "chain",
109
+ }),
110
+ basis: 0,
111
+ grow: 1,
112
+ minSize: 1,
113
+ },
114
+ {
115
+ component: editorAndFooter,
116
+ basis: "auto",
117
+ shrink: 1,
118
+ minSize: 1,
119
+ },
120
+ ]));
121
+ }
122
+ ```
123
+
124
+ Stack entries support `basis`, `grow`, `shrink`, `minSize`, `maxSize`, and responsive `visible` callbacks. Mouse-wheel input targets the scroll view under the pointer and unused delta chains to outer scroll views by default. The primary scroll view receives the alternate-screen keyboard navigation actions and wheel input over non-scrollable regions. It can also jump between OSC 133 semantic prompt markers, matching common terminal prompt-navigation shortcuts.
125
+
126
+ Layout geometry is rebuilt for each requested frame. Stateful components are retained, and their existing rendered-line caches remain effective. Calling `render(width)` directly on these layout components produces an unbounded document, which is also used when alt mode restores the main screen.
127
+
71
128
  ### Overlays
72
129
 
73
130
  Overlays render components on top of existing content without replacing it. Useful for dialogs, menus, and modal UI.
@@ -190,7 +247,7 @@ When a `Focusable` component has focus, TUI:
190
247
  3. Positions the hardware terminal cursor at that location
191
248
  4. Shows the hardware cursor only when `showHardwareCursor` is enabled
192
249
 
193
- The cursor remains hidden by default. This keeps the fake cursor rendering, while still positioning the hardware cursor for terminals that track IME candidate windows with hidden cursors. Some terminals require a visible hardware cursor for IME positioning; enable it with the `TUI` constructor option, `setShowHardwareCursor(true)`, or `PI_HARDWARE_CURSOR=1`. The `Editor` and `Input` built-in components already implement this interface.
250
+ The cursor remains hidden by default. This keeps the fake cursor rendering, while still positioning the hardware cursor for terminals that track IME candidate windows with hidden cursors. Some terminals require a visible hardware cursor for IME positioning; enable it with the renderer constructor's `showHardwareCursor` argument, `setShowHardwareCursor(true)`, or `PI_HARDWARE_CURSOR=1`. The `Editor` and `Input` built-in components already implement this interface.
194
251
 
195
252
  **Container components with embedded inputs:** When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child:
196
253
 
@@ -535,6 +592,10 @@ tui.addChild(image);
535
592
 
536
593
  Supported formats: PNG, JPEG, GIF, WebP. Dimensions are parsed from the image headers automatically.
537
594
 
595
+ #### Alternate-screen image compatibility
596
+
597
+ `TuiAltScreen` supports inline images and partial viewport cropping in terminals that implement the Kitty graphics protocol, including Kitty and Ghostty. iTerm2's inline-image protocol does not provide operations to delete an existing placement or crop its source while scrolling. To prevent stale images from remaining over repainted content, `TuiAltScreen` renders image components as text placeholders in iTerm2. `TuiMainScreen` continues to render iTerm2 inline images normally.
598
+
538
599
  ## Autocomplete
539
600
 
540
601
  ### CombinedAutocompleteProvider
@@ -588,15 +649,17 @@ if (matchesKey(data, Key.enter)) {
588
649
  - With modifiers: `Key.ctrl("c")`, `Key.shift("tab")`, `Key.alt("left")`, `Key.ctrlShift("p")`
589
650
  - String format also works: `"enter"`, `"ctrl+c"`, `"shift+tab"`, `"ctrl+shift+p"`
590
651
 
591
- ## Differential Rendering
652
+ ## Rendering modes
592
653
 
593
- The TUI uses three rendering strategies:
654
+ `TuiMainScreen` uses three rendering strategies:
594
655
 
595
656
  1. **First Render**: Output all lines without clearing scrollback
596
- 2. **Width Changed or Change Above Viewport**: Clear screen and full re-render
597
- 3. **Normal Update**: Move cursor to first changed line, clear to end, render changed lines
657
+ 2. **Width Changed or Change Above Viewport**: Clear screen and fully re-render
658
+ 3. **Normal Update**: Move the cursor to the first changed line, clear to the end, and render changed lines
659
+
660
+ `TuiAltScreen` owns a terminal-height viewport. Without an explicit layout root it preserves the legacy single-document scrolling behavior. With `setLayoutRoot()`, `VStack`, `HStack`, and nested `ScrollView` components can reserve fixed regions and independently scroll constrained regions. It updates changed viewport rows in place, follows streaming output while at the bottom, and preserves a manually selected scroll position while content grows. Mouse-wheel and configurable keyboard navigation scroll without modifying terminal scrollback, including jumps between OSC 133 semantic prompt markers. Clicking an OSC 8 hyperlink opens it with the configured URL handler. Dragging with the primary mouse button selects text and copies it to the clipboard with OSC 52; holding the drag at a scroll view's top or bottom edge auto-scrolls and extends the selection into off-screen content. Kitty images support vertical viewport cropping; iTerm2 inline images fall back to text because the iTerm2 protocol cannot delete or crop placements during viewport repainting.
598
661
 
599
- All updates are wrapped in **synchronized output** (`\x1b[?2026h` ... `\x1b[?2026l`) for atomic, flicker-free rendering.
662
+ Both renderers wrap updates in **synchronized output** (`\x1b[?2026h` ... `\x1b[?2026l`) for atomic, flicker-free rendering.
600
663
 
601
664
  ## Terminal Interface
602
665
 
@@ -0,0 +1,83 @@
1
+ import type { Terminal } from "./terminal.ts";
2
+ import { type Component, TuiBase, VIEWPORT_TUI, type ViewportTUI } from "./tui.ts";
3
+ export interface TuiAltScreenOptions {
4
+ /** Number of logical lines moved for each mouse-wheel event. */
5
+ wheelScrollLines?: number;
6
+ /** Capture mouse events for viewport scrolling and application-owned text selection. */
7
+ mouse?: boolean;
8
+ /** Open an OSC 8 hyperlink activated with a primary-button click. */
9
+ openUrl?: (url: string) => void;
10
+ }
11
+ /** Alternate-screen TUI with a scrollable, application-owned viewport. */
12
+ export declare class TuiAltScreen extends TuiBase implements ViewportTUI {
13
+ readonly [VIEWPORT_TUI]: true;
14
+ private previousScreen;
15
+ private lastDocument;
16
+ private previousScreenWidth;
17
+ private previousScreenHeight;
18
+ private layoutRoot;
19
+ private currentLayout;
20
+ private readonly implicitDocument;
21
+ private readonly implicitScrollView;
22
+ private readonly flashes;
23
+ private altScreenActive;
24
+ private imageProtocol;
25
+ private savedCapabilities?;
26
+ private selectionAnchor?;
27
+ private selectionFocus?;
28
+ private selectionDragPointer?;
29
+ private selectionAutoScrollDirection;
30
+ private selectionAutoScrollTimer?;
31
+ private selectionPressActive;
32
+ private scrollbarDrag?;
33
+ private scrollbarHover?;
34
+ private pressedUrl?;
35
+ private selectionDragged;
36
+ private readonly wheelScrollLines;
37
+ private readonly mouseEnabled;
38
+ private readonly openUrl?;
39
+ constructor(terminal: Terminal, showHardwareCursor?: boolean, logDirectory?: string, options?: TuiAltScreenOptions);
40
+ get viewportTop(): number;
41
+ get isFollowingOutput(): boolean;
42
+ setLayoutRoot(component: Component | undefined): void;
43
+ render(width: number): string[];
44
+ invalidate(): void;
45
+ protected getMountedRoots(): readonly Component[];
46
+ private getPrimaryScrollView;
47
+ protected beforeTerminalStart(): void;
48
+ protected beforeTerminalStop(): void;
49
+ protected afterTerminalStop(): void;
50
+ private deleteAltScreenKittyImages;
51
+ protected resetRenderState(): void;
52
+ scrollBy(lines: number): void;
53
+ scrollToTop(): void;
54
+ scrollToBottom(): void;
55
+ private scrollToPrompt;
56
+ /** Show a transient message in the alternate-screen flash stack. */
57
+ flash(message: string, durationMs?: number): void;
58
+ private handleViewportInput;
59
+ private parseWheelEvent;
60
+ private routeWheel;
61
+ private parseSgrMouseEvent;
62
+ private getScrollbarTargetAt;
63
+ private setScrollbarHover;
64
+ private updateScrollbarHover;
65
+ private stopScrollbarHover;
66
+ private handleScrollbarMouseEvent;
67
+ private stopScrollbarDrag;
68
+ private getScrollSelectionPoint;
69
+ private getSelectionPoint;
70
+ private updateSelectionAutoScroll;
71
+ private autoScrollSelection;
72
+ private stopSelectionAutoScroll;
73
+ private handleSelectionMouseEvent;
74
+ private getSelectionBounds;
75
+ private getSelectionColumns;
76
+ private copySelectionToClipboard;
77
+ private applySelectionHighlight;
78
+ private applySelection;
79
+ private isMouseSequence;
80
+ private compositeFlashes;
81
+ protected doRender(): void;
82
+ }
83
+ //# sourceMappingURL=TuiAltScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TuiAltScreen.d.ts","sourceRoot":"","sources":["../src/TuiAltScreen.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAS9C,OAAO,EAAE,KAAK,SAAS,EAAmC,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAqDpH,MAAM,WAAW,mBAAmB;IACnC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,0EAA0E;AAC1E,qBAAa,YAAa,SAAQ,O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