@code-yeongyu/senpi 2026.8.30 → 2026.9.2

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 (373) hide show
  1. package/CHANGELOG.md +174 -2
  2. package/README.md +3 -0
  3. package/dist/core/agent-session.d.ts +28 -0
  4. package/dist/core/agent-session.d.ts.map +1 -1
  5. package/dist/core/agent-session.js +161 -14
  6. package/dist/core/agent-session.js.map +1 -1
  7. package/dist/core/compaction/compaction-execution.d.ts +14 -0
  8. package/dist/core/compaction/compaction-execution.d.ts.map +1 -0
  9. package/dist/core/compaction/compaction-execution.js +121 -0
  10. package/dist/core/compaction/compaction-execution.js.map +1 -0
  11. package/dist/core/compaction/compaction-settings.d.ts +17 -0
  12. package/dist/core/compaction/compaction-settings.d.ts.map +1 -0
  13. package/dist/core/compaction/compaction-settings.js +17 -0
  14. package/dist/core/compaction/compaction-settings.js.map +1 -0
  15. package/dist/core/compaction/compaction.d.ts +13 -26
  16. package/dist/core/compaction/compaction.d.ts.map +1 -1
  17. package/dist/core/compaction/compaction.js +7 -136
  18. package/dist/core/compaction/compaction.js.map +1 -1
  19. package/dist/core/compaction/ideal-compaction-settings.d.ts +9 -0
  20. package/dist/core/compaction/ideal-compaction-settings.d.ts.map +1 -0
  21. package/dist/core/compaction/ideal-compaction-settings.js +7 -0
  22. package/dist/core/compaction/ideal-compaction-settings.js.map +1 -0
  23. package/dist/core/compaction-settings-access.d.ts +19 -0
  24. package/dist/core/compaction-settings-access.d.ts.map +1 -0
  25. package/dist/core/compaction-settings-access.js +10 -0
  26. package/dist/core/compaction-settings-access.js.map +1 -0
  27. package/dist/core/compaction-settings-resolver.d.ts +22 -0
  28. package/dist/core/compaction-settings-resolver.d.ts.map +1 -0
  29. package/dist/core/compaction-settings-resolver.js +46 -0
  30. package/dist/core/compaction-settings-resolver.js.map +1 -0
  31. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +9 -1
  32. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
  33. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +10 -3
  34. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
  35. package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts +24 -0
  36. package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts.map +1 -0
  37. package/dist/core/extensions/builtin/compaction/context-pipeline.js +43 -0
  38. package/dist/core/extensions/builtin/compaction/context-pipeline.js.map +1 -0
  39. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +1 -1
  40. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
  41. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +8 -2
  42. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
  43. package/dist/core/extensions/builtin/compaction/emergency-prune.d.ts +17 -0
  44. package/dist/core/extensions/builtin/compaction/emergency-prune.d.ts.map +1 -0
  45. package/dist/core/extensions/builtin/compaction/emergency-prune.js +64 -0
  46. package/dist/core/extensions/builtin/compaction/emergency-prune.js.map +1 -0
  47. package/dist/core/extensions/builtin/compaction/extension-wiring.d.ts +27 -0
  48. package/dist/core/extensions/builtin/compaction/extension-wiring.d.ts.map +1 -0
  49. package/dist/core/extensions/builtin/compaction/extension-wiring.js +84 -0
  50. package/dist/core/extensions/builtin/compaction/extension-wiring.js.map +1 -0
  51. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +1 -1
  52. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -1
  53. package/dist/core/extensions/builtin/compaction/idle-retry.js +1 -1
  54. package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -1
  55. package/dist/core/extensions/builtin/compaction/idle.d.ts +1 -0
  56. package/dist/core/extensions/builtin/compaction/idle.d.ts.map +1 -1
  57. package/dist/core/extensions/builtin/compaction/idle.js +13 -2
  58. package/dist/core/extensions/builtin/compaction/idle.js.map +1 -1
  59. package/dist/core/extensions/builtin/compaction/index.d.ts +1 -1
  60. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  61. package/dist/core/extensions/builtin/compaction/index.js +152 -154
  62. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  63. package/dist/core/extensions/builtin/compaction/log.d.ts +1 -1
  64. package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
  65. package/dist/core/extensions/builtin/compaction/log.js +2 -0
  66. package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
  67. package/dist/core/extensions/builtin/compaction/model-selection.d.ts +14 -0
  68. package/dist/core/extensions/builtin/compaction/model-selection.d.ts.map +1 -0
  69. package/dist/core/extensions/builtin/compaction/model-selection.js +37 -0
  70. package/dist/core/extensions/builtin/compaction/model-selection.js.map +1 -0
  71. package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts +30 -0
  72. package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -0
  73. package/dist/core/extensions/builtin/compaction/model-usability-budget.js +74 -0
  74. package/dist/core/extensions/builtin/compaction/model-usability-budget.js.map +1 -0
  75. package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.d.ts +9 -0
  76. package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.d.ts.map +1 -0
  77. package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.js +2 -0
  78. package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.js.map +1 -0
  79. package/dist/core/extensions/builtin/compaction/openai-remote.d.ts +3 -6
  80. package/dist/core/extensions/builtin/compaction/openai-remote.d.ts.map +1 -1
  81. package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
  82. package/dist/core/extensions/builtin/compaction/orchestration.d.ts +46 -0
  83. package/dist/core/extensions/builtin/compaction/orchestration.d.ts.map +1 -0
  84. package/dist/core/extensions/builtin/compaction/orchestration.js +103 -0
  85. package/dist/core/extensions/builtin/compaction/orchestration.js.map +1 -0
  86. package/dist/core/extensions/builtin/compaction/policy.d.ts +12 -2
  87. package/dist/core/extensions/builtin/compaction/policy.d.ts.map +1 -1
  88. package/dist/core/extensions/builtin/compaction/policy.js +52 -26
  89. package/dist/core/extensions/builtin/compaction/policy.js.map +1 -1
  90. package/dist/core/extensions/builtin/compaction/speculation-lead.d.ts +8 -0
  91. package/dist/core/extensions/builtin/compaction/speculation-lead.d.ts.map +1 -0
  92. package/dist/core/extensions/builtin/compaction/speculation-lead.js +17 -0
  93. package/dist/core/extensions/builtin/compaction/speculation-lead.js.map +1 -0
  94. package/dist/core/extensions/builtin/compaction/speculative-job.d.ts +22 -0
  95. package/dist/core/extensions/builtin/compaction/speculative-job.d.ts.map +1 -0
  96. package/dist/core/extensions/builtin/compaction/speculative-job.js +16 -0
  97. package/dist/core/extensions/builtin/compaction/speculative-job.js.map +1 -0
  98. package/dist/core/extensions/builtin/compaction/speculative-summary.d.ts +23 -0
  99. package/dist/core/extensions/builtin/compaction/speculative-summary.d.ts.map +1 -0
  100. package/dist/core/extensions/builtin/compaction/speculative-summary.js +132 -0
  101. package/dist/core/extensions/builtin/compaction/speculative-summary.js.map +1 -0
  102. package/dist/core/extensions/builtin/compaction/speculative.d.ts +8 -13
  103. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  104. package/dist/core/extensions/builtin/compaction/speculative.js +21 -197
  105. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  106. package/dist/core/extensions/builtin/compaction/token-budget-reminder.d.ts +24 -0
  107. package/dist/core/extensions/builtin/compaction/token-budget-reminder.d.ts.map +1 -0
  108. package/dist/core/extensions/builtin/compaction/token-budget-reminder.js +25 -0
  109. package/dist/core/extensions/builtin/compaction/token-budget-reminder.js.map +1 -0
  110. package/dist/core/extensions/builtin/compaction/tool-admission.d.ts +27 -0
  111. package/dist/core/extensions/builtin/compaction/tool-admission.d.ts.map +1 -0
  112. package/dist/core/extensions/builtin/compaction/tool-admission.js +56 -0
  113. package/dist/core/extensions/builtin/compaction/tool-admission.js.map +1 -0
  114. package/dist/core/extensions/builtin/hooks/trust-state-json.d.ts +5 -0
  115. package/dist/core/extensions/builtin/hooks/trust-state-json.d.ts.map +1 -0
  116. package/dist/core/extensions/builtin/hooks/trust-state-json.js +76 -0
  117. package/dist/core/extensions/builtin/hooks/trust-state-json.js.map +1 -0
  118. package/dist/core/extensions/builtin/hooks/trust-storage.d.ts +7 -1
  119. package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
  120. package/dist/core/extensions/builtin/hooks/trust-storage.js +60 -8
  121. package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -1
  122. package/dist/core/extensions/builtin/hooks/trust.d.ts +1 -2
  123. package/dist/core/extensions/builtin/hooks/trust.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/hooks/trust.js +1 -72
  125. package/dist/core/extensions/builtin/hooks/trust.js.map +1 -1
  126. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts +3 -0
  127. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts.map +1 -0
  128. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +108 -0
  129. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -0
  130. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  131. package/dist/core/extensions/builtin/prompt-preset/presets.js +11 -0
  132. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  133. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
  134. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  135. package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
  136. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  137. package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
  138. package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
  139. package/dist/core/extensions/builtin/recommended-models/index.js +1 -1
  140. package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
  141. package/dist/core/extensions/builtin/terminal/runtime-session.d.ts +11 -0
  142. package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
  143. package/dist/core/extensions/builtin/terminal/runtime-session.js +18 -2
  144. package/dist/core/extensions/builtin/terminal/runtime-session.js.map +1 -1
  145. package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
  146. package/dist/core/extensions/builtin/ttsr/index.js +4 -0
  147. package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
  148. package/dist/core/extensions/builtin/ttsr/manager.d.ts +2 -0
  149. package/dist/core/extensions/builtin/ttsr/manager.d.ts.map +1 -1
  150. package/dist/core/extensions/builtin/ttsr/manager.js +28 -1
  151. package/dist/core/extensions/builtin/ttsr/manager.js.map +1 -1
  152. package/dist/core/extensions/runner.d.ts +5 -0
  153. package/dist/core/extensions/runner.d.ts.map +1 -1
  154. package/dist/core/extensions/runner.js +7 -0
  155. package/dist/core/extensions/runner.js.map +1 -1
  156. package/dist/core/retry-fallback/controller.d.ts +14 -0
  157. package/dist/core/retry-fallback/controller.d.ts.map +1 -1
  158. package/dist/core/retry-fallback/controller.js +33 -3
  159. package/dist/core/retry-fallback/controller.js.map +1 -1
  160. package/dist/core/retry-fallback/log.js +1 -1
  161. package/dist/core/retry-fallback/log.js.map +1 -1
  162. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  163. package/dist/core/retry-fallback/settings.js +1 -0
  164. package/dist/core/retry-fallback/settings.js.map +1 -1
  165. package/dist/core/sdk.d.ts.map +1 -1
  166. package/dist/core/sdk.js +5 -0
  167. package/dist/core/sdk.js.map +1 -1
  168. package/dist/core/session-activity.d.ts +47 -0
  169. package/dist/core/session-activity.d.ts.map +1 -0
  170. package/dist/core/session-activity.js +58 -0
  171. package/dist/core/session-activity.js.map +1 -0
  172. package/dist/core/session-manager.d.ts +8 -12
  173. package/dist/core/session-manager.d.ts.map +1 -1
  174. package/dist/core/session-manager.js +118 -7
  175. package/dist/core/session-manager.js.map +1 -1
  176. package/dist/core/session-resident-store.d.ts +8 -1
  177. package/dist/core/session-resident-store.d.ts.map +1 -1
  178. package/dist/core/session-resident-store.js +12 -5
  179. package/dist/core/session-resident-store.js.map +1 -1
  180. package/dist/core/settings-manager.d.ts +8 -85
  181. package/dist/core/settings-manager.d.ts.map +1 -1
  182. package/dist/core/settings-manager.js +9 -17
  183. package/dist/core/settings-manager.js.map +1 -1
  184. package/dist/core/settings-public-types.d.ts +11 -0
  185. package/dist/core/settings-public-types.d.ts.map +1 -0
  186. package/dist/core/settings-public-types.js +2 -0
  187. package/dist/core/settings-public-types.js.map +1 -0
  188. package/dist/core/settings-shapes.d.ts +36 -0
  189. package/dist/core/settings-shapes.d.ts.map +1 -0
  190. package/dist/core/settings-shapes.js +2 -0
  191. package/dist/core/settings-shapes.js.map +1 -0
  192. package/dist/core/shared-host-policy.d.ts +6 -0
  193. package/dist/core/shared-host-policy.d.ts.map +1 -0
  194. package/dist/core/shared-host-policy.js +7 -0
  195. package/dist/core/shared-host-policy.js.map +1 -0
  196. package/dist/core/terminal-settings.d.ts +22 -0
  197. package/dist/core/terminal-settings.d.ts.map +1 -0
  198. package/dist/core/terminal-settings.js +2 -0
  199. package/dist/core/terminal-settings.js.map +1 -0
  200. package/dist/index.d.ts +1 -1
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/index.js +1 -1
  203. package/dist/index.js.map +1 -1
  204. package/dist/main.d.ts +4 -4
  205. package/dist/main.d.ts.map +1 -1
  206. package/dist/main.js +27 -11
  207. package/dist/main.js.map +1 -1
  208. package/dist/modes/app-server/daemon/process.d.ts +13 -2
  209. package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
  210. package/dist/modes/app-server/daemon/process.js +58 -12
  211. package/dist/modes/app-server/daemon/process.js.map +1 -1
  212. package/dist/modes/app-server/daemon.js +65 -7
  213. package/dist/modes/app-server/daemon.js.map +1 -1
  214. package/dist/modes/index.d.ts +1 -1
  215. package/dist/modes/index.d.ts.map +1 -1
  216. package/dist/modes/index.js +1 -1
  217. package/dist/modes/index.js.map +1 -1
  218. package/dist/modes/interactive/interactive-host-runtime.d.ts +84 -1
  219. package/dist/modes/interactive/interactive-host-runtime.d.ts.map +1 -1
  220. package/dist/modes/interactive/interactive-host-runtime.js +435 -112
  221. package/dist/modes/interactive/interactive-host-runtime.js.map +1 -1
  222. package/dist/modes/interactive/interactive-mode.d.ts +11 -1
  223. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  224. package/dist/modes/interactive/interactive-mode.js +59 -6
  225. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  226. package/dist/modes/interactive/tips/catalog/ethos-tips.js +1 -1
  227. package/dist/modes/interactive/tips/catalog/ethos-tips.js.map +1 -1
  228. package/dist/modes/rpc/connection-handler.d.ts +12 -5
  229. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  230. package/dist/modes/rpc/connection-handler.js +180 -25
  231. package/dist/modes/rpc/connection-handler.js.map +1 -1
  232. package/dist/modes/rpc/custom-capability.d.ts +2 -0
  233. package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
  234. package/dist/modes/rpc/custom-capability.js +2 -0
  235. package/dist/modes/rpc/custom-capability.js.map +1 -1
  236. package/dist/modes/rpc/host-ensure.d.ts +17 -0
  237. package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
  238. package/dist/modes/rpc/host-ensure.js +150 -23
  239. package/dist/modes/rpc/host-ensure.js.map +1 -1
  240. package/dist/modes/rpc/host-lifecycle.d.ts +54 -0
  241. package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
  242. package/dist/modes/rpc/host-lifecycle.js +259 -69
  243. package/dist/modes/rpc/host-lifecycle.js.map +1 -1
  244. package/dist/modes/rpc/host-watchdog.d.ts +2 -2
  245. package/dist/modes/rpc/host-watchdog.d.ts.map +1 -1
  246. package/dist/modes/rpc/host-watchdog.js +89 -21
  247. package/dist/modes/rpc/host-watchdog.js.map +1 -1
  248. package/dist/modes/rpc/multi-session-host.d.ts +38 -0
  249. package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
  250. package/dist/modes/rpc/multi-session-host.js +149 -61
  251. package/dist/modes/rpc/multi-session-host.js.map +1 -1
  252. package/dist/modes/rpc/ownership-safe-lock.d.ts +14 -0
  253. package/dist/modes/rpc/ownership-safe-lock.d.ts.map +1 -0
  254. package/dist/modes/rpc/ownership-safe-lock.js +87 -0
  255. package/dist/modes/rpc/ownership-safe-lock.js.map +1 -0
  256. package/dist/modes/rpc/rpc-client.d.ts +13 -2
  257. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  258. package/dist/modes/rpc/rpc-client.js +46 -12
  259. package/dist/modes/rpc/rpc-client.js.map +1 -1
  260. package/dist/modes/rpc/rpc-types.d.ts +21 -3
  261. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  262. package/dist/modes/rpc/rpc-types.js +1 -0
  263. package/dist/modes/rpc/rpc-types.js.map +1 -1
  264. package/dist/modes/rpc/session-binding.d.ts +2 -1
  265. package/dist/modes/rpc/session-binding.d.ts.map +1 -1
  266. package/dist/modes/rpc/session-binding.js +1 -0
  267. package/dist/modes/rpc/session-binding.js.map +1 -1
  268. package/dist/modes/rpc/session-command-router.d.ts +54 -1
  269. package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
  270. package/dist/modes/rpc/session-command-router.js +180 -3
  271. package/dist/modes/rpc/session-command-router.js.map +1 -1
  272. package/dist/modes/rpc/session-event-writer.d.ts +18 -0
  273. package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
  274. package/dist/modes/rpc/session-event-writer.js +88 -8
  275. package/dist/modes/rpc/session-event-writer.js.map +1 -1
  276. package/dist/modes/rpc/session-registry.d.ts +11 -1
  277. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  278. package/dist/modes/rpc/session-registry.js +25 -0
  279. package/dist/modes/rpc/session-registry.js.map +1 -1
  280. package/dist/modes/rpc/socket-transport.d.ts +13 -0
  281. package/dist/modes/rpc/socket-transport.d.ts.map +1 -0
  282. package/dist/modes/rpc/socket-transport.js +92 -0
  283. package/dist/modes/rpc/socket-transport.js.map +1 -0
  284. package/dist/modes/rpc/widget-line-renderer.d.ts +17 -0
  285. package/dist/modes/rpc/widget-line-renderer.d.ts.map +1 -0
  286. package/dist/modes/rpc/widget-line-renderer.js +73 -0
  287. package/dist/modes/rpc/widget-line-renderer.js.map +1 -0
  288. package/dist/utils/fs-watch.d.ts.map +1 -1
  289. package/dist/utils/fs-watch.js +11 -2
  290. package/dist/utils/fs-watch.js.map +1 -1
  291. package/docs/app-server.md +2 -2
  292. package/docs/containerization.md +2 -2
  293. package/docs/development.md +7 -7
  294. package/docs/extensions.md +5 -5
  295. package/docs/grok-neo.md +1 -1
  296. package/docs/index.md +1 -1
  297. package/docs/packages.md +2 -2
  298. package/docs/quickstart.md +4 -4
  299. package/docs/release-guide.md +21 -21
  300. package/docs/rpc.md +83 -6
  301. package/docs/sdk.md +1 -1
  302. package/docs/settings.md +4 -4
  303. package/docs/skills.md +2 -2
  304. package/docs/terminal-tools.md +1 -1
  305. package/docs/termux.md +1 -1
  306. package/docs/tui.md +1 -1
  307. package/examples/AGENTS.md +1 -1
  308. package/examples/sdk/README.md +1 -1
  309. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +52 -0
  310. package/node_modules/@code-yeongyu/senpi-codemode/README.md +2 -2
  311. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  312. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/skill-contribution.ts +71 -0
  313. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +3 -1
  314. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/SKILL.md +44 -0
  315. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/breaking-changes.md +75 -0
  316. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/build.md +114 -0
  317. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/dev-tooling.md +34 -0
  318. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/http-networking.md +113 -0
  319. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/install.md +93 -0
  320. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/node-compat-platforms.md +36 -0
  321. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/performance.md +33 -0
  322. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md +156 -0
  323. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/security.md +52 -0
  324. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/test.md +103 -0
  325. package/node_modules/@earendil-works/pi-agent-core/README.md +3 -0
  326. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  327. package/node_modules/@earendil-works/pi-ai/README.md +6 -3
  328. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  329. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +24 -7
  330. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  331. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +7 -0
  332. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  333. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +316 -2
  334. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  335. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.d.ts +4 -0
  336. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.d.ts.map +1 -1
  337. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.js +23 -0
  338. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.js.map +1 -1
  339. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +24 -0
  340. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  341. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +20 -2
  342. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  343. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  344. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  345. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  346. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  347. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  348. package/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -1
  349. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  350. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
  351. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  352. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  353. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  354. package/node_modules/@earendil-works/pi-pty/dist/screen-operations.d.ts +42 -0
  355. package/node_modules/@earendil-works/pi-pty/dist/screen-operations.d.ts.map +1 -0
  356. package/node_modules/@earendil-works/pi-pty/dist/screen-operations.js +34 -0
  357. package/node_modules/@earendil-works/pi-pty/dist/screen-operations.js.map +1 -0
  358. package/node_modules/@earendil-works/pi-pty/dist/screen-text.d.ts +8 -0
  359. package/node_modules/@earendil-works/pi-pty/dist/screen-text.d.ts.map +1 -0
  360. package/node_modules/@earendil-works/pi-pty/dist/screen-text.js +51 -0
  361. package/node_modules/@earendil-works/pi-pty/dist/screen-text.js.map +1 -0
  362. package/node_modules/@earendil-works/pi-pty/dist/screen.d.ts +45 -0
  363. package/node_modules/@earendil-works/pi-pty/dist/screen.d.ts.map +1 -1
  364. package/node_modules/@earendil-works/pi-pty/dist/screen.js +178 -55
  365. package/node_modules/@earendil-works/pi-pty/dist/screen.js.map +1 -1
  366. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  367. package/node_modules/@earendil-works/pi-telemetry/README.md +6 -3
  368. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  369. package/node_modules/@earendil-works/pi-tui/README.md +5 -4
  370. package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +2 -2
  371. package/node_modules/@earendil-works/pi-tui/native/win32/README.md +2 -2
  372. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  373. package/package.json +7 -7
@@ -29,7 +29,7 @@ export const ETHOS_TIPS = [
29
29
  id: "ethos.ulw-plan-sage",
30
30
  bindings: [],
31
31
  requiresCommand: "tasks",
32
- render: () => "Try ulw-plan on fable-5 xhigh. A patient sage obsessed with the essence does the agonizing for you and fills in every blank you were pretending not to see.",
32
+ render: () => "Try ulw-plan on fable-5.1 xhigh. A patient sage obsessed with the essence does the agonizing for you and fills in every blank you were pretending not to see.",
33
33
  },
34
34
  {
35
35
  id: "ethos.ulw-loop-shallow",
@@ -1 +1 @@
1
- {"version":3,"file":"ethos-tips.js","sourceRoot":"","sources":["../../../../../src/modes/interactive/tips/catalog/ethos-tips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;QACC,EAAE,EAAE,yBAAyB;QAC7B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,0JAA0J;KAC3J;IACD;QACC,EAAE,EAAE,yBAAyB;QAC7B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,qIAAqI;KACtI;IACD;QACC,EAAE,EAAE,oBAAoB;QACxB,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,+GAA+G;KAChH;IACD;QACC,EA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AG,QAAQ,mPAAmP;KAC/P;CACkC,CAAC","sourcesContent":["import { APP_NAME } from \"../../../../config.ts\";\nimport type { TipDefinition } from \"./types.ts\";\n\nexport const ETHOS_TIPS = [\n\t{\n\t\tid: \"ethos.tuning-discipline\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"gpt-5.6-sol used to turn a sprint into a marathon. We tuned the system prompt and killed that habit: 5-minute jobs take 5 minutes, 12-hour jobs take 12.\",\n\t},\n\t{\n\t\tid: \"ethos.tools-transparent\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Don't study our tools. A tool that needs studying is a tool that failed. We just ride shotgun while you keep doing your actual job.\",\n\t},\n\t{\n\t\tid: \"ethos.only-harness\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"The only harness that actually knows how to drive gpt-5.6-sol. Same job, feels up to 30% faster. *we counted*\",\n\t},\n\t{\n\t\tid: \"ethos.spend-tokens\",\n\t\tbindings: [],\n\t\trender: () => \"Stop hoarding tokens. Spend them like they buy your hours back, because they do.\",\n\t},\n\t{\n\t\tid: \"ethos.deep-work\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Using our tools means your work is already the deep, valuable kind. Keep your eyes on the essence of your craft. The rest is our problem now, and we're great at problems.\",\n\t},\n\t{\n\t\tid: \"ethos.ulw-plan-sage\",\n\t\tbindings: [],\n\t\trequiresCommand: \"tasks\",\n\t\trender: () =>\n\t\t\t\"Try ulw-plan on fable-5 xhigh. A patient sage obsessed with the essence does the agonizing for you and fills in every blank you were pretending not to see.\",\n\t},\n\t{\n\t\tid: \"ethos.ulw-loop-shallow\",\n\t\tbindings: [],\n\t\trequiresCommand: \"tasks\",\n\t\trender: () =>\n\t\t\t\"For days when deep thought sounds awful, run the ulw loop with gpt-5.6-sol fast/medium. Fair warning: shallow thinking sends invoices.\",\n\t},\n\t{\n\t\tid: \"ethos.monitor-subscribe\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Subscribe to a command's stdout and forget it. CI finishes, server boots, log line lands... you're mid-edit and the news finds *you*. No sleep loops, no polling, no re-reading context like a chump.\",\n\t},\n\t{\n\t\tid: \"ethos.cache-budget\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"My harness knows the prompt cache's expiry to the second and never blocks past it. Cold re-read tax? *Refused on your behalf.* Other agents eat that cost, mine declines it.\",\n\t},\n\t{\n\t\tid: \"ethos.cache-hit-rate\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Live cache-hit rate in the footer, plus a running tab of misses, idle gaps, and model swaps. I can point at the exact moment cache broke and why. Watching tokens you never re-pay stack up? Smug doesn't cover it.\",\n\t},\n\t{\n\t\tid: \"ethos.multimodal-vision\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t`Drop a screenshot, a PDF, a crusty whiteboard photo... ${APP_NAME} actually sees it, reads it, reasons about it. Your agent has eyes now. *Yes, really.*`,\n\t},\n\t{\n\t\tid: \"ethos.oauth-multi-account\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t`Hit a rate limit, switch accounts. Wrong org, switch again. ${APP_NAME} treats your Claude logins like a roster, not a single lifeline. *Env vars could never.*`,\n\t},\n\t{\n\t\tid: \"ethos.agent-sdk-foundation\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t'Built on the official agent SDK, speaking the protocol natively. No reverse-engineered wrapper, no ToS gray zone, no \"will I get banned for this\" anxiety. *Sleep easy, ship loud.*',\n\t},\n\t{\n\t\tid: \"ethos.tool-call-repair\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t`${APP_NAME} catches malformed tool calls on the wire, fixes them, and salvages the turn - claude's sloppy invokes, kimi k3's leaked XTML channels, all of it. Other harnesses retry the whole thing and bill you for the privilege. *table stakes, honestly*`,\n\t},\n] satisfies readonly TipDefinition[];\n"]}
1
+ {"version":3,"file":"ethos-tips.js","sourceRoot":"","sources":["../../../../../src/modes/interactive/tips/catalog/ethos-tips.ts"],"names":[],"mappings":"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AyB;QAC7B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,0DAA0D,QAAQ,wFAAwF;KAC3J;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,+DAA+D,QAAQ,0FAA0F;KAClK;IACD;QACC,EAAE,EAAE,4BAA4B;QAChC,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,qLAAqL;KACtL;IACD;QACC,EAAE,EAAE,wBAAwB;QAC5B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,EAAE,CACZ,GAAG,QAAQ,mPAAmP;KAC/P;CACkC,CAAC","sourcesContent":["import { APP_NAME } from \"../../../../config.ts\";\nimport type { TipDefinition } from \"./types.ts\";\n\nexport const ETHOS_TIPS = [\n\t{\n\t\tid: \"ethos.tuning-discipline\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"gpt-5.6-sol used to turn a sprint into a marathon. We tuned the system prompt and killed that habit: 5-minute jobs take 5 minutes, 12-hour jobs take 12.\",\n\t},\n\t{\n\t\tid: \"ethos.tools-transparent\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Don't study our tools. A tool that needs studying is a tool that failed. We just ride shotgun while you keep doing your actual job.\",\n\t},\n\t{\n\t\tid: \"ethos.only-harness\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"The only harness that actually knows how to drive gpt-5.6-sol. Same job, feels up to 30% faster. *we counted*\",\n\t},\n\t{\n\t\tid: \"ethos.spend-tokens\",\n\t\tbindings: [],\n\t\trender: () => \"Stop hoarding tokens. Spend them like they buy your hours back, because they do.\",\n\t},\n\t{\n\t\tid: \"ethos.deep-work\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Using our tools means your work is already the deep, valuable kind. Keep your eyes on the essence of your craft. The rest is our problem now, and we're great at problems.\",\n\t},\n\t{\n\t\tid: \"ethos.ulw-plan-sage\",\n\t\tbindings: [],\n\t\trequiresCommand: \"tasks\",\n\t\trender: () =>\n\t\t\t\"Try ulw-plan on fable-5.1 xhigh. A patient sage obsessed with the essence does the agonizing for you and fills in every blank you were pretending not to see.\",\n\t},\n\t{\n\t\tid: \"ethos.ulw-loop-shallow\",\n\t\tbindings: [],\n\t\trequiresCommand: \"tasks\",\n\t\trender: () =>\n\t\t\t\"For days when deep thought sounds awful, run the ulw loop with gpt-5.6-sol fast/medium. Fair warning: shallow thinking sends invoices.\",\n\t},\n\t{\n\t\tid: \"ethos.monitor-subscribe\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Subscribe to a command's stdout and forget it. CI finishes, server boots, log line lands... you're mid-edit and the news finds *you*. No sleep loops, no polling, no re-reading context like a chump.\",\n\t},\n\t{\n\t\tid: \"ethos.cache-budget\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"My harness knows the prompt cache's expiry to the second and never blocks past it. Cold re-read tax? *Refused on your behalf.* Other agents eat that cost, mine declines it.\",\n\t},\n\t{\n\t\tid: \"ethos.cache-hit-rate\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t\"Live cache-hit rate in the footer, plus a running tab of misses, idle gaps, and model swaps. I can point at the exact moment cache broke and why. Watching tokens you never re-pay stack up? Smug doesn't cover it.\",\n\t},\n\t{\n\t\tid: \"ethos.multimodal-vision\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t`Drop a screenshot, a PDF, a crusty whiteboard photo... ${APP_NAME} actually sees it, reads it, reasons about it. Your agent has eyes now. *Yes, really.*`,\n\t},\n\t{\n\t\tid: \"ethos.oauth-multi-account\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t`Hit a rate limit, switch accounts. Wrong org, switch again. ${APP_NAME} treats your Claude logins like a roster, not a single lifeline. *Env vars could never.*`,\n\t},\n\t{\n\t\tid: \"ethos.agent-sdk-foundation\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t'Built on the official agent SDK, speaking the protocol natively. No reverse-engineered wrapper, no ToS gray zone, no \"will I get banned for this\" anxiety. *Sleep easy, ship loud.*',\n\t},\n\t{\n\t\tid: \"ethos.tool-call-repair\",\n\t\tbindings: [],\n\t\trender: () =>\n\t\t\t`${APP_NAME} catches malformed tool calls on the wire, fixes them, and salvages the turn - claude's sloppy invokes, kimi k3's leaked XTML channels, all of it. Other harnesses retry the whole thing and bill you for the privilege. *table stakes, honestly*`,\n\t},\n] satisfies readonly TipDefinition[];\n"]}
@@ -17,6 +17,7 @@
17
17
  import type { AgentAbortSource } from "../../core/agent-abort-provenance.ts";
18
18
  import type { AgentSession } from "../../core/agent-session.ts";
19
19
  import type { AgentSessionRuntime } from "../../core/agent-session-runtime.ts";
20
+ import { FooterDataProvider } from "../../core/footer-data-provider.ts";
20
21
  import type { RpcSessionState } from "./rpc-types.ts";
21
22
  /** Additive per-connection options. Absent = classic default (byte-identical). */
22
23
  export interface RpcConnectionOptions {
@@ -28,12 +29,17 @@ export interface RpcConnectionOptions {
28
29
  disposeRuntime?: boolean;
29
30
  /** Multi-session routing handle. Absent preserves classic wire output exactly. */
30
31
  sessionId?: string;
32
+ footerDataProviderFactory?: (session: AgentSession) => FooterDataProvider;
33
+ sharedWidth?: {
34
+ getWidth: () => number;
35
+ setWidth: (connectionId: string | undefined, width: number) => void;
36
+ clearWidth: (connectionId: string | undefined) => void;
37
+ setCapabilities?: (connectionId: string | undefined, capabilities: readonly string[]) => void;
38
+ hasRenderedComponents?: (sessionId: string) => boolean;
39
+ connectionId: () => string | undefined;
40
+ onChange?: () => void;
41
+ };
31
42
  }
32
- /**
33
- * The output side of a connection. `writeRaw` receives already-serialized JSONL
34
- * text (LF-terminated). `waitForBackpressure` lets the host apply flow control
35
- * (stdout drain in classic mode, or the transport's own `drain` signal).
36
- */
37
43
  export interface RpcConnectionSink {
38
44
  writeRaw(chunk: string): void;
39
45
  waitForBackpressure(): Promise<void>;
@@ -46,6 +52,7 @@ export interface RpcConnectionHandler {
46
52
  readonly ready: Promise<void>;
47
53
  /** Feed one inbound JSONL line (command or extension_ui_response). */
48
54
  handleInputLine(line: string): Promise<void>;
55
+ rerenderComponents(): void;
49
56
  /**
50
57
  * True once an extension requested shutdown via the shutdown handler. The
51
58
  * host polls this after each command and decides how to tear down.
@@ -1 +1 @@
1
- {"version":3,"file":"connection-handler.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAyC/E,OAAO,KAAK,EAYX,eAAe,EAEf,MAAM,gBAAgB,CAAC;AAGxB,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACpC,mFAAmF;IACnF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,sEAAsE;IACtE,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;IAC/B,4EAA4E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Changed, subscribeProviderAccountEvents, } from "..
24
24
  import { CLAUDE_SDK_OAUTH_PROVIDER_ID } from "../../core/extensions/builtin/claude-sdk-oauth/account-management.js";
25
25
  import { isMcpControlInventoryChanged, MCP_CONTROL_INVENTORY_CHANGED_EVENT, MCP_CONTROL_INVENTORY_REQUEST_EVENT, } from "../../core/extensions/builtin/mcp/control-inventory.js";
26
26
  import { applyFastMode, resolveServiceTierMemoryModel, } from "../../core/extensions/builtin/service-tier.js";
27
+ import { FooterDataProvider } from "../../core/footer-data-provider.js";
27
28
  import { getSupportedThinkingLevels } from "../../core/thinking-levels.js";
28
29
  import { ProjectTrustStore } from "../../core/trust-manager.js";
29
30
  import { theme } from "../interactive/theme/theme.js";
30
- import { buildCustomUnsupportedRequest, DEFAULT_CUSTOM_EXTENSION_LABEL, EXTENSION_EVENTS_CAPABILITY, } from "./custom-capability.js";
31
+ import { AUTO_TITLE_SESSIONS_CAPABILITY, buildCustomUnsupportedRequest, DEFAULT_CUSTOM_EXTENSION_LABEL, EXTENSION_EVENTS_CAPABILITY, RENDERED_COMPONENTS_CAPABILITY, } from "./custom-capability.js";
31
32
  import { createRpcEventOutputBuffer } from "./event-output-buffer.js";
32
33
  import { buildRpcCommandsForSession, createCommandsChangedEvent, rpcCommandListDigest } from "./rpc-command-surface.js";
33
34
  import { rpcCommandPayloadError, rpcCommandShapeError, rpcMessageLengthError } from "./rpc-input-validation.js";
35
+ import { RENDERED_COMPONENT_RECORD } from "./session-event-writer.js";
34
36
  import { SessionExtensionUiRequests } from "./session-extension-ui-requests.js";
37
+ import { createLiveComponentRenderer } from "./widget-line-renderer.js";
38
+ /**
39
+ * The output side of a connection. `writeRaw` receives already-serialized JSONL
40
+ * text (LF-terminated). `waitForBackpressure` lets the host apply flow control
41
+ * (stdout drain in classic mode, or the transport's own `drain` signal).
42
+ */
43
+ function createFooterDataProvider(session) {
44
+ return new FooterDataProvider(session.sessionManager.getCwd());
45
+ }
35
46
  function loadedExtensionName(path) {
36
47
  const synthetic = /^<(?:builtin|inline):([^>]+)>$/.exec(path);
37
48
  if (synthetic)
@@ -73,12 +84,12 @@ function loadedMcpStatus(server) {
73
84
  */
74
85
  export function buildRpcSessionState(session, lastAbortSource) {
75
86
  const cwd = session.sessionManager.getCwd();
76
- // Trust gates project-source settings (shell prefixes, project resources), so an
77
- // unverifiable verdict must fail closed: no agentDir means no authoritative store to
78
- // consult, and the session's own manager only counts when it says trusted outright.
79
- const projectTrusted = session.agentDir
80
- ? new ProjectTrustStore(session.agentDir).get(cwd) === true
81
- : session.settingsManager?.isProjectTrusted?.() === true;
87
+ // Trust gates project-source settings (shell prefixes, project resources), so every
88
+ // session state projection must have an authoritative store to consult.
89
+ if (!session.agentDir) {
90
+ throw new Error("RPC session invariant violated: agentDir is required");
91
+ }
92
+ const projectTrusted = new ProjectTrustStore(session.agentDir).get(cwd) === true;
82
93
  return {
83
94
  model: session.model,
84
95
  thinkingLevel: session.thinkingLevel,
@@ -146,8 +157,28 @@ function loadedSurfacesFingerprint(session, extensions, mcpServers) {
146
157
  * wiring, and process exit are intentionally NOT done here.
147
158
  */
148
159
  export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
149
- const clientCapabilities = options.capabilities;
160
+ let clientCapabilities = options.capabilities;
150
161
  const routingSessionId = options.sessionId;
162
+ const clientWidth = () => options.sharedWidth?.getWidth() ?? 80;
163
+ const hasRenderedComponents = () => (options.sharedWidth?.hasRenderedComponents?.(routingSessionId ?? "") ?? false) ||
164
+ (clientCapabilities?.includes(RENDERED_COMPONENTS_CAPABILITY) ?? false);
165
+ const liveRenderers = new Map();
166
+ const retainedRendererFactories = new Map();
167
+ const footerProviders = new Map();
168
+ const disposeRenderer = (key) => {
169
+ liveRenderers.get(key)?.dispose();
170
+ liveRenderers.delete(key);
171
+ footerProviders.get(key)?.dispose();
172
+ footerProviders.delete(key);
173
+ };
174
+ const disposeAllRenderers = () => {
175
+ for (const renderer of liveRenderers.values())
176
+ renderer.dispose();
177
+ for (const provider of footerProviders.values())
178
+ provider.dispose();
179
+ liveRenderers.clear();
180
+ footerProviders.clear();
181
+ };
151
182
  // True only while THIS connection's own command drives a replacement; the issuer
152
183
  // already learns the new identity from its command response.
153
184
  let replacementIssuedHere = false;
@@ -328,6 +359,8 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
328
359
  // Hidden thinking label not supported in RPC mode - requires TUI message rendering access
329
360
  },
330
361
  setWidget(key, content, options) {
362
+ disposeRenderer(key);
363
+ retainedRendererFactories.delete(key);
331
364
  if (content === undefined || Array.isArray(content)) {
332
365
  output({
333
366
  type: "extension_ui_request",
@@ -339,18 +372,95 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
339
372
  });
340
373
  return;
341
374
  }
342
- // A component factory closes over live TUI/theme state and cannot cross
343
- // the RPC boundary. Never drop it silently: an opted-in client can show
344
- // the same explicit degradation notice used by ctx.ui.custom.
345
- const request = buildCustomUnsupportedRequest(clientCapabilities, "widget component");
346
- if (request)
347
- output(request);
375
+ retainedRendererFactories.set(key, () => {
376
+ const renderer = createLiveComponentRenderer({
377
+ factory: content,
378
+ getWidth: clientWidth,
379
+ emit: (widgetLines) => output({
380
+ type: "extension_ui_request",
381
+ id: crypto.randomUUID(),
382
+ method: "setWidget",
383
+ widgetKey: key,
384
+ widgetLines,
385
+ widgetPlacement: options?.placement,
386
+ [RENDERED_COMPONENT_RECORD]: true,
387
+ }),
388
+ });
389
+ if (renderer)
390
+ liveRenderers.set(key, renderer);
391
+ });
392
+ if (hasRenderedComponents())
393
+ retainedRendererFactories.get(key)();
348
394
  },
349
- setFooter(_factory) {
350
- // Custom footer not supported in RPC mode - requires TUI access
395
+ setFooter(factory) {
396
+ const key = "__footer__";
397
+ disposeRenderer(key);
398
+ retainedRendererFactories.delete(key);
399
+ if (factory === undefined) {
400
+ if (hasRenderedComponents())
401
+ output({
402
+ type: "extension_ui_request",
403
+ id: crypto.randomUUID(),
404
+ method: "setFooter",
405
+ widgetLines: undefined,
406
+ });
407
+ return;
408
+ }
409
+ retainedRendererFactories.set(key, () => {
410
+ const provider = options.footerDataProviderFactory?.(session) ?? createFooterDataProvider(session);
411
+ const renderer = createLiveComponentRenderer({
412
+ factory: factory,
413
+ factoryArgs: [provider],
414
+ getWidth: clientWidth,
415
+ emit: (widgetLines) => output({
416
+ type: "extension_ui_request",
417
+ id: crypto.randomUUID(),
418
+ method: "setFooter",
419
+ widgetLines,
420
+ [RENDERED_COMPONENT_RECORD]: true,
421
+ }),
422
+ });
423
+ if (renderer) {
424
+ liveRenderers.set(key, renderer);
425
+ footerProviders.set(key, provider);
426
+ }
427
+ else
428
+ provider.dispose();
429
+ });
430
+ if (hasRenderedComponents())
431
+ retainedRendererFactories.get(key)();
351
432
  },
352
- setHeader(_factory) {
353
- // Custom header not supported in RPC mode - requires TUI access
433
+ setHeader(factory) {
434
+ const key = "__header__";
435
+ disposeRenderer(key);
436
+ retainedRendererFactories.delete(key);
437
+ if (factory === undefined) {
438
+ if (hasRenderedComponents())
439
+ output({
440
+ type: "extension_ui_request",
441
+ id: crypto.randomUUID(),
442
+ method: "setHeader",
443
+ widgetLines: undefined,
444
+ });
445
+ return;
446
+ }
447
+ retainedRendererFactories.set(key, () => {
448
+ const renderer = createLiveComponentRenderer({
449
+ factory: factory,
450
+ getWidth: clientWidth,
451
+ emit: (widgetLines) => output({
452
+ type: "extension_ui_request",
453
+ id: crypto.randomUUID(),
454
+ method: "setHeader",
455
+ widgetLines,
456
+ [RENDERED_COMPONENT_RECORD]: true,
457
+ }),
458
+ });
459
+ if (renderer)
460
+ liveRenderers.set(key, renderer);
461
+ });
462
+ if (hasRenderedComponents())
463
+ retainedRendererFactories.get(key)();
354
464
  },
355
465
  setTitle(title) {
356
466
  // Fire and forget - host can implement terminal title control
@@ -499,7 +609,7 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
499
609
  // the window the refresh takes.
500
610
  outputEvent({
501
611
  type: "session_replaced",
502
- sessionId: session.sessionId,
612
+ durableSessionId: session.sessionId,
503
613
  sessionFile: session.sessionFile,
504
614
  cwd: session.sessionManager.getCwd(),
505
615
  sessionName: session.sessionName,
@@ -512,6 +622,17 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
512
622
  })
513
623
  : undefined;
514
624
  subscribeLoadedSurfaceEvents();
625
+ // Subscribe to the replaced session before its bind runs, not after. The bind
626
+ // is deferred by design - awaiting it would deadlock a client whose
627
+ // session_start handler blocks on an extension_ui_request it cannot answer
628
+ // while still awaiting the replacement response - and it still mutates the
629
+ // session it owns: pi-rules appends a durable scan entry from session_start.
630
+ // Those entries must reach every attached connection, and nothing else can
631
+ // carry them, because the session file is not written until an assistant
632
+ // message exists, so a client that misses the notification can never
633
+ // reconstruct the session it is bound to. Installing here also drops the
634
+ // previous session's subscription immediately instead of after the bind.
635
+ installSessionSubscriptions();
515
636
  const refresh = refreshLoadedSurfacesAfter(() => session.bindExtensions({
516
637
  uiContext: createExtensionUIContext(),
517
638
  mode: "rpc",
@@ -557,7 +678,7 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
557
678
  });
558
679
  },
559
680
  }), true);
560
- const installSessionSubscriptions = () => {
681
+ function installSessionSubscriptions() {
561
682
  unsubscribe?.();
562
683
  unsubscribeBackpressure?.();
563
684
  unsubscribe = session.subscribe((event) => {
@@ -592,15 +713,17 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
592
713
  unsubscribeBackpressure = session.agent.subscribe(async () => {
593
714
  await waitForRpcBackpressure();
594
715
  });
595
- };
716
+ }
596
717
  if (deferRefresh) {
597
- void refresh.then(installSessionSubscriptions, (cause) => {
718
+ // The subscription is already installed on the replaced session above, so
719
+ // the deferred refresh only needs its failure reported. Re-installing here
720
+ // would replay the settings-source selection a second time.
721
+ void refresh.catch((cause) => {
598
722
  outputEvent({ type: "rpc_error", error: String(cause) });
599
723
  });
600
724
  return;
601
725
  }
602
726
  await refresh;
603
- installSessionSubscriptions();
604
727
  };
605
728
  /**
606
729
  * Drive an OAuth login for one provider as fire-command-then-subscribe.
@@ -684,7 +807,9 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
684
807
  data: {
685
808
  protocolVersion: 1,
686
809
  serverVersion: VERSION,
687
- capabilities: [...new Set(["multi_session", ...(options.capabilities ?? [])])],
810
+ capabilities: [
811
+ ...new Set(["multi_session", AUTO_TITLE_SESSIONS_CAPABILITY, ...(options.capabilities ?? [])]),
812
+ ],
688
813
  mode: "classic",
689
814
  },
690
815
  };
@@ -759,7 +884,10 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
759
884
  return success(id, "follow_up");
760
885
  }
761
886
  case "abort": {
762
- await session.abort();
887
+ void session.abort().catch((cause) => {
888
+ // Abort is acknowledged once dispatched; report quiesce failures out of band.
889
+ outputEvent({ type: "rpc_error", error: String(cause) });
890
+ });
763
891
  return success(id, "abort");
764
892
  }
765
893
  case "abort_compaction": {
@@ -798,6 +926,21 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
798
926
  // =================================================================
799
927
  // State
800
928
  // =================================================================
929
+ case "set_client_info":
930
+ if (options.sharedWidth && command.capabilities !== undefined) {
931
+ clientCapabilities = command.capabilities;
932
+ options.sharedWidth.setCapabilities?.(options.sharedWidth.connectionId(), command.capabilities);
933
+ }
934
+ if (Number.isFinite(command.width) && command.width > 0) {
935
+ if (options.sharedWidth) {
936
+ options.sharedWidth.setWidth(options.sharedWidth.connectionId(), command.width);
937
+ options.sharedWidth.onChange?.();
938
+ }
939
+ else
940
+ for (const renderer of liveRenderers.values())
941
+ renderer.rerender();
942
+ }
943
+ return success(id, "set_client_info");
801
944
  case "get_state":
802
945
  return success(id, "get_state", buildRpcSessionState(session, lastAbortSource));
803
946
  // =================================================================
@@ -1192,6 +1335,7 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
1192
1335
  }
1193
1336
  };
1194
1337
  const dispose = async () => {
1338
+ disposeAllRenderers();
1195
1339
  pendingExtensionRequests.close();
1196
1340
  unsubscribeProviderAccountEvents();
1197
1341
  unsubscribe?.();
@@ -1215,6 +1359,17 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
1215
1359
  await ready;
1216
1360
  await handleInputLine(line);
1217
1361
  },
1362
+ rerenderComponents() {
1363
+ if (!hasRenderedComponents()) {
1364
+ disposeAllRenderers();
1365
+ return;
1366
+ }
1367
+ for (const [key, createRenderer] of retainedRendererFactories)
1368
+ if (!liveRenderers.has(key))
1369
+ createRenderer();
1370
+ for (const renderer of liveRenderers.values())
1371
+ renderer.rerender();
1372
+ },
1218
1373
  isShutdownRequested() {
1219
1374
  return shutdownRequested;
1220
1375
  },