@code-yeongyu/senpi 2026.8.18 → 2026.8.19

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 (1899) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/cli/args.d.ts +1 -0
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +4 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/agent-session-services.d.ts +4 -1
  7. package/dist/core/agent-session-services.d.ts.map +1 -1
  8. package/dist/core/agent-session-services.js +1 -0
  9. package/dist/core/agent-session-services.js.map +1 -1
  10. package/dist/core/agent-session.d.ts +49 -25
  11. package/dist/core/agent-session.d.ts.map +1 -1
  12. package/dist/core/agent-session.js +376 -76
  13. package/dist/core/agent-session.js.map +1 -1
  14. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  15. package/dist/core/compaction/branch-summarization.js +3 -0
  16. package/dist/core/compaction/branch-summarization.js.map +1 -1
  17. package/dist/core/compaction/compaction.d.ts +20 -3
  18. package/dist/core/compaction/compaction.d.ts.map +1 -1
  19. package/dist/core/compaction/compaction.js +182 -52
  20. package/dist/core/compaction/compaction.js.map +1 -1
  21. package/dist/core/cursor-exec-bridge-session.d.ts +12 -1
  22. package/dist/core/cursor-exec-bridge-session.d.ts.map +1 -1
  23. package/dist/core/cursor-exec-bridge-session.js +17 -4
  24. package/dist/core/cursor-exec-bridge-session.js.map +1 -1
  25. package/dist/core/cursor-exec-bridge.d.ts +2 -2
  26. package/dist/core/cursor-exec-bridge.d.ts.map +1 -1
  27. package/dist/core/cursor-exec-bridge.js +29 -20
  28. package/dist/core/cursor-exec-bridge.js.map +1 -1
  29. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts +2 -1
  30. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts.map +1 -1
  31. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js +15 -6
  32. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js.map +1 -1
  33. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts +3 -0
  34. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts.map +1 -1
  35. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js +18 -1
  36. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -1
  37. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts +1 -0
  38. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts.map +1 -1
  39. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js +7 -1
  40. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +1 -1
  41. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts +4 -3
  42. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -1
  43. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.js +2 -2
  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-store.d.ts +29 -0
  46. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding-store.d.ts.map +1 -0
  47. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding-store.js +112 -0
  48. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding-store.js.map +1 -0
  49. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +37 -23
  50. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -1
  51. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +119 -33
  52. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -1
  53. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +1 -0
  54. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -1
  55. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +20 -2
  56. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -1
  57. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +3 -0
  58. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -1
  59. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +32 -2
  60. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -1
  61. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts +1 -1
  62. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -1
  63. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +78 -11
  64. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -1
  65. package/dist/core/extensions/builtin/claude-sdk-oauth/session-restored-admission.d.ts +8 -0
  66. package/dist/core/extensions/builtin/claude-sdk-oauth/session-restored-admission.d.ts.map +1 -0
  67. package/dist/core/extensions/builtin/claude-sdk-oauth/session-restored-admission.js +11 -0
  68. package/dist/core/extensions/builtin/claude-sdk-oauth/session-restored-admission.js.map +1 -0
  69. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -1
  70. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +17 -55
  71. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
  72. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts +13 -0
  73. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -1
  74. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +18 -5
  75. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
  76. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts +11 -0
  77. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +1 -0
  78. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js +48 -0
  79. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js.map +1 -0
  80. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts +8 -0
  81. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts.map +1 -1
  82. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js +18 -0
  83. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -1
  84. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts +7 -0
  85. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -1
  86. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js +10 -1
  87. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -1
  88. package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts +1 -0
  89. package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts.map +1 -1
  90. package/dist/core/extensions/builtin/cursor-cli-oauth/index.js +29 -1
  91. package/dist/core/extensions/builtin/cursor-cli-oauth/index.js.map +1 -1
  92. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
  93. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +30 -24
  94. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
  95. package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.d.ts +14 -0
  96. package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.d.ts.map +1 -0
  97. package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.js +58 -0
  98. package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.js.map +1 -0
  99. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts +12 -1
  100. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts.map +1 -1
  101. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js +20 -1
  102. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -1
  103. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts +11 -0
  104. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -1
  105. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +6 -1
  106. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -1
  107. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-model.d.ts +3 -0
  108. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-model.d.ts.map +1 -0
  109. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-model.js +5 -0
  110. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-model.js.map +1 -0
  111. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts.map +1 -1
  112. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js +11 -4
  113. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -1
  114. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts +8 -0
  115. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts.map +1 -1
  116. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.js +10 -0
  117. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.js.map +1 -1
  118. package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
  119. package/dist/core/extensions/builtin/goal/index.js +21 -3
  120. package/dist/core/extensions/builtin/goal/index.js.map +1 -1
  121. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +9 -0
  122. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  123. package/dist/core/extensions/builtin/goal/monitor-continuation.js +16 -0
  124. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  125. package/dist/core/extensions/builtin/goal/reload-reengagement.d.ts +30 -0
  126. package/dist/core/extensions/builtin/goal/reload-reengagement.d.ts.map +1 -0
  127. package/dist/core/extensions/builtin/goal/reload-reengagement.js +36 -0
  128. package/dist/core/extensions/builtin/goal/reload-reengagement.js.map +1 -0
  129. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  130. package/dist/core/extensions/builtin/index.js +2 -0
  131. package/dist/core/extensions/builtin/index.js.map +1 -1
  132. package/dist/core/extensions/builtin/loop/command-registration.d.ts +7 -0
  133. package/dist/core/extensions/builtin/loop/command-registration.d.ts.map +1 -0
  134. package/dist/core/extensions/builtin/loop/command-registration.js +13 -0
  135. package/dist/core/extensions/builtin/loop/command-registration.js.map +1 -0
  136. package/dist/core/extensions/builtin/loop/command.d.ts +41 -0
  137. package/dist/core/extensions/builtin/loop/command.d.ts.map +1 -0
  138. package/dist/core/extensions/builtin/loop/command.js +281 -0
  139. package/dist/core/extensions/builtin/loop/command.js.map +1 -0
  140. package/dist/core/extensions/builtin/loop/cron-planner.d.ts +23 -0
  141. package/dist/core/extensions/builtin/loop/cron-planner.d.ts.map +1 -0
  142. package/dist/core/extensions/builtin/loop/cron-planner.js +88 -0
  143. package/dist/core/extensions/builtin/loop/cron-planner.js.map +1 -0
  144. package/dist/core/extensions/builtin/loop/index.d.ts +134 -0
  145. package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -0
  146. package/dist/core/extensions/builtin/loop/index.js +742 -0
  147. package/dist/core/extensions/builtin/loop/index.js.map +1 -0
  148. package/dist/core/extensions/builtin/loop/loopfile.d.ts +40 -0
  149. package/dist/core/extensions/builtin/loop/loopfile.d.ts.map +1 -0
  150. package/dist/core/extensions/builtin/loop/loopfile.js +102 -0
  151. package/dist/core/extensions/builtin/loop/loopfile.js.map +1 -0
  152. package/dist/core/extensions/builtin/loop/parse.d.ts +45 -0
  153. package/dist/core/extensions/builtin/loop/parse.d.ts.map +1 -0
  154. package/dist/core/extensions/builtin/loop/parse.js +92 -0
  155. package/dist/core/extensions/builtin/loop/parse.js.map +1 -0
  156. package/dist/core/extensions/builtin/loop/scheduler.d.ts +225 -0
  157. package/dist/core/extensions/builtin/loop/scheduler.d.ts.map +1 -0
  158. package/dist/core/extensions/builtin/loop/scheduler.js +708 -0
  159. package/dist/core/extensions/builtin/loop/scheduler.js.map +1 -0
  160. package/dist/core/extensions/builtin/loop/status.d.ts +24 -0
  161. package/dist/core/extensions/builtin/loop/status.d.ts.map +1 -0
  162. package/dist/core/extensions/builtin/loop/status.js +113 -0
  163. package/dist/core/extensions/builtin/loop/status.js.map +1 -0
  164. package/dist/core/extensions/builtin/loop/store.d.ts +49 -0
  165. package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -0
  166. package/dist/core/extensions/builtin/loop/store.js +424 -0
  167. package/dist/core/extensions/builtin/loop/store.js.map +1 -0
  168. package/dist/core/extensions/builtin/loop/tick-prompt.d.ts +64 -0
  169. package/dist/core/extensions/builtin/loop/tick-prompt.d.ts.map +1 -0
  170. package/dist/core/extensions/builtin/loop/tick-prompt.js +183 -0
  171. package/dist/core/extensions/builtin/loop/tick-prompt.js.map +1 -0
  172. package/dist/core/extensions/builtin/loop/tools.d.ts +122 -0
  173. package/dist/core/extensions/builtin/loop/tools.d.ts.map +1 -0
  174. package/dist/core/extensions/builtin/loop/tools.js +155 -0
  175. package/dist/core/extensions/builtin/loop/tools.js.map +1 -0
  176. package/dist/core/extensions/builtin/loop/types.d.ts +206 -0
  177. package/dist/core/extensions/builtin/loop/types.d.ts.map +1 -0
  178. package/dist/core/extensions/builtin/loop/types.js +37 -0
  179. package/dist/core/extensions/builtin/loop/types.js.map +1 -0
  180. package/dist/core/extensions/index.d.ts +1 -1
  181. package/dist/core/extensions/index.d.ts.map +1 -1
  182. package/dist/core/extensions/index.js.map +1 -1
  183. package/dist/core/extensions/loader.d.ts.map +1 -1
  184. package/dist/core/extensions/loader.js +10 -5
  185. package/dist/core/extensions/loader.js.map +1 -1
  186. package/dist/core/extensions/types.d.ts +30 -3
  187. package/dist/core/extensions/types.d.ts.map +1 -1
  188. package/dist/core/extensions/types.js.map +1 -1
  189. package/dist/core/footer-data-provider.d.ts.map +1 -1
  190. package/dist/core/footer-data-provider.js +5 -10
  191. package/dist/core/footer-data-provider.js.map +1 -1
  192. package/dist/core/model-registry.d.ts +2 -0
  193. package/dist/core/model-registry.d.ts.map +1 -1
  194. package/dist/core/model-registry.js +4 -0
  195. package/dist/core/model-registry.js.map +1 -1
  196. package/dist/core/model-resolver.d.ts +15 -1
  197. package/dist/core/model-resolver.d.ts.map +1 -1
  198. package/dist/core/model-resolver.js +137 -43
  199. package/dist/core/model-resolver.js.map +1 -1
  200. package/dist/core/model-runtime.d.ts +7 -0
  201. package/dist/core/model-runtime.d.ts.map +1 -1
  202. package/dist/core/model-runtime.js +17 -0
  203. package/dist/core/model-runtime.js.map +1 -1
  204. package/dist/core/package-manager.d.ts.map +1 -1
  205. package/dist/core/package-manager.js +8 -4
  206. package/dist/core/package-manager.js.map +1 -1
  207. package/dist/core/provider-composer.d.ts +8 -0
  208. package/dist/core/provider-composer.d.ts.map +1 -1
  209. package/dist/core/provider-composer.js.map +1 -1
  210. package/dist/core/provider-timeout-retry.d.ts.map +1 -1
  211. package/dist/core/provider-timeout-retry.js +29 -1
  212. package/dist/core/provider-timeout-retry.js.map +1 -1
  213. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  214. package/dist/core/remote-catalog-provider.js +2 -1
  215. package/dist/core/remote-catalog-provider.js.map +1 -1
  216. package/dist/core/retry-fallback/chains.d.ts +1 -0
  217. package/dist/core/retry-fallback/chains.d.ts.map +1 -1
  218. package/dist/core/retry-fallback/chains.js +3 -0
  219. package/dist/core/retry-fallback/chains.js.map +1 -1
  220. package/dist/core/retry-fallback/controller.d.ts +2 -0
  221. package/dist/core/retry-fallback/controller.d.ts.map +1 -1
  222. package/dist/core/retry-fallback/controller.js.map +1 -1
  223. package/dist/core/retry-fallback/expansion.d.ts +8 -0
  224. package/dist/core/retry-fallback/expansion.d.ts.map +1 -1
  225. package/dist/core/retry-fallback/expansion.js +2 -0
  226. package/dist/core/retry-fallback/expansion.js.map +1 -1
  227. package/dist/core/sdk.d.ts +5 -0
  228. package/dist/core/sdk.d.ts.map +1 -1
  229. package/dist/core/sdk.js +47 -12
  230. package/dist/core/sdk.js.map +1 -1
  231. package/dist/core/session-manager.d.ts +5 -2
  232. package/dist/core/session-manager.d.ts.map +1 -1
  233. package/dist/core/session-manager.js +15 -6
  234. package/dist/core/session-manager.js.map +1 -1
  235. package/dist/core/settings-manager.d.ts +1 -1
  236. package/dist/core/settings-manager.d.ts.map +1 -1
  237. package/dist/core/settings-manager.js +14 -3
  238. package/dist/core/settings-manager.js.map +1 -1
  239. package/dist/core/skills.d.ts.map +1 -1
  240. package/dist/core/skills.js +51 -33
  241. package/dist/core/skills.js.map +1 -1
  242. package/dist/core/tools/edit.d.ts.map +1 -1
  243. package/dist/core/tools/edit.js +17 -2
  244. package/dist/core/tools/edit.js.map +1 -1
  245. package/dist/extensions/llama/index.d.ts.map +1 -1
  246. package/dist/extensions/llama/index.js +2 -0
  247. package/dist/extensions/llama/index.js.map +1 -1
  248. package/dist/extensions/llama/provider.d.ts.map +1 -1
  249. package/dist/extensions/llama/provider.js +6 -6
  250. package/dist/extensions/llama/provider.js.map +1 -1
  251. package/dist/index.d.ts +1 -1
  252. package/dist/index.d.ts.map +1 -1
  253. package/dist/index.js.map +1 -1
  254. package/dist/main.d.ts +4 -0
  255. package/dist/main.d.ts.map +1 -1
  256. package/dist/main.js +10 -4
  257. package/dist/main.js.map +1 -1
  258. package/dist/modes/interactive/components/settings-selector.js +1 -1
  259. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  260. package/dist/modes/interactive/editor-paste-transfer.d.ts +10 -1
  261. package/dist/modes/interactive/editor-paste-transfer.d.ts.map +1 -1
  262. package/dist/modes/interactive/editor-paste-transfer.js +27 -2
  263. package/dist/modes/interactive/editor-paste-transfer.js.map +1 -1
  264. package/dist/modes/interactive/interactive-mode.d.ts +69 -1
  265. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  266. package/dist/modes/interactive/interactive-mode.js +435 -63
  267. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  268. package/dist/modes/interactive/tips/catalog/dag-tips.d.ts +7 -0
  269. package/dist/modes/interactive/tips/catalog/dag-tips.d.ts.map +1 -0
  270. package/dist/modes/interactive/tips/catalog/dag-tips.js +57 -0
  271. package/dist/modes/interactive/tips/catalog/dag-tips.js.map +1 -0
  272. package/dist/modes/interactive/tips/catalog/memory-tips.d.ts +7 -0
  273. package/dist/modes/interactive/tips/catalog/memory-tips.d.ts.map +1 -0
  274. package/dist/modes/interactive/tips/catalog/memory-tips.js +100 -0
  275. package/dist/modes/interactive/tips/catalog/memory-tips.js.map +1 -0
  276. package/dist/modes/interactive/tips/registry.d.ts.map +1 -1
  277. package/dist/modes/interactive/tips/registry.js +4 -0
  278. package/dist/modes/interactive/tips/registry.js.map +1 -1
  279. package/dist/utils/management-http.d.ts +5 -3
  280. package/dist/utils/management-http.d.ts.map +1 -1
  281. package/dist/utils/management-http.js +14 -10
  282. package/dist/utils/management-http.js.map +1 -1
  283. package/docs/compaction.md +17 -0
  284. package/docs/custom-provider.md +5 -2
  285. package/docs/extensions.md +11 -2
  286. package/docs/llama-cpp.md +2 -0
  287. package/docs/models.md +8 -2
  288. package/docs/providers.md +9 -6
  289. package/docs/settings.md +22 -2
  290. package/docs/skills.md +4 -3
  291. package/examples/extensions/border-status-editor.ts +1 -1
  292. package/examples/extensions/git-checkpoint.ts +2 -2
  293. package/examples/extensions/notify.ts +3 -1
  294. package/examples/extensions/subagent/index.ts +6 -1
  295. package/examples/extensions/titlebar-spinner.ts +1 -1
  296. package/examples/rpc-extension-ui.ts +1 -1
  297. package/examples/sdk/06-extensions.ts +1 -1
  298. package/examples/sdk/README.md +1 -1
  299. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +40 -0
  300. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-string-parser/LICENSE +22 -0
  301. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-string-parser/README.md +19 -0
  302. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-string-parser/lib/index.d.ts +41 -0
  303. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-string-parser/lib/index.js +287 -0
  304. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -0
  305. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-string-parser/package.json +31 -0
  306. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
  307. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/README.md +19 -0
  308. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/identifier-browser.js +63 -0
  309. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/identifier-browser.js.map +1 -0
  310. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/identifier.js +61 -0
  311. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
  312. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/index.d.ts +28 -0
  313. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/index.js +28 -0
  314. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
  315. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/helper-validator-identifier/package.json +45 -0
  316. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/LICENSE +19 -0
  317. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/README.md +19 -0
  318. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/bin/babel-parser.js +14 -0
  319. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/lib/index.d.ts +1035 -0
  320. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/lib/index.js +14276 -0
  321. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/lib/index.js.map +1 -0
  322. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/package.json +57 -0
  323. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/parser/typings/babel-parser.d.ts +624 -0
  324. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/LICENSE +22 -0
  325. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/README.md +19 -0
  326. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/lib/index-legacy.d.ts +2743 -0
  327. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/lib/index.d.ts +3643 -0
  328. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/lib/index.js +11178 -0
  329. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/lib/index.js.flow +2596 -0
  330. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/lib/index.js.map +1 -0
  331. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/@babel/types/package.json +38 -0
  332. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/code.d.mts +12 -0
  333. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/code.mjs +65 -0
  334. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/compile.d.mts +6 -0
  335. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/compile.mjs +12 -0
  336. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/index.d.mts +8 -0
  337. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/index.mjs +14 -0
  338. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/validator.d.mts +35 -0
  339. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/compile/validator.mjs +91 -0
  340. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/error/errors.d.mts +208 -0
  341. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/error/errors.mjs +18 -0
  342. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/error/index.d.mts +1 -0
  343. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/error/index.mjs +1 -0
  344. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/_idna.d.mts +2 -0
  345. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/_idna.mjs +246 -0
  346. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/_puny.d.mts +1 -0
  347. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/_puny.mjs +77 -0
  348. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/_registry.d.mts +15 -0
  349. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/_registry.mjs +96 -0
  350. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/date.d.mts +6 -0
  351. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/date.mjs +19 -0
  352. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/date_time.d.mts +6 -0
  353. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/date_time.mjs +11 -0
  354. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/duration.d.mts +5 -0
  355. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/duration.mjs +8 -0
  356. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/email.d.mts +5 -0
  357. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/email.mjs +8 -0
  358. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/format.d.mts +22 -0
  359. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/format.mjs +22 -0
  360. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/hostname.d.mts +7 -0
  361. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/hostname.mjs +18 -0
  362. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/idn_email.d.mts +5 -0
  363. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/idn_email.mjs +8 -0
  364. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/idn_hostname.d.mts +7 -0
  365. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/idn_hostname.mjs +19 -0
  366. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/index.d.mts +4 -0
  367. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/index.mjs +4 -0
  368. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/ipv4.d.mts +6 -0
  369. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/ipv4.mjs +38 -0
  370. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/ipv6.d.mts +5 -0
  371. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/ipv6.mjs +67 -0
  372. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/iri.d.mts +5 -0
  373. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/iri.mjs +13 -0
  374. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/iri_reference.d.mts +5 -0
  375. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/iri_reference.mjs +60 -0
  376. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/json_pointer.d.mts +6 -0
  377. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/json_pointer.mjs +9 -0
  378. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +6 -0
  379. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +9 -0
  380. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/regex.d.mts +6 -0
  381. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/regex.mjs +17 -0
  382. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/relative_json_pointer.d.mts +6 -0
  383. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/relative_json_pointer.mjs +9 -0
  384. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/time.d.mts +5 -0
  385. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/time.mjs +27 -0
  386. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uri.d.mts +5 -0
  387. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uri.mjs +135 -0
  388. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uri_reference.d.mts +5 -0
  389. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uri_reference.mjs +9 -0
  390. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uri_template.d.mts +6 -0
  391. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uri_template.mjs +10 -0
  392. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/url.d.mts +6 -0
  393. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/url.mjs +9 -0
  394. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uuid.d.mts +6 -0
  395. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/format/uuid.mjs +9 -0
  396. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/emit.d.mts +56 -0
  397. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/emit.mjs +193 -0
  398. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/globals.d.mts +35 -0
  399. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/globals.mjs +90 -0
  400. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/guard.d.mts +71 -0
  401. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/guard.mjs +233 -0
  402. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/index.d.mts +6 -0
  403. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/index.mjs +6 -0
  404. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/native.d.mts +20 -0
  405. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/native.mjs +60 -0
  406. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/string.d.mts +6 -0
  407. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/guard/string.mjs +176 -0
  408. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/index.d.mts +8 -0
  409. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/index.mjs +14 -0
  410. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/build.d.mts +39 -0
  411. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/build.mjs +118 -0
  412. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/check.d.mts +6 -0
  413. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/check.mjs +14 -0
  414. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/compile.d.mts +22 -0
  415. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/compile.mjs +46 -0
  416. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_context.d.mts +35 -0
  417. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_context.mjs +129 -0
  418. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_exact_optional.d.mts +3 -0
  419. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_exact_optional.mjs +20 -0
  420. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_externals.d.mts +7 -0
  421. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_externals.mjs +25 -0
  422. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_functions.d.mts +6 -0
  423. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_functions.mjs +65 -0
  424. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_reducer.d.mts +4 -0
  425. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_reducer.mjs +45 -0
  426. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_refine.d.mts +6 -0
  427. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_refine.mjs +29 -0
  428. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_stack.d.mts +18 -0
  429. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_stack.mjs +107 -0
  430. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -0
  431. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/_unique.mjs +5 -0
  432. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/additionalItems.d.mts +6 -0
  433. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/additionalItems.mjs +60 -0
  434. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +9 -0
  435. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/additionalProperties.mjs +110 -0
  436. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/allOf.d.mts +6 -0
  437. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/allOf.mjs +47 -0
  438. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/anyOf.d.mts +6 -0
  439. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/anyOf.mjs +52 -0
  440. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/boolean.d.mts +5 -0
  441. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/boolean.mjs +25 -0
  442. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/const.d.mts +6 -0
  443. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/const.mjs +30 -0
  444. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/contains.d.mts +6 -0
  445. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/contains.mjs +54 -0
  446. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dependencies.d.mts +6 -0
  447. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dependencies.mjs +45 -0
  448. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
  449. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dependentRequired.mjs +40 -0
  450. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
  451. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +38 -0
  452. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
  453. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/dynamicRef.mjs +25 -0
  454. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/enum.d.mts +6 -0
  455. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/enum.mjs +33 -0
  456. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
  457. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +25 -0
  458. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
  459. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +25 -0
  460. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/format.d.mts +6 -0
  461. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/format.mjs +26 -0
  462. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/if.d.mts +6 -0
  463. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/if.mjs +47 -0
  464. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/index.d.mts +48 -0
  465. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/index.mjs +54 -0
  466. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/items.d.mts +6 -0
  467. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/items.mjs +88 -0
  468. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxContains.d.mts +6 -0
  469. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxContains.mjs +42 -0
  470. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxItems.d.mts +6 -0
  471. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxItems.mjs +25 -0
  472. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxLength.d.mts +6 -0
  473. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxLength.mjs +25 -0
  474. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxProperties.d.mts +6 -0
  475. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maxProperties.mjs +25 -0
  476. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maximum.d.mts +6 -0
  477. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/maximum.mjs +25 -0
  478. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minContains.d.mts +6 -0
  479. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minContains.mjs +51 -0
  480. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minItems.d.mts +6 -0
  481. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minItems.mjs +25 -0
  482. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minLength.d.mts +6 -0
  483. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minLength.mjs +25 -0
  484. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minProperties.d.mts +6 -0
  485. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minProperties.mjs +25 -0
  486. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minimum.d.mts +6 -0
  487. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/minimum.mjs +25 -0
  488. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/multipleOf.d.mts +6 -0
  489. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/multipleOf.mjs +25 -0
  490. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/not.d.mts +6 -0
  491. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/not.mjs +39 -0
  492. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/oneOf.d.mts +6 -0
  493. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/oneOf.mjs +59 -0
  494. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/pattern.d.mts +6 -0
  495. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/pattern.mjs +28 -0
  496. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/patternProperties.d.mts +6 -0
  497. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/patternProperties.mjs +44 -0
  498. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/prefixItems.d.mts +6 -0
  499. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/prefixItems.mjs +35 -0
  500. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/properties.d.mts +6 -0
  501. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/properties.mjs +75 -0
  502. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/propertyNames.d.mts +6 -0
  503. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/propertyNames.mjs +39 -0
  504. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
  505. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/recursiveRef.mjs +25 -0
  506. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/ref.d.mts +6 -0
  507. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/ref.mjs +52 -0
  508. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/required.d.mts +6 -0
  509. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/required.mjs +32 -0
  510. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/schema.d.mts +9 -0
  511. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/schema.mjs +347 -0
  512. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/type.d.mts +6 -0
  513. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/type.mjs +70 -0
  514. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
  515. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +51 -0
  516. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
  517. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +51 -0
  518. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
  519. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/engine/uniqueItems.mjs +51 -0
  520. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/errors.d.mts +6 -0
  521. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/errors.mjs +24 -0
  522. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/index.d.mts +3 -0
  523. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/index.mjs +9 -0
  524. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/parse.d.mts +13 -0
  525. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/parse.mjs +27 -0
  526. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/pointer/index.d.mts +2 -0
  527. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/pointer/index.mjs +2 -0
  528. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/pointer/pointer.d.mts +10 -0
  529. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/pointer/pointer.mjs +106 -0
  530. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/pointer/pointer_get.d.mts +9 -0
  531. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/pointer/pointer_get.mjs +2 -0
  532. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/resolve/index.d.mts +1 -0
  533. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/resolve/index.mjs +1 -0
  534. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/resolve/ref.d.mts +3 -0
  535. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/resolve/ref.mjs +146 -0
  536. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/resolve/resolve.d.mts +1 -0
  537. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/resolve/resolve.mjs +1 -0
  538. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/schema.d.mts +10 -0
  539. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/schema.mjs +10 -0
  540. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/_canonical.d.mts +7 -0
  541. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/_canonical.mjs +2 -0
  542. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/_comparer.d.mts +6 -0
  543. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/_comparer.mjs +2 -0
  544. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/_elements.d.mts +18 -0
  545. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/_elements.mjs +2 -0
  546. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/additionalProperties.d.mts +7 -0
  547. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/additionalProperties.mjs +3 -0
  548. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/allOf.d.mts +3 -0
  549. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/allOf.mjs +2 -0
  550. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/anyOf.d.mts +3 -0
  551. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/anyOf.mjs +2 -0
  552. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/const.d.mts +1 -0
  553. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/const.mjs +2 -0
  554. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/enum.d.mts +1 -0
  555. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/enum.mjs +2 -0
  556. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/if.d.mts +15 -0
  557. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/if.mjs +2 -0
  558. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/index.d.mts +1 -0
  559. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/index.mjs +1 -0
  560. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/items.d.mts +7 -0
  561. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/items.mjs +2 -0
  562. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/oneOf.d.mts +3 -0
  563. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/oneOf.mjs +2 -0
  564. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/patternProperties.d.mts +7 -0
  565. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/patternProperties.mjs +2 -0
  566. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/prefixItems.d.mts +3 -0
  567. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/prefixItems.mjs +2 -0
  568. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/properties.d.mts +32 -0
  569. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/properties.mjs +2 -0
  570. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/ref.d.mts +8 -0
  571. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/ref.mjs +3 -0
  572. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/required.d.mts +3 -0
  573. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/required.mjs +3 -0
  574. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/schema.d.mts +56 -0
  575. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/schema.mjs +2 -0
  576. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/static.d.mts +4 -0
  577. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/static.mjs +3 -0
  578. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/type.d.mts +4 -0
  579. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/type.mjs +3 -0
  580. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/unevaluatedProperties.d.mts +7 -0
  581. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/static/unevaluatedProperties.mjs +3 -0
  582. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/_refine.d.mts +13 -0
  583. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/_refine.mjs +18 -0
  584. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/additionalItems.d.mts +9 -0
  585. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/additionalItems.mjs +14 -0
  586. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/additionalProperties.d.mts +9 -0
  587. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/additionalProperties.mjs +14 -0
  588. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/allOf.d.mts +9 -0
  589. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/allOf.mjs +15 -0
  590. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/anchor.d.mts +8 -0
  591. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/anchor.mjs +12 -0
  592. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/anyOf.d.mts +9 -0
  593. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/anyOf.mjs +15 -0
  594. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/const.d.mts +9 -0
  595. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/const.mjs +12 -0
  596. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/contains.d.mts +9 -0
  597. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/contains.mjs +14 -0
  598. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/contentEncoding.d.mts +9 -0
  599. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/contentEncoding.mjs +13 -0
  600. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/contentMediaType.d.mts +9 -0
  601. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/contentMediaType.mjs +13 -0
  602. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/default.d.mts +9 -0
  603. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/default.mjs +12 -0
  604. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/defs.d.mts +6 -0
  605. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/defs.mjs +12 -0
  606. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dependencies.d.mts +11 -0
  607. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dependencies.mjs +16 -0
  608. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dependentRequired.d.mts +9 -0
  609. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dependentRequired.mjs +15 -0
  610. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dependentSchemas.d.mts +9 -0
  611. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dependentSchemas.mjs +15 -0
  612. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dynamicAnchor.d.mts +8 -0
  613. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dynamicAnchor.mjs +12 -0
  614. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dynamicRef.d.mts +8 -0
  615. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/dynamicRef.mjs +12 -0
  616. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/else.d.mts +9 -0
  617. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/else.mjs +14 -0
  618. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/enum.d.mts +9 -0
  619. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/enum.mjs +13 -0
  620. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/exclusiveMaximum.d.mts +9 -0
  621. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs +13 -0
  622. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/exclusiveMinimum.d.mts +9 -0
  623. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs +13 -0
  624. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/format.d.mts +9 -0
  625. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/format.mjs +13 -0
  626. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/id.d.mts +9 -0
  627. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/id.mjs +13 -0
  628. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/if.d.mts +9 -0
  629. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/if.mjs +14 -0
  630. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/index.d.mts +53 -0
  631. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/index.mjs +59 -0
  632. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/items.d.mts +19 -0
  633. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/items.mjs +26 -0
  634. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxContains.d.mts +9 -0
  635. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxContains.mjs +13 -0
  636. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxItems.d.mts +9 -0
  637. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxItems.mjs +13 -0
  638. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxLength.d.mts +9 -0
  639. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxLength.mjs +13 -0
  640. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxProperties.d.mts +9 -0
  641. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maxProperties.mjs +13 -0
  642. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maximum.d.mts +9 -0
  643. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/maximum.mjs +13 -0
  644. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minContains.d.mts +9 -0
  645. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minContains.mjs +13 -0
  646. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minItems.d.mts +9 -0
  647. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minItems.mjs +13 -0
  648. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minLength.d.mts +9 -0
  649. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minLength.mjs +13 -0
  650. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minProperties.d.mts +9 -0
  651. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minProperties.mjs +13 -0
  652. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minimum.d.mts +9 -0
  653. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/minimum.mjs +13 -0
  654. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/multipleOf.d.mts +9 -0
  655. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/multipleOf.mjs +13 -0
  656. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/not.d.mts +9 -0
  657. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/not.mjs +14 -0
  658. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/oneOf.d.mts +9 -0
  659. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/oneOf.mjs +15 -0
  660. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/pattern.d.mts +9 -0
  661. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/pattern.mjs +14 -0
  662. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/patternProperties.d.mts +9 -0
  663. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/patternProperties.mjs +15 -0
  664. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/prefixItems.d.mts +8 -0
  665. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/prefixItems.mjs +14 -0
  666. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/properties.d.mts +9 -0
  667. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/properties.mjs +15 -0
  668. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/propertyNames.d.mts +9 -0
  669. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/propertyNames.mjs +15 -0
  670. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/recursiveAnchor.d.mts +12 -0
  671. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/recursiveAnchor.mjs +19 -0
  672. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/recursiveRef.d.mts +8 -0
  673. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/recursiveRef.mjs +12 -0
  674. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/ref.d.mts +9 -0
  675. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/ref.mjs +13 -0
  676. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/required.d.mts +9 -0
  677. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/required.mjs +14 -0
  678. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/schema.d.mts +9 -0
  679. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/schema.mjs +14 -0
  680. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/then.d.mts +9 -0
  681. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/then.mjs +14 -0
  682. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/type.d.mts +9 -0
  683. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/type.mjs +15 -0
  684. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/unevaluatedItems.d.mts +9 -0
  685. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/unevaluatedItems.mjs +14 -0
  686. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/unevaluatedProperties.d.mts +9 -0
  687. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs +14 -0
  688. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/uniqueItems.d.mts +9 -0
  689. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/schema/types/uniqueItems.mjs +13 -0
  690. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/arguments/arguments.d.mts +5 -0
  691. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/arguments/arguments.mjs +9 -0
  692. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/arguments/index.d.mts +1 -0
  693. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/arguments/index.mjs +1 -0
  694. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/environment/environment.d.mts +1 -0
  695. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/environment/environment.mjs +1 -0
  696. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/environment/evaluate.d.mts +9 -0
  697. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/environment/evaluate.mjs +37 -0
  698. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/environment/index.d.mts +1 -0
  699. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/environment/index.mjs +1 -0
  700. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/hashing/hash.d.mts +4 -0
  701. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/hashing/hash.mjs +232 -0
  702. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/hashing/index.d.mts +1 -0
  703. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/hashing/index.mjs +1 -0
  704. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/index.d.mts +4 -0
  705. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/index.mjs +4 -0
  706. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/_config.d.mts +7 -0
  707. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/_config.mjs +15 -0
  708. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/_locale.d.mts +40 -0
  709. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/_locale.mjs +40 -0
  710. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ar_001.d.mts +3 -0
  711. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ar_001.mjs +40 -0
  712. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/bn_BD.d.mts +3 -0
  713. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/bn_BD.mjs +40 -0
  714. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/cs_CZ.d.mts +3 -0
  715. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/cs_CZ.mjs +40 -0
  716. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/de_DE.d.mts +3 -0
  717. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/de_DE.mjs +40 -0
  718. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/el_GR.d.mts +3 -0
  719. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/el_GR.mjs +40 -0
  720. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/en_US.d.mts +3 -0
  721. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/en_US.mjs +39 -0
  722. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_419.d.mts +3 -0
  723. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_419.mjs +40 -0
  724. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_AR.d.mts +3 -0
  725. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_AR.mjs +40 -0
  726. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_ES.d.mts +3 -0
  727. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_ES.mjs +40 -0
  728. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_MX.d.mts +3 -0
  729. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/es_MX.mjs +40 -0
  730. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fa_IR.d.mts +3 -0
  731. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fa_IR.mjs +40 -0
  732. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fil_PH.d.mts +3 -0
  733. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fil_PH.mjs +40 -0
  734. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fr_CA.d.mts +3 -0
  735. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fr_CA.mjs +40 -0
  736. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fr_FR.d.mts +3 -0
  737. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/fr_FR.mjs +40 -0
  738. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ha_NG.d.mts +3 -0
  739. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ha_NG.mjs +40 -0
  740. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/hi_IN.d.mts +3 -0
  741. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/hi_IN.mjs +40 -0
  742. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/hu_HU.d.mts +3 -0
  743. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/hu_HU.mjs +40 -0
  744. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/id_ID.d.mts +3 -0
  745. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/id_ID.mjs +40 -0
  746. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/index.d.mts +1 -0
  747. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/index.mjs +1 -0
  748. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/it_IT.d.mts +3 -0
  749. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/it_IT.mjs +40 -0
  750. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ja_JP.d.mts +3 -0
  751. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ja_JP.mjs +40 -0
  752. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ko_KR.d.mts +3 -0
  753. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ko_KR.mjs +40 -0
  754. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ms_MY.d.mts +3 -0
  755. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ms_MY.mjs +40 -0
  756. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/nl_NL.d.mts +3 -0
  757. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/nl_NL.mjs +40 -0
  758. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/pl_PL.d.mts +3 -0
  759. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/pl_PL.mjs +40 -0
  760. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/pt_BR.d.mts +3 -0
  761. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/pt_BR.mjs +40 -0
  762. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/pt_PT.d.mts +3 -0
  763. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/pt_PT.mjs +40 -0
  764. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ro_RO.d.mts +3 -0
  765. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ro_RO.mjs +40 -0
  766. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ru_RU.d.mts +3 -0
  767. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ru_RU.mjs +40 -0
  768. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/sv_SE.d.mts +3 -0
  769. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/sv_SE.mjs +40 -0
  770. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/sw_TZ.d.mts +3 -0
  771. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/sw_TZ.mjs +40 -0
  772. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/th_TH.d.mts +3 -0
  773. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/th_TH.mjs +40 -0
  774. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/tr_TR.d.mts +3 -0
  775. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/tr_TR.mjs +40 -0
  776. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/uk_UA.d.mts +3 -0
  777. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/uk_UA.mjs +40 -0
  778. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ur_PK.d.mts +3 -0
  779. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/ur_PK.mjs +40 -0
  780. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/vi_VN.d.mts +3 -0
  781. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/vi_VN.mjs +40 -0
  782. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/yo_NG.d.mts +3 -0
  783. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/yo_NG.mjs +40 -0
  784. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/zh_Hans.d.mts +3 -0
  785. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/zh_Hans.mjs +40 -0
  786. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/zh_Hant.d.mts +3 -0
  787. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/locale/zh_Hant.mjs +40 -0
  788. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/assign.d.mts +14 -0
  789. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/assign.mjs +11 -0
  790. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/clone.d.mts +5 -0
  791. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/clone.mjs +110 -0
  792. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/create.d.mts +8 -0
  793. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/create.mjs +30 -0
  794. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/discard.d.mts +4 -0
  795. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/discard.mjs +17 -0
  796. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/index.d.mts +1 -0
  797. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/index.mjs +1 -0
  798. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/memory.d.mts +6 -0
  799. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/memory.mjs +7 -0
  800. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/metrics.d.mts +14 -0
  801. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/metrics.mjs +8 -0
  802. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/update.d.mts +7 -0
  803. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/memory/update.mjs +32 -0
  804. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/settings/index.d.mts +1 -0
  805. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/settings/index.mjs +1 -0
  806. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/settings/settings.d.mts +71 -0
  807. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/settings/settings.mjs +34 -0
  808. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/system.d.mts +6 -0
  809. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/system.mjs +6 -0
  810. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/unreachable/index.d.mts +1 -0
  811. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/unreachable/index.mjs +1 -0
  812. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/unreachable/unreachable.d.mts +3 -0
  813. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/system/unreachable/unreachable.mjs +6 -0
  814. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  815. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  816. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  817. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  818. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  819. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  820. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  821. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  822. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  823. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  824. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  825. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  826. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/capitalize.d.mts +11 -0
  827. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/capitalize.mjs +11 -0
  828. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/conditional.d.mts +12 -0
  829. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/conditional.mjs +13 -0
  830. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/constructor_parameters.d.mts +11 -0
  831. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/constructor_parameters.mjs +11 -0
  832. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/evaluate.d.mts +11 -0
  833. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/evaluate.mjs +11 -0
  834. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/exclude.d.mts +11 -0
  835. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/exclude.mjs +11 -0
  836. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/extract.d.mts +11 -0
  837. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/extract.mjs +11 -0
  838. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/index.d.mts +30 -0
  839. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/index.mjs +30 -0
  840. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/indexed.d.mts +14 -0
  841. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/indexed.mjs +14 -0
  842. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/instance_type.d.mts +11 -0
  843. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/instance_type.mjs +11 -0
  844. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/interface.d.mts +14 -0
  845. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/interface.mjs +22 -0
  846. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/keyof.d.mts +11 -0
  847. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/keyof.mjs +11 -0
  848. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/lowercase.d.mts +11 -0
  849. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/lowercase.mjs +11 -0
  850. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/mapped.d.mts +13 -0
  851. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/mapped.mjs +13 -0
  852. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/module.d.mts +13 -0
  853. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/module.mjs +13 -0
  854. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/non_nullable.d.mts +11 -0
  855. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/non_nullable.mjs +11 -0
  856. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/omit.d.mts +14 -0
  857. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/omit.mjs +14 -0
  858. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/parameters.d.mts +11 -0
  859. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/parameters.mjs +11 -0
  860. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/partial.d.mts +11 -0
  861. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/partial.mjs +11 -0
  862. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/pick.d.mts +14 -0
  863. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/pick.mjs +14 -0
  864. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/readonly_object.d.mts +16 -0
  865. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/readonly_object.mjs +19 -0
  866. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/required.d.mts +11 -0
  867. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/required.mjs +11 -0
  868. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/return_type.d.mts +11 -0
  869. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/return_type.mjs +11 -0
  870. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/uncapitalize.d.mts +11 -0
  871. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/uncapitalize.mjs +11 -0
  872. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/uppercase.d.mts +11 -0
  873. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/uppercase.mjs +11 -0
  874. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/with.d.mts +11 -0
  875. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/action/with.mjs +11 -0
  876. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +15 -0
  877. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +53 -0
  878. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/instantiate.d.mts +21 -0
  879. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/instantiate.mjs +49 -0
  880. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/resolve_arguments.d.mts +13 -0
  881. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +33 -0
  882. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/resolve_target.d.mts +25 -0
  883. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/call/resolve_target.mjs +27 -0
  884. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/conditional/index.d.mts +1 -0
  885. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/conditional/index.mjs +1 -0
  886. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/conditional/instantiate.d.mts +12 -0
  887. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/conditional/instantiate.mjs +23 -0
  888. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/constructor_parameters/index.d.mts +1 -0
  889. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/constructor_parameters/index.mjs +1 -0
  890. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +14 -0
  891. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +25 -0
  892. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +8 -0
  893. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +16 -0
  894. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/check.d.mts +21 -0
  895. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/check.mjs +45 -0
  896. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +22 -0
  897. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +47 -0
  898. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +28 -0
  899. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/extends.mjs +47 -0
  900. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/index.d.mts +6 -0
  901. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/index.mjs +6 -0
  902. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +17 -0
  903. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +31 -0
  904. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/target.d.mts +10 -0
  905. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/cyclic/target.mjs +16 -0
  906. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/enum/index.d.mts +1 -0
  907. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/enum/index.mjs +1 -0
  908. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.d.mts +8 -0
  909. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs +9 -0
  910. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +15 -0
  911. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +43 -0
  912. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +15 -0
  913. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/compare.mjs +22 -0
  914. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +34 -0
  915. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/composite.mjs +67 -0
  916. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +28 -0
  917. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +45 -0
  918. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +26 -0
  919. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +53 -0
  920. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +6 -0
  921. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +11 -0
  922. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/index.d.mts +8 -0
  923. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/index.mjs +8 -0
  924. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/instantiate.d.mts +8 -0
  925. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs +12 -0
  926. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -0
  927. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +11 -0
  928. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/exclude/index.d.mts +1 -0
  929. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/exclude/index.mjs +1 -0
  930. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/exclude/instantiate.d.mts +9 -0
  931. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/exclude/instantiate.mjs +16 -0
  932. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/exclude/operation.d.mts +10 -0
  933. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/exclude/operation.mjs +23 -0
  934. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/extract/index.d.mts +1 -0
  935. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/extract/index.mjs +1 -0
  936. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/extract/instantiate.d.mts +9 -0
  937. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/extract/instantiate.mjs +16 -0
  938. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/extract/operation.d.mts +10 -0
  939. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/extract/operation.mjs +23 -0
  940. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/index.d.mts +3 -0
  941. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/index.mjs +3 -0
  942. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/keys.d.mts +3 -0
  943. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/keys.mjs +8 -0
  944. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.d.mts +7 -0
  945. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs +15 -0
  946. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/union.d.mts +7 -0
  947. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/helpers/union.mjs +3 -0
  948. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  949. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  950. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  951. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  952. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/index.d.mts +31 -0
  953. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/index.mjs +37 -0
  954. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_cyclic.d.mts +6 -0
  955. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs +8 -0
  956. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  957. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  958. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +6 -0
  959. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +8 -0
  960. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_intersect.d.mts +5 -0
  961. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs +8 -0
  962. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_literal.d.mts +3 -0
  963. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_literal.mjs +5 -0
  964. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +5 -0
  965. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +8 -0
  966. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +19 -0
  967. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_type.mjs +25 -0
  968. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_union.d.mts +4 -0
  969. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/from_union.mjs +7 -0
  970. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/to_indexable.d.mts +9 -0
  971. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs +14 -0
  972. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.d.mts +10 -0
  973. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs +12 -0
  974. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/array_indexer.d.mts +12 -0
  975. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs +18 -0
  976. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_array.d.mts +15 -0
  977. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_array.mjs +35 -0
  978. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_object.d.mts +16 -0
  979. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_object.mjs +40 -0
  980. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_tuple.d.mts +13 -0
  981. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs +35 -0
  982. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_type.d.mts +11 -0
  983. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/from_type.mjs +14 -0
  984. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/index.d.mts +1 -0
  985. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/index.mjs +1 -0
  986. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +16 -0
  987. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +28 -0
  988. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/instance_type/index.d.mts +1 -0
  989. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/instance_type/index.mjs +1 -0
  990. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/instance_type/instantiate.d.mts +12 -0
  991. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs +21 -0
  992. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/instantiate.d.mts +178 -0
  993. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/instantiate.mjs +158 -0
  994. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/interface/index.d.mts +1 -0
  995. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/interface/index.mjs +1 -0
  996. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +15 -0
  997. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/interface/instantiate.mjs +23 -0
  998. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_literal.d.mts +5 -0
  999. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs +9 -0
  1000. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +6 -0
  1001. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +8 -0
  1002. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_type.d.mts +10 -0
  1003. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs +13 -0
  1004. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_union.d.mts +6 -0
  1005. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs +7 -0
  1006. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/index.d.mts +1 -0
  1007. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/index.mjs +1 -0
  1008. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/instantiate.d.mts +38 -0
  1009. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs +52 -0
  1010. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/mapping.d.mts +9 -0
  1011. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs +4 -0
  1012. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_any.d.mts +6 -0
  1013. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_any.mjs +8 -0
  1014. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_array.d.mts +4 -0
  1015. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_array.mjs +5 -0
  1016. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_object.d.mts +10 -0
  1017. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_object.mjs +20 -0
  1018. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_record.d.mts +4 -0
  1019. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_record.mjs +5 -0
  1020. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_tuple.d.mts +5 -0
  1021. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs +7 -0
  1022. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_type.d.mts +15 -0
  1023. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/from_type.mjs +23 -0
  1024. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/index.d.mts +1 -0
  1025. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/index.mjs +1 -0
  1026. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +16 -0
  1027. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +29 -0
  1028. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/index.d.mts +1 -0
  1029. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/index.mjs +1 -0
  1030. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/instantiate.d.mts +10 -0
  1031. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/instantiate.mjs +15 -0
  1032. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +22 -0
  1033. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +42 -0
  1034. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +17 -0
  1035. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +39 -0
  1036. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/module/index.d.mts +1 -0
  1037. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/module/index.mjs +1 -0
  1038. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/module/instantiate.d.mts +19 -0
  1039. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/module/instantiate.mjs +36 -0
  1040. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/non_nullable/index.d.mts +1 -0
  1041. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/non_nullable/index.mjs +1 -0
  1042. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/non_nullable/instantiate.d.mts +14 -0
  1043. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs +22 -0
  1044. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/collapse.d.mts +12 -0
  1045. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/collapse.mjs +14 -0
  1046. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_cyclic.d.mts +6 -0
  1047. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_cyclic.mjs +8 -0
  1048. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  1049. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  1050. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +17 -0
  1051. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_intersect.mjs +22 -0
  1052. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_object.d.mts +3 -0
  1053. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_object.mjs +4 -0
  1054. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_tuple.d.mts +6 -0
  1055. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_tuple.mjs +9 -0
  1056. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_type.d.mts +16 -0
  1057. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_type.mjs +23 -0
  1058. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_union.d.mts +12 -0
  1059. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/from_union.mjs +19 -0
  1060. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/index.d.mts +1 -0
  1061. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/object/index.mjs +1 -0
  1062. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/omit/from_type.d.mts +12 -0
  1063. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/omit/from_type.mjs +18 -0
  1064. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/omit/index.d.mts +1 -0
  1065. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/omit/index.mjs +1 -0
  1066. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/omit/instantiate.d.mts +9 -0
  1067. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/omit/instantiate.mjs +16 -0
  1068. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  1069. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  1070. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  1071. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  1072. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/parameters/index.d.mts +1 -0
  1073. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/parameters/index.mjs +1 -0
  1074. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +14 -0
  1075. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +25 -0
  1076. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_cyclic.d.mts +10 -0
  1077. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs +11 -0
  1078. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  1079. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  1080. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +5 -0
  1081. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +8 -0
  1082. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_object.d.mts +8 -0
  1083. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_object.mjs +11 -0
  1084. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_type.d.mts +14 -0
  1085. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_type.mjs +20 -0
  1086. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_union.d.mts +5 -0
  1087. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/from_union.mjs +7 -0
  1088. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/index.d.mts +1 -0
  1089. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/index.mjs +1 -0
  1090. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/instantiate.d.mts +9 -0
  1091. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/partial/instantiate.mjs +15 -0
  1092. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/patterns/index.d.mts +2 -0
  1093. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/patterns/index.mjs +2 -0
  1094. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/patterns/pattern.d.mts +6 -0
  1095. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/patterns/pattern.mjs +11 -0
  1096. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/patterns/template.d.mts +7 -0
  1097. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/patterns/template.mjs +20 -0
  1098. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/pick/from_type.d.mts +13 -0
  1099. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/pick/from_type.mjs +20 -0
  1100. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/pick/index.d.mts +1 -0
  1101. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/pick/index.mjs +1 -0
  1102. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/pick/instantiate.d.mts +9 -0
  1103. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/pick/instantiate.mjs +16 -0
  1104. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  1105. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  1106. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  1107. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  1108. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  1109. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  1110. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  1111. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  1112. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +5 -0
  1113. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +7 -0
  1114. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.d.mts +10 -0
  1115. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs +11 -0
  1116. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  1117. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  1118. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +5 -0
  1119. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +8 -0
  1120. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +8 -0
  1121. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +11 -0
  1122. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +5 -0
  1123. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +7 -0
  1124. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +18 -0
  1125. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +25 -0
  1126. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_union.d.mts +5 -0
  1127. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs +7 -0
  1128. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/index.d.mts +1 -0
  1129. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/index.mjs +1 -0
  1130. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/instantiate.d.mts +9 -0
  1131. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs +15 -0
  1132. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key.d.mts +24 -0
  1133. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key.mjs +40 -0
  1134. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_any.d.mts +4 -0
  1135. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_any.mjs +6 -0
  1136. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_boolean.d.mts +7 -0
  1137. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs +5 -0
  1138. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +6 -0
  1139. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +8 -0
  1140. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_integer.d.mts +5 -0
  1141. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_integer.mjs +7 -0
  1142. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_intersect.d.mts +5 -0
  1143. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs +8 -0
  1144. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_literal.d.mts +11 -0
  1145. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_literal.mjs +10 -0
  1146. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_number.d.mts +5 -0
  1147. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_number.mjs +7 -0
  1148. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_string.d.mts +5 -0
  1149. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_string.mjs +12 -0
  1150. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +8 -0
  1151. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +12 -0
  1152. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_union.d.mts +20 -0
  1153. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/from_key_union.mjs +39 -0
  1154. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/index.d.mts +1 -0
  1155. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/index.mjs +1 -0
  1156. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/instantiate.d.mts +9 -0
  1157. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/instantiate.mjs +17 -0
  1158. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/record_create.d.mts +3 -0
  1159. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/record/record_create.mjs +7 -0
  1160. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/ref/index.d.mts +1 -0
  1161. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/ref/index.mjs +1 -0
  1162. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +6 -0
  1163. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/ref/instantiate.mjs +10 -0
  1164. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_cyclic.d.mts +10 -0
  1165. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_cyclic.mjs +11 -0
  1166. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  1167. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  1168. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +5 -0
  1169. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_intersect.mjs +8 -0
  1170. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_object.d.mts +8 -0
  1171. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_object.mjs +11 -0
  1172. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_type.d.mts +14 -0
  1173. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_type.mjs +20 -0
  1174. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_union.d.mts +5 -0
  1175. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/from_union.mjs +7 -0
  1176. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/index.d.mts +1 -0
  1177. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/index.mjs +1 -0
  1178. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/instantiate.d.mts +9 -0
  1179. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/required/instantiate.mjs +15 -0
  1180. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/rest/index.d.mts +1 -0
  1181. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/rest/index.mjs +1 -0
  1182. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/rest/spread.d.mts +12 -0
  1183. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/rest/spread.mjs +19 -0
  1184. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/return_type/index.d.mts +1 -0
  1185. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/return_type/index.mjs +1 -0
  1186. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/return_type/instantiate.d.mts +12 -0
  1187. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/return_type/instantiate.mjs +21 -0
  1188. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/create.d.mts +1 -0
  1189. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/create.mjs +5 -0
  1190. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/decode.d.mts +30 -0
  1191. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/decode.mjs +81 -0
  1192. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +33 -0
  1193. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/encode.mjs +81 -0
  1194. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/index.d.mts +6 -0
  1195. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/index.mjs +6 -0
  1196. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/instantiate.d.mts +9 -0
  1197. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs +15 -0
  1198. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/is_finite.d.mts +12 -0
  1199. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +26 -0
  1200. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/is_pattern.d.mts +6 -0
  1201. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +10 -0
  1202. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/static.d.mts +18 -0
  1203. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/template_literal/static.mjs +2 -0
  1204. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/this/expand_this.d.mts +16 -0
  1205. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/this/expand_this.mjs +26 -0
  1206. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/tuple/to_object.d.mts +12 -0
  1207. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/tuple/to_object.mjs +14 -0
  1208. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/with/index.d.mts +1 -0
  1209. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/with/index.mjs +1 -0
  1210. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  1211. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/engine/with/instantiate.mjs +14 -0
  1212. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/any.d.mts +9 -0
  1213. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/any.mjs +12 -0
  1214. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/array.d.mts +20 -0
  1215. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/array.mjs +21 -0
  1216. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/bigint.d.mts +7 -0
  1217. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/bigint.mjs +9 -0
  1218. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/boolean.d.mts +7 -0
  1219. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/boolean.mjs +9 -0
  1220. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/constructor.d.mts +10 -0
  1221. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/constructor.mjs +17 -0
  1222. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  1223. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  1224. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/enum.d.mts +7 -0
  1225. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/enum.mjs +7 -0
  1226. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/extends.d.mts +13 -0
  1227. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/extends.mjs +17 -0
  1228. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/extends_left.d.mts +53 -0
  1229. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/extends_left.mjs +80 -0
  1230. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/extends_right.d.mts +27 -0
  1231. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/extends_right.mjs +49 -0
  1232. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/function.d.mts +10 -0
  1233. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/function.mjs +17 -0
  1234. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/index.d.mts +2 -0
  1235. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/index.mjs +2 -0
  1236. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/inference.d.mts +34 -0
  1237. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/inference.mjs +62 -0
  1238. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/integer.d.mts +8 -0
  1239. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/integer.mjs +10 -0
  1240. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/intersect.d.mts +6 -0
  1241. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/intersect.mjs +15 -0
  1242. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/literal.d.mts +18 -0
  1243. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/literal.mjs +44 -0
  1244. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/never.d.mts +8 -0
  1245. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/never.mjs +9 -0
  1246. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/null.d.mts +7 -0
  1247. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/null.mjs +9 -0
  1248. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/number.d.mts +7 -0
  1249. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/number.mjs +9 -0
  1250. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/object.d.mts +32 -0
  1251. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/object.mjs +109 -0
  1252. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/parameters.d.mts +15 -0
  1253. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/parameters.mjs +28 -0
  1254. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  1255. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/record.mjs +23 -0
  1256. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/result.d.mts +24 -0
  1257. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/result.mjs +36 -0
  1258. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/return_type.d.mts +7 -0
  1259. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/return_type.mjs +9 -0
  1260. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/string.d.mts +7 -0
  1261. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/string.mjs +9 -0
  1262. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/symbol.d.mts +7 -0
  1263. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/symbol.mjs +9 -0
  1264. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/template_literal.d.mts +6 -0
  1265. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/template_literal.mjs +7 -0
  1266. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/tuple.d.mts +22 -0
  1267. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/tuple.mjs +61 -0
  1268. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/undefined.d.mts +8 -0
  1269. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/undefined.mjs +10 -0
  1270. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/union.d.mts +11 -0
  1271. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/union.mjs +24 -0
  1272. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/unknown.d.mts +9 -0
  1273. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/unknown.mjs +12 -0
  1274. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/void.d.mts +7 -0
  1275. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/extends/void.mjs +9 -0
  1276. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/index.d.mts +5 -0
  1277. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/index.mjs +5 -0
  1278. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/index.d.mts +1 -0
  1279. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/index.mjs +1 -0
  1280. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/mapping.d.mts +353 -0
  1281. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/mapping.mjs +535 -0
  1282. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/parser.d.mts +262 -0
  1283. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/parser.mjs +136 -0
  1284. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/script.d.mts +16 -0
  1285. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/script.mjs +22 -0
  1286. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/bigint.d.mts +8 -0
  1287. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/bigint.mjs +14 -0
  1288. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/const.d.mts +11 -0
  1289. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/const.mjs +18 -0
  1290. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/ident.d.mts +16 -0
  1291. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/ident.mjs +26 -0
  1292. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/index.d.mts +12 -0
  1293. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/index.mjs +12 -0
  1294. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/integer.d.mts +11 -0
  1295. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/integer.mjs +19 -0
  1296. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/char.d.mts +75 -0
  1297. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/char.mjs +26 -0
  1298. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -0
  1299. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/guard.mjs +15 -0
  1300. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/many.d.mts +7 -0
  1301. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/many.mjs +14 -0
  1302. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/match.d.mts +6 -0
  1303. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/match.mjs +11 -0
  1304. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/optional.d.mts +5 -0
  1305. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/optional.mjs +9 -0
  1306. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/take.d.mts +6 -0
  1307. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/take.mjs +30 -0
  1308. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/trim.d.mts +19 -0
  1309. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/internal/trim.mjs +34 -0
  1310. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/number.d.mts +11 -0
  1311. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/number.mjs +19 -0
  1312. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/rest.d.mts +4 -0
  1313. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/rest.mjs +9 -0
  1314. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/span.d.mts +11 -0
  1315. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/span.mjs +24 -0
  1316. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/string.d.mts +11 -0
  1317. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/string.mjs +20 -0
  1318. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/unsigned_integer.d.mts +16 -0
  1319. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/unsigned_integer.mjs +26 -0
  1320. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/unsigned_number.d.mts +17 -0
  1321. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/unsigned_number.mjs +38 -0
  1322. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/until.d.mts +7 -0
  1323. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/until.mjs +21 -0
  1324. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/until_1.d.mts +5 -0
  1325. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/script/token/until_1.mjs +12 -0
  1326. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_codec.d.mts +30 -0
  1327. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_codec.mjs +60 -0
  1328. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_immutable.d.mts +9 -0
  1329. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_immutable.mjs +18 -0
  1330. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_optional.d.mts +9 -0
  1331. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_optional.mjs +18 -0
  1332. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_readonly.d.mts +9 -0
  1333. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_readonly.mjs +18 -0
  1334. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_refine.d.mts +24 -0
  1335. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/_refine.mjs +36 -0
  1336. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/any.d.mts +10 -0
  1337. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/any.mjs +18 -0
  1338. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/array.d.mts +18 -0
  1339. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/array.mjs +25 -0
  1340. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/bigint.d.mts +12 -0
  1341. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/bigint.mjs +21 -0
  1342. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/boolean.d.mts +11 -0
  1343. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/boolean.mjs +17 -0
  1344. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/call.d.mts +16 -0
  1345. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/call.mjs +23 -0
  1346. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/constructor.d.mts +18 -0
  1347. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/constructor.mjs +24 -0
  1348. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/cyclic.d.mts +16 -0
  1349. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/cyclic.mjs +29 -0
  1350. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/deferred.d.mts +13 -0
  1351. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/deferred.mjs +16 -0
  1352. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  1353. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  1354. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/enum.d.mts +18 -0
  1355. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/enum.mjs +22 -0
  1356. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/function.d.mts +21 -0
  1357. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/function.mjs +25 -0
  1358. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/generic.d.mts +13 -0
  1359. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/generic.mjs +17 -0
  1360. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/identifier.d.mts +11 -0
  1361. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/identifier.mjs +17 -0
  1362. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/index.d.mts +45 -0
  1363. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/index.mjs +51 -0
  1364. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/infer.d.mts +15 -0
  1365. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/infer.mjs +20 -0
  1366. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/integer.d.mts +12 -0
  1367. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/integer.mjs +21 -0
  1368. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/intersect.d.mts +15 -0
  1369. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/intersect.mjs +24 -0
  1370. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/literal.d.mts +31 -0
  1371. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/literal.mjs +62 -0
  1372. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/never.d.mts +12 -0
  1373. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/never.mjs +22 -0
  1374. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/null.d.mts +11 -0
  1375. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/null.mjs +17 -0
  1376. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/number.d.mts +12 -0
  1377. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/number.mjs +21 -0
  1378. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/object.d.mts +18 -0
  1379. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/object.mjs +28 -0
  1380. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/parameter.d.mts +17 -0
  1381. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/parameter.mjs +21 -0
  1382. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/properties.d.mts +43 -0
  1383. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/properties.mjs +15 -0
  1384. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/record.d.mts +52 -0
  1385. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/record.mjs +66 -0
  1386. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/ref.d.mts +19 -0
  1387. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/ref.mjs +18 -0
  1388. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/rest.d.mts +11 -0
  1389. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/rest.mjs +17 -0
  1390. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/schema.d.mts +176 -0
  1391. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/schema.mjs +15 -0
  1392. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/static.d.mts +45 -0
  1393. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/static.mjs +3 -0
  1394. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/string.d.mts +12 -0
  1395. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/string.mjs +22 -0
  1396. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/symbol.d.mts +11 -0
  1397. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/symbol.mjs +17 -0
  1398. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/template_literal.d.mts +28 -0
  1399. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/template_literal.mjs +37 -0
  1400. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/this.d.mts +14 -0
  1401. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/this.mjs +17 -0
  1402. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/tuple.d.mts +38 -0
  1403. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/tuple.mjs +25 -0
  1404. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/undefined.d.mts +11 -0
  1405. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/undefined.mjs +17 -0
  1406. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/union.d.mts +15 -0
  1407. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/union.mjs +24 -0
  1408. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/unknown.d.mts +10 -0
  1409. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/unknown.mjs +17 -0
  1410. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/unsafe.d.mts +10 -0
  1411. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/unsafe.mjs +20 -0
  1412. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/void.d.mts +11 -0
  1413. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/type/types/void.mjs +17 -0
  1414. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/typebox.d.mts +69 -0
  1415. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/typebox.mjs +85 -0
  1416. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/assert/assert.d.mts +14 -0
  1417. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/assert/assert.mjs +28 -0
  1418. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/assert/index.d.mts +1 -0
  1419. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/assert/index.mjs +1 -0
  1420. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/check/check.d.mts +5 -0
  1421. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/check/check.mjs +11 -0
  1422. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/check/index.d.mts +1 -0
  1423. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/check/index.mjs +1 -0
  1424. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/additional.d.mts +2 -0
  1425. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/additional.mjs +6 -0
  1426. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/clean.d.mts +15 -0
  1427. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/clean.mjs +17 -0
  1428. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_array.d.mts +2 -0
  1429. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_array.mjs +8 -0
  1430. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_cyclic.d.mts +2 -0
  1431. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_cyclic.mjs +6 -0
  1432. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_intersect.d.mts +2 -0
  1433. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_intersect.mjs +26 -0
  1434. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_object.d.mts +2 -0
  1435. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_object.mjs +31 -0
  1436. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_record.d.mts +2 -0
  1437. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_record.mjs +32 -0
  1438. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_ref.d.mts +2 -0
  1439. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_ref.mjs +8 -0
  1440. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_tuple.d.mts +2 -0
  1441. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_tuple.mjs +14 -0
  1442. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_type.d.mts +2 -0
  1443. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_type.mjs +21 -0
  1444. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_union.d.mts +2 -0
  1445. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/from_union.mjs +12 -0
  1446. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/index.d.mts +1 -0
  1447. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clean/index.mjs +1 -0
  1448. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clone/clone.d.mts +5 -0
  1449. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clone/clone.mjs +12 -0
  1450. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clone/index.d.mts +1 -0
  1451. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/clone/index.mjs +1 -0
  1452. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/callback.d.mts +2 -0
  1453. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/callback.mjs +25 -0
  1454. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/decode.d.mts +12 -0
  1455. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/decode.mjs +52 -0
  1456. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/encode.d.mts +12 -0
  1457. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/encode.mjs +52 -0
  1458. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_array.d.mts +2 -0
  1459. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_array.mjs +35 -0
  1460. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_cyclic.d.mts +2 -0
  1461. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_cyclic.mjs +8 -0
  1462. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_intersect.d.mts +2 -0
  1463. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_intersect.mjs +58 -0
  1464. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_object.d.mts +2 -0
  1465. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_object.mjs +42 -0
  1466. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_record.d.mts +2 -0
  1467. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_record.mjs +39 -0
  1468. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_ref.d.mts +2 -0
  1469. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_ref.mjs +31 -0
  1470. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_tuple.d.mts +2 -0
  1471. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_tuple.mjs +32 -0
  1472. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_type.d.mts +2 -0
  1473. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_type.mjs +22 -0
  1474. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_union.d.mts +2 -0
  1475. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/from_union.mjs +39 -0
  1476. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/has.d.mts +5 -0
  1477. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/has.mjs +93 -0
  1478. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/index.d.mts +3 -0
  1479. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/codec/index.mjs +3 -0
  1480. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/convert.d.mts +13 -0
  1481. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/convert.mjs +15 -0
  1482. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_additional.d.mts +6 -0
  1483. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_additional.mjs +18 -0
  1484. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_array.d.mts +2 -0
  1485. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_array.mjs +7 -0
  1486. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_bigint.d.mts +2 -0
  1487. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_bigint.mjs +6 -0
  1488. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_boolean.d.mts +2 -0
  1489. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_boolean.mjs +6 -0
  1490. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_cyclic.d.mts +2 -0
  1491. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_cyclic.mjs +6 -0
  1492. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_enum.d.mts +2 -0
  1493. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_enum.mjs +6 -0
  1494. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_integer.d.mts +2 -0
  1495. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_integer.mjs +6 -0
  1496. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_intersect.d.mts +2 -0
  1497. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_intersect.mjs +8 -0
  1498. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_literal.d.mts +2 -0
  1499. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_literal.mjs +44 -0
  1500. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_null.d.mts +2 -0
  1501. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_null.mjs +6 -0
  1502. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_number.d.mts +2 -0
  1503. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_number.mjs +6 -0
  1504. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_object.d.mts +2 -0
  1505. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_object.mjs +28 -0
  1506. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_record.d.mts +2 -0
  1507. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_record.mjs +23 -0
  1508. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_ref.d.mts +2 -0
  1509. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_ref.mjs +8 -0
  1510. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_string.d.mts +2 -0
  1511. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_string.mjs +6 -0
  1512. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_template_literal.d.mts +2 -0
  1513. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_template_literal.mjs +6 -0
  1514. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_tuple.d.mts +2 -0
  1515. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_tuple.mjs +11 -0
  1516. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_type.d.mts +2 -0
  1517. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_type.mjs +43 -0
  1518. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_undefined.d.mts +2 -0
  1519. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_undefined.mjs +6 -0
  1520. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_union.d.mts +2 -0
  1521. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_union.mjs +13 -0
  1522. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_void.d.mts +2 -0
  1523. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/from_void.mjs +6 -0
  1524. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/index.d.mts +1 -0
  1525. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/index.mjs +1 -0
  1526. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/index.d.mts +1 -0
  1527. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/index.mjs +1 -0
  1528. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try.d.mts +8 -0
  1529. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try.mjs +8 -0
  1530. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_array.d.mts +2 -0
  1531. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_array.mjs +6 -0
  1532. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_bigint.d.mts +2 -0
  1533. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_bigint.mjs +45 -0
  1534. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_boolean.d.mts +2 -0
  1535. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_boolean.mjs +41 -0
  1536. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_null.d.mts +2 -0
  1537. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_null.mjs +44 -0
  1538. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_number.d.mts +2 -0
  1539. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_number.mjs +44 -0
  1540. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_result.d.mts +8 -0
  1541. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_result.mjs +17 -0
  1542. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_string.d.mts +2 -0
  1543. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_string.mjs +12 -0
  1544. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_undefined.d.mts +2 -0
  1545. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/convert/try/try_undefined.mjs +44 -0
  1546. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/create.d.mts +5 -0
  1547. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/create.mjs +11 -0
  1548. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/error.d.mts +5 -0
  1549. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/error.mjs +7 -0
  1550. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_array.d.mts +2 -0
  1551. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_array.mjs +10 -0
  1552. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_bigint.d.mts +2 -0
  1553. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_bigint.mjs +7 -0
  1554. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_boolean.d.mts +2 -0
  1555. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_boolean.mjs +4 -0
  1556. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_constructor.d.mts +2 -0
  1557. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_constructor.mjs +10 -0
  1558. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_cyclic.d.mts +2 -0
  1559. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_cyclic.mjs +6 -0
  1560. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_default.d.mts +3 -0
  1561. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_default.mjs +10 -0
  1562. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_enum.d.mts +2 -0
  1563. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_enum.mjs +6 -0
  1564. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_function.d.mts +2 -0
  1565. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_function.mjs +6 -0
  1566. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_integer.d.mts +2 -0
  1567. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_integer.mjs +8 -0
  1568. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_intersect.d.mts +2 -0
  1569. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_intersect.mjs +8 -0
  1570. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_literal.d.mts +2 -0
  1571. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_literal.mjs +4 -0
  1572. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_never.d.mts +2 -0
  1573. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_never.mjs +5 -0
  1574. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_null.d.mts +2 -0
  1575. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_null.mjs +4 -0
  1576. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_number.d.mts +2 -0
  1577. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_number.mjs +8 -0
  1578. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_object.d.mts +2 -0
  1579. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_object.mjs +9 -0
  1580. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_record.d.mts +2 -0
  1581. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_record.mjs +8 -0
  1582. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_ref.d.mts +2 -0
  1583. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_ref.mjs +9 -0
  1584. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_string.d.mts +2 -0
  1585. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_string.mjs +9 -0
  1586. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_symbol.d.mts +2 -0
  1587. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_symbol.mjs +4 -0
  1588. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_template_literal.d.mts +2 -0
  1589. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_template_literal.mjs +11 -0
  1590. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_tuple.d.mts +2 -0
  1591. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_tuple.mjs +5 -0
  1592. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_type.d.mts +2 -0
  1593. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_type.mjs +61 -0
  1594. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_undefined.d.mts +2 -0
  1595. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_undefined.mjs +4 -0
  1596. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_union.d.mts +2 -0
  1597. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_union.mjs +9 -0
  1598. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_void.d.mts +2 -0
  1599. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/from_void.mjs +4 -0
  1600. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/index.d.mts +2 -0
  1601. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/create/index.mjs +2 -0
  1602. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/default.d.mts +13 -0
  1603. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/default.mjs +15 -0
  1604. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_array.d.mts +2 -0
  1605. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_array.mjs +12 -0
  1606. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_cyclic.d.mts +2 -0
  1607. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_cyclic.mjs +7 -0
  1608. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_default.d.mts +3 -0
  1609. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_default.mjs +13 -0
  1610. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_intersect.d.mts +2 -0
  1611. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_intersect.mjs +9 -0
  1612. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_object.d.mts +2 -0
  1613. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_object.mjs +32 -0
  1614. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_record.d.mts +2 -0
  1615. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_record.mjs +26 -0
  1616. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_ref.d.mts +2 -0
  1617. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_ref.mjs +9 -0
  1618. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_tuple.d.mts +2 -0
  1619. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_tuple.mjs +14 -0
  1620. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_type.d.mts +2 -0
  1621. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_type.mjs +25 -0
  1622. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_union.d.mts +2 -0
  1623. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/from_union.mjs +14 -0
  1624. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/index.d.mts +1 -0
  1625. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/default/index.mjs +1 -0
  1626. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/diff.d.mts +10 -0
  1627. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/diff.mjs +135 -0
  1628. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/edit.d.mts +24 -0
  1629. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/edit.mjs +17 -0
  1630. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/index.d.mts +3 -0
  1631. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/index.mjs +3 -0
  1632. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/patch.d.mts +8 -0
  1633. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/delta/patch.mjs +42 -0
  1634. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/equal/equal.d.mts +2 -0
  1635. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/equal/equal.mjs +6 -0
  1636. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/equal/index.d.mts +1 -0
  1637. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/equal/index.mjs +1 -0
  1638. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/errors/errors.d.mts +16 -0
  1639. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/errors/errors.mjs +17 -0
  1640. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/errors/index.d.mts +1 -0
  1641. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/errors/index.mjs +1 -0
  1642. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/hash/hash.d.mts +6 -0
  1643. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/hash/hash.mjs +10 -0
  1644. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/hash/index.d.mts +1 -0
  1645. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/hash/index.mjs +1 -0
  1646. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/index.d.mts +20 -0
  1647. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/index.mjs +29 -0
  1648. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/parse/index.d.mts +1 -0
  1649. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/parse/index.mjs +1 -0
  1650. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/parse/parse.d.mts +11 -0
  1651. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/parse/parse.mjs +47 -0
  1652. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/pipeline/index.d.mts +1 -0
  1653. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/pipeline/index.mjs +1 -0
  1654. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/pipeline/pipeline.d.mts +10 -0
  1655. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/pipeline/pipeline.mjs +15 -0
  1656. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/pointer/index.d.mts +1 -0
  1657. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/pointer/index.mjs +1 -0
  1658. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/error.d.mts +7 -0
  1659. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/error.mjs +8 -0
  1660. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_array.d.mts +2 -0
  1661. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_array.mjs +39 -0
  1662. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_enum.d.mts +2 -0
  1663. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_enum.mjs +6 -0
  1664. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_intersect.d.mts +2 -0
  1665. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_intersect.mjs +8 -0
  1666. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_object.d.mts +2 -0
  1667. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_object.mjs +33 -0
  1668. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_record.d.mts +2 -0
  1669. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_record.mjs +33 -0
  1670. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_ref.d.mts +2 -0
  1671. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_ref.mjs +9 -0
  1672. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_template_literal.d.mts +2 -0
  1673. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_template_literal.mjs +7 -0
  1674. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_tuple.d.mts +2 -0
  1675. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_tuple.mjs +12 -0
  1676. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_type.d.mts +2 -0
  1677. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_type.mjs +88 -0
  1678. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_union.d.mts +2 -0
  1679. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_union.mjs +24 -0
  1680. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_unknown.d.mts +2 -0
  1681. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/from_unknown.mjs +12 -0
  1682. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/index.d.mts +1 -0
  1683. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/index.mjs +1 -0
  1684. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/repair.d.mts +17 -0
  1685. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/repair/repair.mjs +20 -0
  1686. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/index.d.mts +3 -0
  1687. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/index.mjs +4 -0
  1688. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/optional_undefined.d.mts +2 -0
  1689. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/optional_undefined.mjs +15 -0
  1690. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +7 -0
  1691. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/union_priority_sort.mjs +72 -0
  1692. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/union_score_select.d.mts +3 -0
  1693. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/shared/union_score_select.mjs +51 -0
  1694. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/value.d.mts +15 -0
  1695. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/build/value/value.mjs +15 -0
  1696. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/license +23 -0
  1697. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/package.json +87 -0
  1698. package/node_modules/@code-yeongyu/senpi-codemode/node_modules/typebox/readme.md +363 -0
  1699. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  1700. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +11 -5
  1701. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +3 -1
  1702. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  1703. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +57 -18
  1704. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  1705. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +7 -4
  1706. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  1707. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +12 -3
  1708. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  1709. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +3 -2
  1710. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  1711. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +13 -3
  1712. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  1713. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
  1714. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +14 -1
  1715. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
  1716. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +1 -1
  1717. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  1718. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -0
  1719. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  1720. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +9 -2
  1721. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  1722. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  1723. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  1724. package/node_modules/@earendil-works/pi-ai/README.md +5 -3
  1725. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +7 -1
  1726. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  1727. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +21 -4
  1728. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  1729. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +2 -0
  1730. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  1731. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +7 -1
  1732. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  1733. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  1734. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +39 -2
  1735. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  1736. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts +22 -1
  1737. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts.map +1 -1
  1738. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js +1 -1
  1739. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js.map +1 -1
  1740. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/reasoning-params.d.ts +20 -0
  1741. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/reasoning-params.d.ts.map +1 -0
  1742. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/reasoning-params.js +26 -0
  1743. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/reasoning-params.js.map +1 -0
  1744. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts +7 -1
  1745. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts.map +1 -1
  1746. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js.map +1 -1
  1747. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +5 -3
  1748. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  1749. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +82 -12
  1750. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  1751. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts +2 -2
  1752. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  1753. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +14 -11
  1754. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  1755. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts +5 -2
  1756. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
  1757. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +16 -0
  1758. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  1759. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts +2 -2
  1760. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  1761. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +13 -10
  1762. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  1763. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  1764. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -1
  1765. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  1766. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  1767. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +4 -1
  1768. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  1769. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +1 -1
  1770. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  1771. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +45 -29
  1772. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  1773. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  1774. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +8 -1
  1775. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  1776. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +1 -1
  1777. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  1778. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts +4 -0
  1779. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  1780. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +18 -9
  1781. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  1782. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.d.ts +1 -0
  1783. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.d.ts.map +1 -1
  1784. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.js +1 -1
  1785. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.js.map +1 -1
  1786. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -1
  1787. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js +22 -9
  1788. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -1
  1789. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.d.ts +25 -0
  1790. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.d.ts.map +1 -0
  1791. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.js +134 -0
  1792. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.js.map +1 -0
  1793. package/node_modules/@earendil-works/pi-ai/dist/cursor/cursor-variant-aliases.json +1893 -0
  1794. package/node_modules/@earendil-works/pi-ai/dist/cursor/model-capabilities.d.ts +47 -0
  1795. package/node_modules/@earendil-works/pi-ai/dist/cursor/model-capabilities.d.ts.map +1 -0
  1796. package/node_modules/@earendil-works/pi-ai/dist/cursor/model-capabilities.js +208 -0
  1797. package/node_modules/@earendil-works/pi-ai/dist/cursor/model-capabilities.js.map +1 -0
  1798. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.d.ts +21 -0
  1799. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.d.ts.map +1 -0
  1800. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.js +83 -0
  1801. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.js.map +1 -0
  1802. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts +8 -0
  1803. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -0
  1804. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +76 -0
  1805. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -0
  1806. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +5 -1
  1807. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  1808. package/node_modules/@earendil-works/pi-ai/dist/index.js +4 -0
  1809. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  1810. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +13 -0
  1811. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
  1812. package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
  1813. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +6 -0
  1814. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  1815. package/node_modules/@earendil-works/pi-ai/dist/models.js +9 -1
  1816. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  1817. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
  1818. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +40 -11
  1819. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
  1820. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  1821. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  1822. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  1823. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  1824. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  1825. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  1826. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  1827. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  1828. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  1829. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
  1830. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  1831. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  1832. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
  1833. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
  1834. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
  1835. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
  1836. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  1837. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  1838. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts +1 -1
  1839. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts.map +1 -1
  1840. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js +1 -5
  1841. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js.map +1 -1
  1842. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.d.ts.map +1 -1
  1843. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.js +21 -1
  1844. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.js.map +1 -1
  1845. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-message-snapshot.d.ts.map +1 -1
  1846. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-message-snapshot.js +2 -1
  1847. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-message-snapshot.js.map +1 -1
  1848. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +45 -4
  1849. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  1850. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  1851. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  1852. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +15 -0
  1853. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  1854. package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.d.ts +2 -0
  1855. package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.d.ts.map +1 -1
  1856. package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.js +7 -0
  1857. package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.js.map +1 -1
  1858. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +2 -1
  1859. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  1860. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +2 -0
  1861. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  1862. package/node_modules/@earendil-works/pi-ai/package.json +2 -3
  1863. package/node_modules/@earendil-works/pi-pty/dist/loader.d.ts +6 -0
  1864. package/node_modules/@earendil-works/pi-pty/dist/loader.d.ts.map +1 -1
  1865. package/node_modules/@earendil-works/pi-pty/dist/loader.js +11 -0
  1866. package/node_modules/@earendil-works/pi-pty/dist/loader.js.map +1 -1
  1867. package/node_modules/@earendil-works/pi-pty/dist/quarantine.d.ts +15 -0
  1868. package/node_modules/@earendil-works/pi-pty/dist/quarantine.d.ts.map +1 -0
  1869. package/node_modules/@earendil-works/pi-pty/dist/quarantine.js +27 -0
  1870. package/node_modules/@earendil-works/pi-pty/dist/quarantine.js.map +1 -0
  1871. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  1872. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  1873. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +73 -1
  1874. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  1875. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +173 -17
  1876. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  1877. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  1878. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +5 -4
  1879. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  1880. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +69 -0
  1881. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -1
  1882. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +1 -1
  1883. package/node_modules/@earendil-works/pi-tui/dist/image-markers.d.ts +46 -0
  1884. package/node_modules/@earendil-works/pi-tui/dist/image-markers.d.ts.map +1 -0
  1885. package/node_modules/@earendil-works/pi-tui/dist/image-markers.js +130 -0
  1886. package/node_modules/@earendil-works/pi-tui/dist/image-markers.js.map +1 -0
  1887. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -0
  1888. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  1889. package/node_modules/@earendil-works/pi-tui/dist/index.js +2 -0
  1890. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  1891. package/node_modules/@earendil-works/pi-tui/dist/paste-markers.d.ts +3 -0
  1892. package/node_modules/@earendil-works/pi-tui/dist/paste-markers.d.ts.map +1 -1
  1893. package/node_modules/@earendil-works/pi-tui/dist/paste-markers.js +23 -7
  1894. package/node_modules/@earendil-works/pi-tui/dist/paste-markers.js.map +1 -1
  1895. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1896. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +5 -1
  1897. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1898. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  1899. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-agent.js","sourceRoot":"","sources":["../../src/api/cursor-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAiC,QAAQ,EAAE,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AC,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,GAAG,QAAQ,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,oBAAoB,CAC5B,KAAuG,EACvG,UAAkB;IAElB,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/G,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YACnC,SAAS;QACV,CAAC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,OAAO,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Cursor agent protocol (`agent.v1.AgentService/Run`) over HTTP/2 Connect.\n *\n * Ported from upstream oh-my-pi's Cursor provider and adapted to senpi's\n * provider-neutral API architecture. The protocol is server-driven: the\n * client opens one `Run` stream per assistant turn, the server streams\n * interaction updates (text/thinking/tool-call deltas) and, mid-turn, sends\n * `ExecServerMessage` frames asking the CLIENT to execute a tool and blocks\n * until the answer arrives on the same stream. Tool execution is therefore\n * bridged through injected {@link CursorExecHandlers}; each bridged call is\n * synthesized into the assistant message as an already-resolved `toolCall`\n * block (marked {@link kCursorExecResolved} so the agent loop never re-runs\n * it) and paired with a `ToolResultMessage` delivered via `onToolResult`.\n *\n * NOTE: This module is Node-only (node:http2) and must only be reached\n * through the lazy wrapper (`cursor-agent.lazy.ts`).\n */\n\nimport { createHash, randomUUID } from \"node:crypto\";\nimport * as http2 from \"node:http2\";\nimport { create, fromBinary, fromJson, type JsonValue as PbJsonValue, toBinary, toJson } from \"@bufbuild/protobuf\";\nimport { ValueSchema } from \"@bufbuild/protobuf/wkt\";\nimport { calculateCost } from \"../models.ts\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tContext,\n\tImageContent,\n\tMessage,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tTextContent,\n\tThinkingContent,\n\tTool,\n\tToolCall,\n\tToolResultMessage,\n} from \"../types.ts\";\nimport {\n\ttype CursorExecResolvedCarrier,\n\tclearStreamingPartialJson,\n\tkCursorExecResolved,\n\tkStreamingBlockIndex,\n\tkStreamingBlockKind,\n\tkStreamingEnvelopeId,\n\tkStreamingLastParseLen,\n\tkStreamingPartialJson,\n} from \"../utils/block-symbols.ts\";\nimport { AssistantMessageEventStream } from \"../utils/event-stream.ts\";\nimport { providerHeadersToRecord } from \"../utils/headers.ts\";\nimport { parseJsonWithRepair, parseStreamingJson } from \"../utils/json-parse.ts\";\nimport { sanitizeSurrogates } from \"../utils/sanitize-unicode.ts\";\nimport { deterministicUuid } from \"./cursor-agent/deterministic-id.ts\";\nimport { armExecHeartbeat } from \"./cursor-agent/exec-lifecycle.ts\";\nimport {\n\tbuildMcpStateResult,\n\tbuildNeutralHookResult,\n\tbuildPiBashError,\n\tbuildPiBashResult,\n\tbuildPiEditError,\n\tbuildPiEditRejected,\n\tbuildPiEditResult,\n\tbuildPiFindError,\n\tbuildPiFindResult,\n\tbuildPiGrepError,\n\tbuildPiGrepResult,\n\tbuildPiLsError,\n\tbuildPiLsResult,\n\tbuildPiReadError,\n\tbuildPiReadResult,\n\tbuildPiWriteError,\n\tbuildPiWriteRejected,\n\tbuildPiWriteResult,\n} from \"./cursor-agent/exec-modern.ts\";\nimport {\n\tAgentClientMessageSchema,\n\tAgentConversationTurnStructureSchema,\n\tAgentRunRequestSchema,\n\ttype AgentServerMessage,\n\tAgentServerMessageSchema,\n\tAgentStoreConflictErrorSchema,\n\tAgentStoreConflictResultSchema,\n\tAssistantMessageSchema,\n\tBackgroundShellSpawnResultSchema,\n\tCanvasDiagnosticsErrorSchema,\n\tCanvasDiagnosticsResultSchema,\n\tClientHeartbeatSchema,\n\tComputerUseErrorSchema,\n\tComputerUseResultSchema,\n\tConversationActionSchema,\n\tConversationSearchErrorSchema,\n\tConversationSearchResultSchema,\n\ttype ConversationStateStructure,\n\tConversationStateStructureSchema,\n\ttype ConversationStep,\n\tConversationStepSchema,\n\tConversationTurnStructureSchema,\n\tDeleteErrorSchema,\n\tDeleteRejectedSchema,\n\tDeleteResultSchema,\n\tDeleteSuccessSchema,\n\tDiagnosticsErrorSchema,\n\tDiagnosticsRejectedSchema,\n\tDiagnosticsResultSchema,\n\tDiagnosticsSuccessSchema,\n\tExecClientControlMessageSchema,\n\tExecClientHeartbeatSchema,\n\ttype ExecClientMessage,\n\tExecClientMessageSchema,\n\tExecClientStreamCloseSchema,\n\tExecClientThrowSchema,\n\ttype ExecServerMessage,\n\tFetchErrorSchema,\n\tFetchResultSchema,\n\tForceBackgroundShellResultSchema,\n\tForceBackgroundShellStatus,\n\tForceBackgroundSubagentResultSchema,\n\tForceBackgroundSubagentStatus,\n\tGetBlobResultSchema,\n\tGetUsableModelsRequestSchema,\n\tGetUsableModelsResponseSchema,\n\tGrepContentMatchSchema,\n\tGrepContentResultSchema,\n\tGrepCountResultSchema,\n\tGrepErrorSchema,\n\ttype GrepFileCount,\n\tGrepFileCountSchema,\n\tGrepFileMatchSchema,\n\tGrepFilesResultSchema,\n\tGrepResultSchema,\n\tGrepSuccessSchema,\n\ttype GrepUnionResult,\n\tGrepUnionResultSchema,\n\tKvClientMessageSchema,\n\ttype KvServerMessage,\n\tListMcpResourcesExecResultSchema,\n\tListMcpResourcesSuccessSchema,\n\ttype LsDirectoryTreeNode,\n\ttype LsDirectoryTreeNode_File,\n\tLsDirectoryTreeNode_FileSchema,\n\tLsDirectoryTreeNodeSchema,\n\tLsErrorSchema,\n\tLsRejectedSchema,\n\tLsResultSchema,\n\tLsSuccessSchema,\n\tMcpAllowlistPrecheckResultSchema,\n\tMcpApprovedSchema,\n\tMcpArgsSchema,\n\tMcpErrorSchema,\n\tMcpImageContentSchema,\n\tMcpRejectedSchema,\n\tMcpResultSchema,\n\tMcpSuccessSchema,\n\tMcpTextContentSchema,\n\tMcpToolCallSchema,\n\ttype McpToolDefinition,\n\tMcpToolDefinitionSchema,\n\tMcpToolErrorSchema,\n\tMcpToolNotFoundSchema,\n\tMcpToolResultContentItemSchema,\n\tMcpToolResultSchema,\n\tModelDetailsSchema,\n\tReadErrorSchema,\n\tReadMcpResourceExecResultSchema,\n\tReadMcpResourceNotFoundSchema,\n\tReadRejectedSchema,\n\tReadResultSchema,\n\tReadSuccessSchema,\n\tRecordScreenFailureSchema,\n\tRecordScreenResultSchema,\n\tRequestContextResultSchema,\n\tRequestContextSchema,\n\tRequestContextSuccessSchema,\n\tRequestedModelSchema,\n\tResumeActionSchema,\n\tSelectedContextSchema,\n\tSelectedImageSchema,\n\tSetBlobResultSchema,\n\tShellAllowlistPrecheckResultSchema,\n\ttype ShellArgs,\n\tShellFailureSchema,\n\tShellRejectedSchema,\n\ttype ShellResult,\n\tShellResultSchema,\n\ttype ShellStream,\n\tShellStreamExitSchema,\n\tShellStreamSchema,\n\tShellStreamStartSchema,\n\tShellStreamStderrSchema,\n\tShellStreamStdoutSchema,\n\tShellSuccessSchema,\n\tSmartModeClassifierErrorSchema,\n\tSmartModeClassifierResultSchema,\n\tSubagentAwaitNotFoundSchema,\n\tSubagentAwaitResultSchema,\n\tSubagentErrorSchema,\n\tSubagentResultSchema,\n\tToolCallSchema,\n\tUserMessageActionSchema,\n\tUserMessageSchema,\n\tWebFetchAllowlistPrecheckResultSchema,\n\tWriteErrorSchema,\n\tWriteRejectedSchema,\n\tWriteResultSchema,\n\tWriteShellStdinErrorSchema,\n\tWriteShellStdinResultSchema,\n\tWriteSuccessSchema,\n} from \"./cursor-agent/gen/agent_pb.ts\";\nimport {\n\tcomposeShellCommand,\n\tomitUndefinedArgs,\n\tpiLimit,\n\tpiLsPath,\n\tpiReadArgs,\n\tpiTimeout,\n} from \"./cursor-agent/pi-args.ts\";\nimport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./cursor-agent/types.ts\";\n\nexport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorPiCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./cursor-agent/types.ts\";\n\nexport const CURSOR_API_URL = \"https://api2.cursor.sh\";\nexport const CURSOR_CLIENT_VERSION = \"cli-2026.07.23-e383d2b\";\nconst EXEC_HEARTBEAT_INTERVAL_MS = 3000;\n\n/**\n * HTTP/1 connection-specific headers that HTTP/2 forbids. Node's\n * `http2.request()` throws on these rather than dropping them.\n */\nconst HTTP2_FORBIDDEN_HEADERS = new Set([\n\t\"connection\",\n\t\"keep-alive\",\n\t\"proxy-connection\",\n\t\"transfer-encoding\",\n\t\"upgrade\",\n\t\"http2-settings\",\n]);\n\n/**\n * Header names the Cursor request sets for itself. A caller copy in ANY\n * casing has to go: the spread below adds the fixed lower-case name\n * regardless, and two spellings of one field are a duplicate (node throws\n * `ERR_HTTP2_HEADER_SINGLE_VALUE`) rather than an override.\n */\nconst CURSOR_RESERVED_HEADERS = new Set([\n\t\"content-type\",\n\t\"connect-protocol-version\",\n\t\"te\",\n\t\"authorization\",\n\t\"x-ghost-mode\",\n\t\"x-cursor-client-version\",\n\t\"x-cursor-client-type\",\n\t\"x-request-id\",\n\t// Transport-owned: a plain `host` header suppresses the `:authority` node\n\t// derives from the URL, silently retargeting the request.\n\t\"host\",\n\t// The Connect body is streamed after the headers (initial frame,\n\t// heartbeats, tool responses), so no caller-supplied length can describe it.\n\t\"content-length\",\n]);\n\n/** Reduce caller-supplied headers to what this HTTP/2 request can legally carry. */\nexport function sanitizeCursorCallerHeaders(headers: Record<string, string> | undefined): Record<string, string> {\n\tconst sanitized: Record<string, string> = {};\n\tfor (const [name, value] of Object.entries(headers ?? {})) {\n\t\tconst field = name.toLowerCase();\n\t\tif (field.startsWith(\":\")) continue;\n\t\tif (HTTP2_FORBIDDEN_HEADERS.has(field)) continue;\n\t\tif (CURSOR_RESERVED_HEADERS.has(field)) continue;\n\t\tsanitized[field] = value;\n\t}\n\treturn sanitized;\n}\n\n/**\n * Text for a recognised frame this client answers with its own typed error\n * variant. Phrased as a client capability statement, not a tool failure: the\n * model reads it and should route around the capability, not retry the call.\n */\nconst NOT_IMPLEMENTED_SUFFIX = \"not implemented by this client\";\nconst NOT_IMPLEMENTED = \"Not implemented by this client\";\n/** Bare gRPC `resource_exhausted` end-streams (also inside a Connect error message). */\nconst RESOURCE_EXHAUSTED_PATTERN = /resource.?exhausted/i;\n\nconst conversationStateCache = new Map<string, ConversationStateStructure>();\nconst conversationBlobStores = new Map<string, Map<string, Uint8Array>>();\n/**\n * Base conversation id → rotated wire id. Cursor's backend can pin a\n * per-conversation rejection (bare `resource_exhausted`, zero tokens) to one\n * conversationId forever. On the first such failure the id is rotated once\n * and the cached state migrates, so the retry loop's next attempt starts a\n * fresh conversation. Keyed by the base id so a failed rotation never repeats.\n */\nconst rotatedConversationIds = new Map<string, string>();\n\nconst CONNECT_END_STREAM_FLAG = 0b00000010;\n\nfunction log(type: string, subtype?: string, data?: unknown): void {\n\tif (!process.env.DEBUG_CURSOR) return;\n\tconst verbose = process.env.DEBUG_CURSOR === \"2\" || process.env.DEBUG_CURSOR === \"verbose\";\n\tlet dataStr = \"\";\n\tif (verbose && data !== undefined) {\n\t\ttry {\n\t\t\tdataStr = ` ${JSON.stringify(data, (_key, value) => {\n\t\t\t\tif (value instanceof Uint8Array) return `bytes(${value.length})`;\n\t\t\t\tif (typeof value === \"bigint\") return value.toString();\n\t\t\t\treturn value;\n\t\t\t})?.slice(0, 500)}`;\n\t\t} catch {\n\t\t\tdataStr = \" [unserializable]\";\n\t\t}\n\t}\n\tconsole.error(`[CURSOR] ${type}${subtype ? `: ${subtype}` : \"\"}${dataStr}`);\n}\n\nexport function frameConnectMessage(data: Uint8Array, flags = 0): Buffer {\n\tconst frame = Buffer.alloc(5 + data.length);\n\tframe[0] = flags;\n\tframe.writeUInt32BE(data.length, 1);\n\tframe.set(data, 5);\n\treturn frame;\n}\n\nfunction parseConnectEndStream(data: Uint8Array): Error | null {\n\ttry {\n\t\tconst payload = JSON.parse(new TextDecoder().decode(data));\n\t\tconst error = payload?.error;\n\t\tif (error) {\n\t\t\tconst code = typeof error.code === \"string\" ? error.code : \"unknown\";\n\t\t\tconst message = typeof error.message === \"string\" ? error.message : \"Unknown error\";\n\t\t\treturn new Error(`Connect error ${code}: ${message}`);\n\t\t}\n\t\treturn null;\n\t} catch {\n\t\treturn new Error(\"Failed to parse Connect end stream\");\n\t}\n}\n\n/**\n * Maps an opaque HTTP/2 negotiation failure into an actionable error. The\n * Cursor run RPC is HTTP/2-only (the ALB rejects HTTP/1.1 with 464), so a\n * TLS-intercepting proxy that strips ALPN kills the run with no h1 fallback.\n */\nexport function mapH2TransportError(error: unknown, baseUrl: string): unknown {\n\tconst code = (error as { code?: unknown } | null)?.code;\n\tconst message = error instanceof Error ? error.message : String(error);\n\tif (code === \"ERR_HTTP2_ERROR\" && /h2 is not supported/i.test(message)) {\n\t\treturn new Error(\n\t\t\t`Cursor run transport could not negotiate HTTP/2 with ${baseUrl}: \"h2 is not supported\". ` +\n\t\t\t\t\"This host serves the run RPC over HTTP/2 only, and the TLS handshake did not negotiate \" +\n\t\t\t\t\"h2 via ALPN — typically an ALPN-stripping TLS-intercepting proxy. \" +\n\t\t\t\t\"Front the provider with a local HTTP/2 bridge and point the model's baseUrl at it.\",\n\t\t);\n\t}\n\treturn error;\n}\n\nexport const stream: StreamFunction<\"cursor-agent\", CursorAgentOptions> = (\n\tmodel: Model<\"cursor-agent\">,\n\tcontext: Context,\n\toptions?: CursorAgentOptions,\n): AssistantMessageEventStream => {\n\tconst stream = new AssistantMessageEventStream();\n\n\t(async () => {\n\t\tconst output: AssistantMessage = {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: [],\n\t\t\tapi: \"cursor-agent\" as Api,\n\t\t\tprovider: model.provider,\n\t\t\tmodel: model.id,\n\t\t\tusage: {\n\t\t\t\tinput: 0,\n\t\t\t\toutput: 0,\n\t\t\t\tcacheRead: 0,\n\t\t\t\tcacheWrite: 0,\n\t\t\t\ttotalTokens: 0,\n\t\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t\t},\n\t\t\tstopReason: \"stop\",\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\n\t\t// Declared outside the `try` because BOTH exits must drain it: an exec\n\t\t// handler decoded from the last chunk can still be running when the\n\t\t// transport fails, and the error path finalizes the synthesized call\n\t\t// just like the success path does.\n\t\tconst inFlightDispatches = new Set<Promise<void>>();\n\t\t// A dispatch can spawn another, so re-check rather than awaiting one\n\t\t// snapshot. The wait is bounded by the abort signal: exec handlers have\n\t\t// no cancellation contract, so a hung tool must not hold the terminal\n\t\t// event hostage after the user already gave up on the turn.\n\t\tlet abortSettled: Promise<void> | undefined;\n\t\tconst drainInFlightDispatches = async (): Promise<void> => {\n\t\t\tconst signal = options?.signal;\n\t\t\twhile (inFlightDispatches.size > 0) {\n\t\t\t\tif (signal?.aborted) return;\n\t\t\t\tconst settled = Promise.all([...inFlightDispatches]);\n\t\t\t\tif (!signal) {\n\t\t\t\t\tawait settled;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tabortSettled ??= new Promise<void>((resolve) =>\n\t\t\t\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true }),\n\t\t\t\t);\n\t\t\t\tawait Promise.race([settled, abortSettled]);\n\t\t\t}\n\t\t};\n\n\t\tlet h2Client: http2.ClientHttp2Session | null = null;\n\t\tlet h2Request: http2.ClientHttp2Stream | null = null;\n\t\tlet heartbeatTimer: NodeJS.Timeout | null = null;\n\t\tlet h2Settled = false;\n\t\tlet sawTurnEnded = false;\n\t\tlet endStreamError: Error | null = null;\n\t\t// Reachable from the catch: a stream that dies mid-turn must still close\n\t\t// and pair the blocks it left open.\n\t\tlet openBlockState: BlockState | undefined;\n\t\tlet resolveH2: () => void = () => {};\n\t\tlet rejectH2: (error: unknown) => void = () => {};\n\t\tconst h2Completion = new Promise<void>((resolve, reject) => {\n\t\t\tresolveH2 = resolve;\n\t\t\trejectH2 = reject;\n\t\t});\n\t\tconst settleH2 = (error?: unknown): void => {\n\t\t\tif (h2Settled) return;\n\t\t\th2Settled = true;\n\t\t\tif (error !== undefined) {\n\t\t\t\trejectH2(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (endStreamError) {\n\t\t\t\trejectH2(endStreamError);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!sawTurnEnded) {\n\t\t\t\trejectH2(new Error(\"Cursor stream ended before turnEnded\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolveH2();\n\t\t};\n\n\t\t// Hoisted out of the try block: the rotation in the catch path needs\n\t\t// both ids, and the catch block cannot see try-scoped consts.\n\t\tlet baseConversationId: string | undefined;\n\t\tlet conversationId: string | undefined;\n\t\tlet usageState: UsageState | undefined;\n\t\ttry {\n\t\t\tconst apiKey = options?.apiKey;\n\t\t\tif (!apiKey) {\n\t\t\t\tthrow new Error(\"Cursor access token is required; run /login cursor\");\n\t\t\t}\n\n\t\t\tbaseConversationId = options?.conversationId ?? options?.sessionId ?? randomUUID();\n\t\t\tconversationId = rotatedConversationIds.get(baseConversationId) ?? baseConversationId;\n\t\t\tconst blobStore = conversationBlobStores.get(conversationId) ?? new Map<string, Uint8Array>();\n\t\t\tconversationBlobStores.set(conversationId, blobStore);\n\t\t\tconst cachedState = conversationStateCache.get(conversationId);\n\t\t\tconst { requestBytes, conversationState } = await buildGrpcRequest(model, context, options, {\n\t\t\t\tconversationId,\n\t\t\t\tblobStore,\n\t\t\t\tconversationState: cachedState,\n\t\t\t});\n\t\t\tconversationStateCache.set(conversationId, conversationState);\n\t\t\tconst requestContextTools = buildMcpToolDefinitions(context.tools);\n\n\t\t\tconst baseUrl = model.baseUrl || CURSOR_API_URL;\n\t\t\tconst requestPath = \"/agent.v1.AgentService/Run\";\n\t\t\t// Caller headers are additive, and are spread FIRST so the protocol\n\t\t\t// framing, auth, and request id below always win.\n\t\t\tconst callerHeaders = sanitizeCursorCallerHeaders(providerHeadersToRecord(options?.headers));\n\t\t\tconst requestHeaders = {\n\t\t\t\t...callerHeaders,\n\t\t\t\t\":method\": \"POST\",\n\t\t\t\t\":path\": requestPath,\n\t\t\t\t\"content-type\": \"application/connect+proto\",\n\t\t\t\t\"connect-protocol-version\": \"1\",\n\t\t\t\tte: \"trailers\",\n\t\t\t\tauthorization: `Bearer ${apiKey}`,\n\t\t\t\t\"x-ghost-mode\": \"true\",\n\t\t\t\t\"x-cursor-client-version\": CURSOR_CLIENT_VERSION,\n\t\t\t\t\"x-cursor-client-type\": \"cli\",\n\t\t\t\t\"x-request-id\": randomUUID(),\n\t\t\t};\n\n\t\t\th2Client = http2.connect(baseUrl);\n\t\t\th2Client.on(\"error\", (error) => settleH2(mapH2TransportError(error, baseUrl)));\n\n\t\t\th2Request = h2Client.request(requestHeaders);\n\n\t\t\tstream.push({ type: \"start\", partial: output });\n\n\t\t\tlet pendingBuffer: Buffer = Buffer.alloc(0);\n\t\t\tlet currentTextBlock: (TextContent & { [kStreamingBlockIndex]: number }) | null = null;\n\t\t\tlet currentThinkingBlock: (ThinkingContent & { [kStreamingBlockIndex]: number }) | null = null;\n\t\t\tlet currentToolCall: ToolCallState | null = null;\n\t\t\tconst resolvedMcpToolCallIds = new Set<string>();\n\t\t\tusageState = { sawTokenDelta: false };\n\n\t\t\tconst state: BlockState = {\n\t\t\t\tget currentTextBlock() {\n\t\t\t\t\treturn currentTextBlock;\n\t\t\t\t},\n\t\t\t\tget currentThinkingBlock() {\n\t\t\t\t\treturn currentThinkingBlock;\n\t\t\t\t},\n\t\t\t\tget currentToolCall() {\n\t\t\t\t\treturn currentToolCall;\n\t\t\t\t},\n\t\t\t\topenToolCalls: new Map<string, ToolCallState>(),\n\t\t\t\tresolvedMcpToolCallIds,\n\t\t\t\tsetTextBlock: (b) => {\n\t\t\t\t\tcurrentTextBlock = b;\n\t\t\t\t},\n\t\t\t\tsetThinkingBlock: (b) => {\n\t\t\t\t\tcurrentThinkingBlock = b;\n\t\t\t\t},\n\t\t\t\tsetToolCall: (t) => {\n\t\t\t\t\tcurrentToolCall = t;\n\t\t\t\t},\n\t\t\t\tonToolResult: options?.onToolResult ?? options?.execHandlers?.onToolResult,\n\t\t\t};\n\t\t\topenBlockState = state;\n\n\t\t\tconst onConversationCheckpoint = (checkpoint: ConversationStateStructure) => {\n\t\t\t\tconversationStateCache.set(conversationId!, checkpoint);\n\t\t\t};\n\n\t\t\th2Request.on(\"data\", (chunk: Buffer) => {\n\t\t\t\t// Steady state drains fully per chunk; alias the fresh h2 chunk\n\t\t\t\t// instead of copying it through Buffer.concat.\n\t\t\t\tpendingBuffer = pendingBuffer.length === 0 ? chunk : Buffer.concat([pendingBuffer, chunk]);\n\n\t\t\t\twhile (pendingBuffer.length >= 5) {\n\t\t\t\t\tconst flags = pendingBuffer[0];\n\t\t\t\t\tconst msgLen = pendingBuffer.readUInt32BE(1);\n\t\t\t\t\tif (pendingBuffer.length < 5 + msgLen) break;\n\n\t\t\t\t\tconst messageBytes = pendingBuffer.subarray(5, 5 + msgLen);\n\t\t\t\t\tpendingBuffer = pendingBuffer.subarray(5 + msgLen);\n\n\t\t\t\t\tif (flags & CONNECT_END_STREAM_FLAG) {\n\t\t\t\t\t\tconst endError = parseConnectEndStream(messageBytes);\n\t\t\t\t\t\tif (endError) {\n\t\t\t\t\t\t\tendStreamError = endError;\n\t\t\t\t\t\t\th2Request?.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst serverMessage = fromBinary(AgentServerMessageSchema, messageBytes);\n\t\t\t\t\t\tconst isTurnEnded =\n\t\t\t\t\t\t\tserverMessage.message.case === \"interactionUpdate\" &&\n\t\t\t\t\t\t\tserverMessage.message.value.message?.case === \"turnEnded\";\n\t\t\t\t\t\t// Dispatch is fire-and-forget so the socket keeps draining\n\t\t\t\t\t\t// while a handler runs, but the promise is tracked: `done`\n\t\t\t\t\t\t// must not be pushed while an exec handler is still resolving,\n\t\t\t\t\t\t// or the buffered tool result is delivered after the turn\n\t\t\t\t\t\t// already finalized and the call is left unpaired.\n\t\t\t\t\t\tconst dispatch = handleServerMessage(\n\t\t\t\t\t\t\tserverMessage,\n\t\t\t\t\t\t\toutput,\n\t\t\t\t\t\t\tstream,\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblobStore,\n\t\t\t\t\t\t\th2Request!,\n\t\t\t\t\t\t\toptions?.execHandlers,\n\t\t\t\t\t\t\tstate.onToolResult,\n\t\t\t\t\t\t\tusageState!,\n\t\t\t\t\t\t\trequestContextTools,\n\t\t\t\t\t\t\tonConversationCheckpoint,\n\t\t\t\t\t\t).catch((error) => {\n\t\t\t\t\t\t\tlog(\"error\", \"handleServerMessage\", { error: String(error) });\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinFlightDispatches.add(dispatch);\n\t\t\t\t\t\tvoid dispatch.finally(() => inFlightDispatches.delete(dispatch));\n\n\t\t\t\t\t\t// Application completion is not protocol success; wait for a\n\t\t\t\t\t\t// clean HTTP/2 end.\n\t\t\t\t\t\tif (isTurnEnded) {\n\t\t\t\t\t\t\tsawTurnEnded = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog(\"error\", \"parseServerMessage\", { error: String(e) });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst sendHeartbeat = () => {\n\t\t\t\tif (!h2Request || h2Request.closed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst heartbeatMessage = create(AgentClientMessageSchema, {\n\t\t\t\t\tmessage: { case: \"clientHeartbeat\", value: create(ClientHeartbeatSchema, {}) },\n\t\t\t\t});\n\t\t\t\tconst heartbeatBytes = toBinary(AgentClientMessageSchema, heartbeatMessage);\n\t\t\t\th2Request.write(frameConnectMessage(heartbeatBytes));\n\t\t\t};\n\n\t\t\th2Request.on(\"trailers\", (trailers) => {\n\t\t\t\tconst status = trailers[\"grpc-status\"];\n\t\t\t\tconst msg = trailers[\"grpc-message\"];\n\t\t\t\tif (status && status !== \"0\" && !endStreamError) {\n\t\t\t\t\tendStreamError = new Error(`gRPC error ${status}: ${decodeURIComponent(String(msg || \"\"))}`);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\th2Request.on(\"end\", () => {\n\t\t\t\tsettleH2();\n\t\t\t});\n\n\t\t\th2Request.on(\"error\", (error) => {\n\t\t\t\tsettleH2(mapH2TransportError(error, baseUrl));\n\t\t\t});\n\n\t\t\tif (options?.signal) {\n\t\t\t\toptions.signal.addEventListener(\"abort\", () => {\n\t\t\t\t\th2Request?.close();\n\t\t\t\t\tsettleH2(new Error(\"Request was aborted\"));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\th2Request.write(frameConnectMessage(requestBytes));\n\t\t\theartbeatTimer = setInterval(sendHeartbeat, 5000);\n\t\t\tawait h2Completion;\n\t\t\t// The transport is done, but a handler decoded from the last chunk\n\t\t\t// may still be running. Pushing `done` now would let the host drain\n\t\t\t// its buffered tool results before such a handler reserved its entry,\n\t\t\t// leaving the call unpaired and stripped from rebuilt transcripts.\n\t\t\tawait drainInFlightDispatches();\n\n\t\t\tendCurrentTextBlock(output, stream, state);\n\t\t\tendCurrentThinkingBlock(output, stream, state);\n\t\t\tflushOpenToolCalls(output, stream, state);\n\n\t\t\tcalculateCost(model, output.usage);\n\n\t\t\tstream.push({\n\t\t\t\ttype: \"done\",\n\t\t\t\treason: output.stopReason as \"stop\" | \"length\" | \"toolUse\",\n\t\t\t\tmessage: output,\n\t\t\t});\n\t\t\tstream.end();\n\t\t} catch (error) {\n\t\t\t// Same reason as the success path: a handler still running would land\n\t\t\t// its real result after the turn finalized and be discarded — even\n\t\t\t// though the tool may already have run side effects. On abort the\n\t\t\t// drain returns immediately.\n\t\t\tawait drainInFlightDispatches();\n\t\t\t// A stream that dies mid-turn leaves blocks open. Closing them here\n\t\t\t// settles their live cards and pairs the server-owned calls that\n\t\t\t// nothing else answers — an unpaired call is stripped from every\n\t\t\t// rebuilt transcript.\n\t\t\tif (openBlockState) {\n\t\t\t\tendCurrentTextBlock(output, stream, openBlockState);\n\t\t\t\tendCurrentThinkingBlock(output, stream, openBlockState);\n\t\t\t\tflushOpenToolCalls(output, stream, openBlockState);\n\t\t\t}\n\t\t\tconst message = error instanceof Error ? error.message : JSON.stringify(error);\n\t\t\t// A server-side per-conversation rejection surfaces as a bare\n\t\t\t// resource_exhausted with zero tokens — the conversation is poisoned,\n\t\t\t// not the account. Rotate the wire id once and migrate cached state\n\t\t\t// so the caller's retry loop starts a fresh conversation.\n\t\t\tif (\n\t\t\t\tconversationId !== undefined &&\n\t\t\t\tbaseConversationId !== undefined &&\n\t\t\t\tusageState !== undefined &&\n\t\t\t\t!usageState.sawTokenDelta &&\n\t\t\t\tRESOURCE_EXHAUSTED_PATTERN.test(message) &&\n\t\t\t\t!rotatedConversationIds.has(baseConversationId)\n\t\t\t) {\n\t\t\t\tconst rotated = randomUUID();\n\t\t\t\trotatedConversationIds.set(baseConversationId, rotated);\n\t\t\t\tconst cached = conversationStateCache.get(conversationId);\n\t\t\t\tif (cached) conversationStateCache.set(rotated, cached);\n\t\t\t\tconst blobs = conversationBlobStores.get(conversationId);\n\t\t\t\tif (blobs) conversationBlobStores.set(rotated, blobs);\n\t\t\t}\n\t\t\toutput.stopReason = options?.signal?.aborted ? \"aborted\" : \"error\";\n\t\t\toutput.errorMessage = message;\n\t\t\tstream.push({ type: \"error\", reason: output.stopReason, error: output });\n\t\t\tstream.end();\n\t\t} finally {\n\t\t\tif (heartbeatTimer) {\n\t\t\t\tclearInterval(heartbeatTimer);\n\t\t\t\theartbeatTimer = null;\n\t\t\t}\n\t\t\th2Request?.close();\n\t\t\th2Client?.close();\n\t\t}\n\t})();\n\n\treturn stream;\n};\n\n/**\n * `streamSimple` for Cursor: reasoning/thinking is managed server-side per\n * model (there is no client thinking knob on the Run request), so the simple\n * options map through unchanged.\n */\nexport const streamSimple: StreamFunction<\"cursor-agent\", SimpleStreamOptions> = (\n\tmodel: Model<\"cursor-agent\">,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): AssistantMessageEventStream => {\n\treturn stream(model, context, options as CursorAgentOptions);\n};\n\nexport type ToolCallState = ToolCall & {\n\t[kStreamingBlockIndex]: number;\n\t[kStreamingPartialJson]?: string;\n\t[kStreamingLastParseLen]?: number;\n\t[kStreamingBlockKind]: \"mcp\" | \"todo\" | \"cursor-exec\" | \"connect-scm\";\n\t[kStreamingEnvelopeId]?: string;\n\t[kCursorExecResolved]?: true;\n};\n\nexport interface BlockState {\n\tcurrentTextBlock: (TextContent & { [kStreamingBlockIndex]: number }) | null;\n\tcurrentThinkingBlock: (ThinkingContent & { [kStreamingBlockIndex]: number }) | null;\n\tcurrentToolCall: ToolCallState | null;\n\t/**\n\t * Open streamed tool-call blocks, keyed by the interaction envelope's\n\t * `call_id`. Cursor interleaves calls: two `toolCallStarted` frames can\n\t * arrive before either completes.\n\t */\n\topenToolCalls: Map<string, ToolCallState>;\n\t/** MCP call IDs synthesized from exec frames before their redundant streamed block arrives. */\n\tresolvedMcpToolCallIds: Set<string>;\n\tsetTextBlock: (b: (TextContent & { [kStreamingBlockIndex]: number }) | null) => void;\n\tsetThinkingBlock: (b: (ThinkingContent & { [kStreamingBlockIndex]: number }) | null) => void;\n\tsetToolCall: (t: ToolCallState | null) => void;\n\t/**\n\t * Persist a paired `toolResult` for a server-resolved call. Native todo\n\t * calls never travel the exec channel, so without this the resolved block\n\t * has no matching result and every transcript rebuild strips it as dangling.\n\t */\n\tonToolResult?: CursorToolResultHandler;\n}\n\nfunction markCursorExecResolved(block: CursorExecResolvedCarrier): void {\n\tblock[kCursorExecResolved] = true;\n}\n\nexport interface UsageState {\n\tsawTokenDelta: boolean;\n}\n\n/** Exported for tests: drives one Cursor server message through the stream (exec waits mark the stream busy). */\nexport async function handleServerMessage(\n\tmsg: AgentServerMessage,\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n\tblobStore: Map<string, Uint8Array>,\n\th2Request: http2.ClientHttp2Stream,\n\texecHandlers: CursorExecHandlers | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n\tusageState: UsageState,\n\trequestContextTools: McpToolDefinition[],\n\tonConversationCheckpoint?: (checkpoint: ConversationStateStructure) => void,\n): Promise<void> {\n\tconst msgCase = msg.message.case;\n\n\tlog(\"serverMessage\", msgCase);\n\n\tif (msgCase === \"interactionUpdate\") {\n\t\tprocessInteractionUpdate(msg.message.value, output, stream, state, usageState);\n\t} else if (msgCase === \"kvServerMessage\") {\n\t\thandleKvServerMessage(msg.message.value as KvServerMessage, blobStore, h2Request);\n\t} else if (msgCase === \"execServerMessage\") {\n\t\t// The server is waiting on OUR local tool result during this window — no\n\t\t// AssistantMessageEvent flows until the handler finishes. Mark the wait\n\t\t// as local work so idle watchdogs attribute the silence to the tool run\n\t\t// instead of aborting a healthy stream.\n\t\tawait stream.trackLocalWork(\n\t\t\thandleExecServerMessage(\n\t\t\t\tmsg.message.value as ExecServerMessage,\n\t\t\t\th2Request,\n\t\t\t\texecHandlers,\n\t\t\t\tonToolResult,\n\t\t\t\trequestContextTools,\n\t\t\t\toutput,\n\t\t\t\tstream,\n\t\t\t\tstate,\n\t\t\t),\n\t\t);\n\t} else if (msgCase === \"conversationCheckpointUpdate\") {\n\t\tonConversationCheckpoint?.(msg.message.value);\n\t}\n}\n\nfunction handleKvServerMessage(\n\tkvMsg: KvServerMessage,\n\tblobStore: Map<string, Uint8Array>,\n\th2Request: http2.ClientHttp2Stream,\n): void {\n\tconst kvCase = kvMsg.message.case;\n\n\tif (kvCase === \"getBlobArgs\") {\n\t\tconst blobId = kvMsg.message.value.blobId;\n\t\tconst blobIdKey = Buffer.from(blobId).toString(\"hex\");\n\t\tconst blobData = blobStore.get(blobIdKey);\n\t\tconst response = create(KvClientMessageSchema, {\n\t\t\tid: kvMsg.id,\n\t\t\tmessage: {\n\t\t\t\tcase: \"getBlobResult\",\n\t\t\t\tvalue: create(GetBlobResultSchema, blobData ? { blobData } : {}),\n\t\t\t},\n\t\t});\n\t\tconst kvClientMessage = create(AgentClientMessageSchema, {\n\t\t\tmessage: { case: \"kvClientMessage\", value: response },\n\t\t});\n\t\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, kvClientMessage)));\n\t\tlog(\"kvClient\", \"getBlobResult\", { blobId: blobIdKey.slice(0, 40) });\n\t} else if (kvCase === \"setBlobArgs\") {\n\t\tconst { blobId, blobData } = kvMsg.message.value;\n\t\tconst blobIdKey = Buffer.from(blobId).toString(\"hex\");\n\t\tblobStore.set(blobIdKey, blobData);\n\t\tconst response = create(KvClientMessageSchema, {\n\t\t\tid: kvMsg.id,\n\t\t\tmessage: {\n\t\t\t\tcase: \"setBlobResult\",\n\t\t\t\tvalue: create(SetBlobResultSchema, {}),\n\t\t\t},\n\t\t});\n\t\tconst kvClientMessage = create(AgentClientMessageSchema, {\n\t\t\tmessage: { case: \"kvClientMessage\", value: response },\n\t\t});\n\t\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, kvClientMessage)));\n\t\tlog(\"kvClient\", \"setBlobResult\", { blobId: blobIdKey.slice(0, 40) });\n\t}\n}\n\nfunction sendShellStreamEvent(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\tevent: ShellStream[\"event\"],\n): void {\n\tsendExecClientMessage(h2Request, execMsg, \"shellStream\", create(ShellStreamSchema, { event }));\n}\n\nfunction sanitizeShellExecResult(execResult: ShellResult): ShellResult {\n\tconst result = execResult.result;\n\tif (!result) return execResult;\n\n\tswitch (result.case) {\n\t\tcase \"success\":\n\t\tcase \"failure\": {\n\t\t\tconst value = result.value;\n\t\t\treturn {\n\t\t\t\t...execResult,\n\t\t\t\tresult: {\n\t\t\t\t\tcase: result.case,\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t...value,\n\t\t\t\t\t\tstdout: value.stdout ? sanitizeSurrogates(value.stdout) : value.stdout,\n\t\t\t\t\t\tstderr: value.stderr ? sanitizeSurrogates(value.stderr) : value.stderr,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} as ShellResult;\n\t\t}\n\t\tdefault:\n\t\t\treturn execResult;\n\t}\n}\n\nasync function handleShellStreamArgs(\n\targs: ShellArgs,\n\texecMsg: ExecServerMessage,\n\th2Request: http2.ClientHttp2Stream,\n\texecHandlers: CursorExecHandlers | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n): Promise<void> {\n\tconst normalizedWorkingDirectory = args.workingDirectory || process.cwd();\n\tconst normalizedArgs: ShellArgs = { ...args, workingDirectory: normalizedWorkingDirectory };\n\n\tsendShellStreamEvent(h2Request, execMsg, { case: \"start\", value: create(ShellStreamStartSchema, {}) });\n\n\t// Buffer for incomplete ANSI sequences across chunks.\n\tlet stdoutBuffer = \"\";\n\tlet stderrBuffer = \"\";\n\n\tconst incompleteEscapeRegex = /\\x1b(|\\[|\\[\\d*|\\[\\?|\\[\\?\\d*|\\]\\d*;?)$/;\n\n\tconst flushStdout = () => {\n\t\tif (stdoutBuffer) {\n\t\t\tlet safeEnd = stdoutBuffer.length;\n\t\t\tconst match = stdoutBuffer.match(incompleteEscapeRegex);\n\t\t\tif (match && match[0].length > 0) {\n\t\t\t\tsafeEnd = stdoutBuffer.length - match[0].length;\n\t\t\t}\n\t\t\tconst toSend = stdoutBuffer.slice(0, safeEnd);\n\t\t\tconst remaining = stdoutBuffer.slice(safeEnd);\n\t\t\tif (toSend) {\n\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\tcase: \"stdout\",\n\t\t\t\t\tvalue: create(ShellStreamStdoutSchema, { data: sanitizeSurrogates(toSend) }),\n\t\t\t\t});\n\t\t\t}\n\t\t\tstdoutBuffer = remaining;\n\t\t}\n\t};\n\n\tconst flushStderr = () => {\n\t\tif (stderrBuffer) {\n\t\t\tlet safeEnd = stderrBuffer.length;\n\t\t\tconst match = stderrBuffer.match(incompleteEscapeRegex);\n\t\t\tif (match && match[0].length > 0) {\n\t\t\t\tsafeEnd = stderrBuffer.length - match[0].length;\n\t\t\t}\n\t\t\tconst toSend = stderrBuffer.slice(0, safeEnd);\n\t\t\tconst remaining = stderrBuffer.slice(safeEnd);\n\t\t\tif (toSend) {\n\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\tcase: \"stderr\",\n\t\t\t\t\tvalue: create(ShellStreamStderrSchema, { data: sanitizeSurrogates(toSend) }),\n\t\t\t\t});\n\t\t\t}\n\t\t\tstderrBuffer = remaining;\n\t\t}\n\t};\n\n\tlet stdoutFlushTimer: NodeJS.Timeout | null = null;\n\tlet stderrFlushTimer: NodeJS.Timeout | null = null;\n\n\tconst scheduleStdoutFlush = () => {\n\t\tif (!stdoutFlushTimer) {\n\t\t\tstdoutFlushTimer = setTimeout(() => {\n\t\t\t\tstdoutFlushTimer = null;\n\t\t\t\tflushStdout();\n\t\t\t}, 100);\n\t\t}\n\t};\n\n\tconst scheduleStderrFlush = () => {\n\t\tif (!stderrFlushTimer) {\n\t\t\tstderrFlushTimer = setTimeout(() => {\n\t\t\t\tstderrFlushTimer = null;\n\t\t\t\tflushStderr();\n\t\t\t}, 100);\n\t\t}\n\t};\n\n\tconst streamCallbacks: CursorShellStreamCallbacks = {\n\t\tonStdout(data: string) {\n\t\t\tstdoutBuffer += data;\n\t\t\tif (stdoutBuffer.includes(\"\\n\") || stdoutBuffer.length > 4096) {\n\t\t\t\tif (stdoutFlushTimer) {\n\t\t\t\t\tclearTimeout(stdoutFlushTimer);\n\t\t\t\t\tstdoutFlushTimer = null;\n\t\t\t\t}\n\t\t\t\tflushStdout();\n\t\t\t} else {\n\t\t\t\tscheduleStdoutFlush();\n\t\t\t}\n\t\t},\n\t\tonStderr(data: string) {\n\t\t\tstderrBuffer += data;\n\t\t\tif (stderrBuffer.includes(\"\\n\") || stderrBuffer.length > 4096) {\n\t\t\t\tif (stderrFlushTimer) {\n\t\t\t\t\tclearTimeout(stderrFlushTimer);\n\t\t\t\t\tstderrFlushTimer = null;\n\t\t\t\t}\n\t\t\t\tflushStderr();\n\t\t\t} else {\n\t\t\t\tscheduleStderrFlush();\n\t\t\t}\n\t\t},\n\t};\n\n\t// Prefer the streaming handler — it forwards output chunks in real time.\n\tconst streamHandler = execHandlers?.shellStream?.bind(execHandlers);\n\tconst batchHandler = execHandlers?.shell?.bind(execHandlers);\n\tconst handler = streamHandler ? (shellArgs: ShellArgs) => streamHandler(shellArgs, streamCallbacks) : batchHandler;\n\n\tconst { execResult } = await resolveExecHandler(\n\t\tnormalizedArgs,\n\t\thandler as typeof batchHandler,\n\t\tonToolResult,\n\t\t(toolResult) => buildShellResultFromToolResult(normalizedArgs, toolResult),\n\t\t(reason) => buildShellRejectedResult(normalizedArgs.command, normalizedArgs.workingDirectory, reason),\n\t\t(error) => buildShellFailureResult(normalizedArgs.command, normalizedArgs.workingDirectory, error),\n\t\t{ toolCallId: args.toolCallId, toolName: \"bash\" },\n\t);\n\n\t// When using the batch handler (no shellStream), send buffered stdout/stderr\n\t// after execution completes. With shellStream these were already sent live.\n\tconst sendBufferedOutput = !streamHandler;\n\tconst sanitizedExecResult = sanitizeShellExecResult(execResult);\n\n\tif (stdoutFlushTimer) clearTimeout(stdoutFlushTimer);\n\tif (stderrFlushTimer) clearTimeout(stderrFlushTimer);\n\tflushStdout();\n\tflushStderr();\n\n\tsendShellStreamExitFromResult(h2Request, execMsg, sanitizedExecResult, sendBufferedOutput);\n\t// Cursor can keep the turn pending when it receives only stream deltas.\n\t// Send the final structured shellResult as completion acknowledgement.\n\tsendExecClientMessage(h2Request, execMsg, \"shellResult\", sanitizedExecResult);\n}\n\nfunction sendShellStreamExitFromResult(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\texecResult: ShellResult,\n\tsendBufferedOutput: boolean,\n): void {\n\tconst result = execResult.result;\n\tswitch (result.case) {\n\t\tcase \"success\": {\n\t\t\tconst value = result.value;\n\t\t\tif (sendBufferedOutput) {\n\t\t\t\tif (value.stdout) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stdout\",\n\t\t\t\t\t\tvalue: create(ShellStreamStdoutSchema, { data: sanitizeSurrogates(value.stdout) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (value.stderr) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stderr\",\n\t\t\t\t\t\tvalue: create(ShellStreamStderrSchema, { data: sanitizeSurrogates(value.stderr) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: value.exitCode,\n\t\t\t\t\tcwd: value.workingDirectory,\n\t\t\t\t\taborted: false,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"failure\": {\n\t\t\tconst value = result.value;\n\t\t\tif (sendBufferedOutput) {\n\t\t\t\tif (value.stdout) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stdout\",\n\t\t\t\t\t\tvalue: create(ShellStreamStdoutSchema, { data: sanitizeSurrogates(value.stdout) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (value.stderr) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stderr\",\n\t\t\t\t\t\tvalue: create(ShellStreamStderrSchema, { data: sanitizeSurrogates(value.stderr) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: value.exitCode,\n\t\t\t\t\tcwd: value.workingDirectory,\n\t\t\t\t\taborted: value.aborted,\n\t\t\t\t\tabortReason: value.abortReason,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"rejected\": {\n\t\t\tsendShellStreamEvent(h2Request, execMsg, { case: \"rejected\", value: result.value });\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: 1,\n\t\t\t\t\tcwd: result.value.workingDirectory,\n\t\t\t\t\taborted: false,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"timeout\": {\n\t\t\tconst value = result.value;\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"stderr\",\n\t\t\t\tvalue: create(ShellStreamStderrSchema, {\n\t\t\t\t\tdata: `Command timed out after ${value.timeoutMs}ms`,\n\t\t\t\t}),\n\t\t\t});\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: 1,\n\t\t\t\t\tcwd: value.workingDirectory,\n\t\t\t\t\taborted: true,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"permissionDenied\": {\n\t\t\tsendShellStreamEvent(h2Request, execMsg, { case: \"permissionDenied\", value: result.value });\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: 1,\n\t\t\t\t\tcwd: result.value.workingDirectory,\n\t\t\t\t\taborted: false,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tdefault:\n\t\t\treturn;\n\t}\n}\n\ntype ExecDispatchContext = {\n\treadonly execMsg: ExecServerMessage;\n\treadonly h2Request: http2.ClientHttp2Stream;\n\treadonly execHandlers: CursorExecHandlers | undefined;\n\treadonly onToolResult: CursorToolResultHandler | undefined;\n\treadonly requestContextTools: McpToolDefinition[];\n\treadonly output: AssistantMessage;\n\treadonly stream: AssistantMessageEventStream;\n\treadonly state: BlockState;\n};\n\nasync function handleExecServerMessage(\n\texecMsg: ExecServerMessage,\n\th2Request: http2.ClientHttp2Stream,\n\texecHandlers: CursorExecHandlers | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n\trequestContextTools: McpToolDefinition[],\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n): Promise<void> {\n\tconst execCase = execMsg.message.case;\n\tlog(\"exec\", \"dispatch\", { execCase, execId: execMsg.execId, hasHandlers: !!execHandlers });\n\tif (!execCase) {\n\t\t// A frame carrying a oneof number this build's `agent.proto` does not\n\t\t// model at all. Returning silently strands the exec id — the server\n\t\t// waits on a reply that never comes.\n\t\tlog(\"warn\", \"unknownExecVariant\", { id: execMsg.id, execId: execMsg.execId });\n\t\tsendExecClientThrow(h2Request, execMsg, \"Unknown exec message variant\", \"unknown_exec_variant\");\n\t\tsendExecClientStreamClose(h2Request, execMsg);\n\t\treturn;\n\t}\n\n\tconst stopExecHeartbeat = armCursorExecHeartbeat(h2Request, execMsg);\n\ttry {\n\t\tawait dispatchExecServerMessage({\n\t\t\texecMsg,\n\t\t\th2Request,\n\t\t\texecHandlers,\n\t\t\tonToolResult,\n\t\t\trequestContextTools,\n\t\t\toutput,\n\t\t\tstream,\n\t\t\tstate,\n\t\t});\n\t} catch (error) {\n\t\tlog(\"error\", \"execDispatch\", {\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\tid: execMsg.id,\n\t\t\texecId: execMsg.execId,\n\t\t});\n\t\tsendExecClientThrow(h2Request, execMsg, \"Local exec dispatch failed\", \"exec_dispatch_failed\");\n\t} finally {\n\t\tstopExecHeartbeat();\n\t\tsendExecClientStreamClose(h2Request, execMsg);\n\t}\n}\n\nasync function dispatchExecServerMessage(context: ExecDispatchContext): Promise<void> {\n\tconst { execMsg, h2Request, execHandlers, onToolResult, requestContextTools, output, stream, state } = context;\n\tconst execCase = execMsg.message.case;\n\tif (!execCase) throw new Error(\"Expected a recognized exec message\");\n\tif (execCase === \"requestContextArgs\") {\n\t\tconst requestContext = create(RequestContextSchema, {\n\t\t\trules: [],\n\t\t\trepositoryInfo: [],\n\t\t\ttools: requestContextTools,\n\t\t\tgitRepos: [],\n\t\t\tprojectLayouts: [],\n\t\t\tmcpInstructions: [],\n\t\t\tfileContents: {},\n\t\t\tcustomSubagents: [],\n\t\t});\n\n\t\tconst requestContextResult = create(RequestContextResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"success\",\n\t\t\t\tvalue: create(RequestContextSuccessSchema, { requestContext }),\n\t\t\t},\n\t\t});\n\n\t\tsendExecClientMessage(h2Request, execMsg, \"requestContextResult\", requestContextResult);\n\t\treturn;\n\t}\n\n\tswitch (execCase) {\n\t\tcase \"readArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"read\", {\n\t\t\t\tpath: args.path,\n\t\t\t\toffset: args.offset,\n\t\t\t\tlimit: args.limit,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.read?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) =>\n\t\t\t\t\tbuildReadResultFromToolResult(\n\t\t\t\t\t\targs.path,\n\t\t\t\t\t\ttoolResult,\n\t\t\t\t\t\targs.offset !== undefined || args.limit !== undefined,\n\t\t\t\t\t),\n\t\t\t\t(reason) => buildReadRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildReadErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"read\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"readResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"lsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\t// The bridge maps `ls` onto the local `ls` tool; mirror that here so\n\t\t\t// the synthesized block matches the toolResult's `toolName`.\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"ls\", { path: piLsPath(args.path) });\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.ls?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildLsResultFromToolResult(args.path, toolResult),\n\t\t\t\t(reason) => buildLsRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildLsErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"ls\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"lsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"grepArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\t// Cursor's model sometimes emits `grepArgs` with an empty `pattern`\n\t\t\t// and a non-empty `glob`, expecting grep to list files matching the\n\t\t\t// glob. Reject that up front with an actionable error.\n\t\t\tconst emptyPatternError = emptyGrepPatternRejection(args.pattern, args.glob);\n\t\t\tif (emptyPatternError !== null) {\n\t\t\t\tsendExecClientMessage(h2Request, execMsg, \"grepResult\", buildGrepErrorResult(emptyPatternError));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Mirror the coding-agent bridge's arg mapping so live UI (from\n\t\t\t// `tool_execution_start`) and rebuilt transcript display identical args.\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"grep\", {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || undefined,\n\t\t\t\tglob: args.glob || undefined,\n\t\t\t\tignoreCase: args.caseInsensitive === true ? true : undefined,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.grep?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildGrepResultFromToolResult(args, toolResult),\n\t\t\t\t(reason) => buildGrepErrorResult(reason),\n\t\t\t\t(error) => buildGrepErrorResult(error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"grep\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"grepResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"writeArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\t// Match the bridge: prefer `fileText`, fall back to decoded `fileBytes`.\n\t\t\tconst content = args.fileText ?? new TextDecoder().decode(args.fileBytes ?? new Uint8Array());\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"write\", {\n\t\t\t\tpath: args.path,\n\t\t\t\tcontent,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.write?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) =>\n\t\t\t\t\tbuildWriteResultFromToolResult(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\t\tfileText: args.fileText,\n\t\t\t\t\t\t\tfileBytes: args.fileBytes,\n\t\t\t\t\t\t\treturnFileContentAfterWrite: args.returnFileContentAfterWrite,\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoolResult,\n\t\t\t\t\t),\n\t\t\t\t(reason) => buildWriteRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildWriteErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"write\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"writeResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"deleteArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"delete\", { path: args.path });\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.delete?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildDeleteResultFromToolResult(args.path, toolResult),\n\t\t\t\t(reason) => buildDeleteRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildDeleteErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"delete\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"deleteResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"shellArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst normalizedArgs: ShellArgs = { ...args, workingDirectory: args.workingDirectory || process.cwd() };\n\t\t\tconst shellTimeout = args.timeout && args.timeout > 0 ? args.timeout : undefined;\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"bash\", {\n\t\t\t\tcommand: composeShellCommand(args.command, args.workingDirectory || undefined),\n\t\t\t\ttimeout: shellTimeout,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\tnormalizedArgs,\n\t\t\t\texecHandlers?.shell?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildShellResultFromToolResult(normalizedArgs, toolResult),\n\t\t\t\t(reason) => buildShellRejectedResult(normalizedArgs.command, normalizedArgs.workingDirectory, reason),\n\t\t\t\t(error) => buildShellFailureResult(normalizedArgs.command, normalizedArgs.workingDirectory, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"bash\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"shellResult\", sanitizeShellExecResult(execResult));\n\t\t\treturn;\n\t\t}\n\t\tcase \"shellStreamArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst shellStreamTimeout = args.timeout && args.timeout > 0 ? args.timeout : undefined;\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"bash\", {\n\t\t\t\tcommand: composeShellCommand(args.command, args.workingDirectory || undefined),\n\t\t\t\ttimeout: shellStreamTimeout,\n\t\t\t});\n\t\t\tawait handleShellStreamArgs(args, execMsg, h2Request, execHandlers, onToolResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"backgroundShellSpawnArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(BackgroundShellSpawnResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"rejected\",\n\t\t\t\t\tvalue: create(ShellRejectedSchema, {\n\t\t\t\t\t\tcommand: args.command,\n\t\t\t\t\t\tworkingDirectory: args.workingDirectory,\n\t\t\t\t\t\treason: \"Not implemented\",\n\t\t\t\t\t\tisReadonly: false,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"backgroundShellSpawnResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"writeShellStdinArgs\": {\n\t\t\tconst execResult = create(WriteShellStdinResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(WriteShellStdinErrorSchema, {\n\t\t\t\t\t\terror: \"Not implemented\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"writeShellStdinResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"fetchArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(FetchResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(FetchErrorSchema, {\n\t\t\t\t\t\turl: args.url,\n\t\t\t\t\t\terror: \"Not implemented\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"fetchResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"diagnosticsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.diagnostics?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildDiagnosticsResultFromToolResult(args.path, toolResult),\n\t\t\t\t(reason) => buildDiagnosticsRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildDiagnosticsErrorResult(args.path, error),\n\t\t\t\t// senpi has no local diagnostics tool; the frame is answered with a\n\t\t\t\t// refusal and no block is synthesized (nothing ran).\n\t\t\t\tnull,\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"diagnosticsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"mcpArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst mcpCall = decodeMcpCall(args);\n\t\t\t// An approval probe, not an invocation: the frame asks whether the\n\t\t\t// call would be permitted. Only a definite allow is approved; without\n\t\t\t// a handler there is nothing to decide with, so it is refused. Either\n\t\t\t// way no block is synthesized — nothing ran.\n\t\t\tif (mcpCall.approvalOnly) {\n\t\t\t\tconst approved = (await execHandlers?.mcpApprovalPreflight?.(mcpCall)) === true;\n\t\t\t\tsendExecClientMessage(\n\t\t\t\t\th2Request,\n\t\t\t\t\texecMsg,\n\t\t\t\t\t\"mcpResult\",\n\t\t\t\t\tcreate(McpResultSchema, {\n\t\t\t\t\t\tresult: approved\n\t\t\t\t\t\t\t? { case: \"approved\", value: create(McpApprovedSchema, {}) }\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tcase: \"rejected\",\n\t\t\t\t\t\t\t\t\tvalue: create(McpRejectedSchema, {\n\t\t\t\t\t\t\t\t\t\treason: `Tool \"${mcpCall.toolName || mcpCall.name}\" is not approved to run without asking.`,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (execHandlers?.mcp) {\n\t\t\t\tconst existingBlock = output.content.find(\n\t\t\t\t\t(block) => block.type === \"toolCall\" && block.id === mcpCall.toolCallId,\n\t\t\t\t);\n\t\t\t\tif (existingBlock) {\n\t\t\t\t\tmarkCursorExecResolved(existingBlock);\n\t\t\t\t} else {\n\t\t\t\t\tsynthesizeCursorExecToolCall(\n\t\t\t\t\t\toutput,\n\t\t\t\t\t\tstream,\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\tmcpCall.toolCallId,\n\t\t\t\t\t\tmcpCall.toolName || mcpCall.name,\n\t\t\t\t\t\tmcpCall.args,\n\t\t\t\t\t);\n\t\t\t\t\tstate.resolvedMcpToolCallIds.add(mcpCall.toolCallId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\tmcpCall,\n\t\t\t\texecHandlers?.mcp?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildMcpResultFromToolResult(mcpCall, toolResult),\n\t\t\t\t(_reason) => buildMcpToolNotFoundResult(mcpCall),\n\t\t\t\t(error) => buildMcpErrorResult(error),\n\t\t\t\texecHandlers?.mcp ? { toolCallId: mcpCall.toolCallId, toolName: mcpCall.toolName } : null,\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"mcpResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"listMcpResourcesExecArgs\": {\n\t\t\t// This client hosts no MCP resources; the honest answer is an explicit\n\t\t\t// empty success. An unset-oneof result would read as \"the call\n\t\t\t// produced nothing\".\n\t\t\tconst execResult = create(ListMcpResourcesExecResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"success\",\n\t\t\t\t\tvalue: create(ListMcpResourcesSuccessSchema, { resources: [] }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"listMcpResourcesExecResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"readMcpResourceExecArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(ReadMcpResourceExecResultSchema, {\n\t\t\t\tresult: { case: \"notFound\", value: create(ReadMcpResourceNotFoundSchema, { uri: args.uri }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"readMcpResourceExecResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"recordScreenArgs\": {\n\t\t\tconst execResult = create(RecordScreenResultSchema, {\n\t\t\t\tresult: { case: \"failure\", value: create(RecordScreenFailureSchema, { error: NOT_IMPLEMENTED }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"recordScreenResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"computerUseArgs\": {\n\t\t\tconst execResult = create(ComputerUseResultSchema, {\n\t\t\t\tresult: { case: \"error\", value: create(ComputerUseErrorSchema, { error: NOT_IMPLEMENTED }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"computerUseResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piReadArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tconst readArgs = piReadArgs(args.path, args.offset, args.limit);\n\t\t\tsynthesizeCursorExecToolCall(\n\t\t\t\toutput,\n\t\t\t\tstream,\n\t\t\t\tstate,\n\t\t\t\ttoolCallId,\n\t\t\t\t\"read\",\n\t\t\t\treadArgs ?? { path: args.path, offset: args.offset, limit: 0 },\n\t\t\t);\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piRead?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiReadResult,\n\t\t\t\tbuildPiReadError,\n\t\t\t\tbuildPiReadError,\n\t\t\t\t{ toolCallId, toolName: \"read\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piReadResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piBashArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"bash\", {\n\t\t\t\tcommand: args.command,\n\t\t\t\ttimeout: piTimeout(args.timeout),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piBash?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiBashResult,\n\t\t\t\tbuildPiBashError,\n\t\t\t\tbuildPiBashError,\n\t\t\t\t{ toolCallId, toolName: \"bash\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piBashResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piEditArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\t// `PiEditReplacement[]` maps 1:1 onto the local `edit` tool's\n\t\t\t// `edits[{oldText,newText}]` shape.\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"edit\", {\n\t\t\t\tpath: args.path,\n\t\t\t\tedits: args.edits.map((edit) => ({ oldText: edit.oldText, newText: edit.newText })),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piEdit?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiEditResult,\n\t\t\t\tbuildPiEditRejected,\n\t\t\t\tbuildPiEditError,\n\t\t\t\t{ toolCallId, toolName: \"edit\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piEditResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piWriteArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"write\", {\n\t\t\t\tpath: args.path,\n\t\t\t\tcontent: args.content,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piWrite?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiWriteResult,\n\t\t\t\tbuildPiWriteRejected,\n\t\t\t\tbuildPiWriteError,\n\t\t\t\t{ toolCallId, toolName: \"write\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piWriteResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piGrepArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"grep\", {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || undefined,\n\t\t\t\tglob: args.glob || undefined,\n\t\t\t\tignoreCase: args.ignoreCase === true ? true : undefined,\n\t\t\t\tliteral: args.literal === true ? true : undefined,\n\t\t\t\tcontext: args.context,\n\t\t\t\tlimit: piLimit(args.limit),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piGrep?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiGrepResult,\n\t\t\t\tbuildPiGrepError,\n\t\t\t\tbuildPiGrepError,\n\t\t\t\t{ toolCallId, toolName: \"grep\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piGrepResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piFindArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"find\", {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || undefined,\n\t\t\t\tlimit: piLimit(args.limit),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piFind?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiFindResult,\n\t\t\t\tbuildPiFindError,\n\t\t\t\tbuildPiFindError,\n\t\t\t\t{ toolCallId, toolName: \"find\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piFindResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piLsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"ls\", {\n\t\t\t\tpath: piLsPath(args.path),\n\t\t\t\tlimit: piLimit(args.limit),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piLs?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiLsResult,\n\t\t\t\tbuildPiLsError,\n\t\t\t\tbuildPiLsError,\n\t\t\t\t{ toolCallId, toolName: \"ls\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piLsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"miniSweAgentBashArgs\": {\n\t\t\t// Same `ShellArgs`/`ShellResult` pair as `shellArgs`, under its own\n\t\t\t// frame number, so the existing shell handler answers it unchanged.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst normalizedArgs: ShellArgs = { ...args, workingDirectory: args.workingDirectory || process.cwd() };\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"bash\", {\n\t\t\t\tcommand: composeShellCommand(args.command, args.workingDirectory || undefined),\n\t\t\t\ttimeout: args.timeout && args.timeout > 0 ? args.timeout : undefined,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\tnormalizedArgs,\n\t\t\t\texecHandlers?.shell?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildShellResultFromToolResult(normalizedArgs, toolResult),\n\t\t\t\t(reason) => buildShellRejectedResult(normalizedArgs.command, normalizedArgs.workingDirectory, reason),\n\t\t\t\t(error) => buildShellFailureResult(normalizedArgs.command, normalizedArgs.workingDirectory, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"bash\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"miniSweAgentBashResult\", sanitizeShellExecResult(execResult));\n\t\t\treturn;\n\t\t}\n\t\tcase \"redactedReadArgs\": {\n\t\t\t// The server expects the client to strip secrets from the content\n\t\t\t// first. No redaction is implemented here, and serving a plain read\n\t\t\t// would hand back exactly the unredacted bytes the frame exists to\n\t\t\t// withhold.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"redactedReadResult\",\n\t\t\t\tbuildReadErrorResult(args.path, \"Secret redaction is not implemented by this client\"),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"mcpStateExecArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"mcpStateExecResult\",\n\t\t\t\tbuildMcpStateResult(requestContextTools, args.serverIdentifiers),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"executeHookArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = buildNeutralHookResult(args.request);\n\t\t\tif (!execResult) {\n\t\t\t\tsendExecClientThrow(\n\t\t\t\t\th2Request,\n\t\t\t\t\texecMsg,\n\t\t\t\t\t`Unsupported hook request: ${args.request?.request.case ?? \"unset\"}`,\n\t\t\t\t\t\"unknown_hook_request\",\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"executeHookResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"subagentArgs\": {\n\t\t\tconst execResult = create(SubagentResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(SubagentErrorSchema, { error: `Subagents are ${NOT_IMPLEMENTED_SUFFIX}` }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"subagentResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"subagentAwaitArgs\": {\n\t\t\t// No subagent was ever spawned, so every awaited id is genuinely unknown.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(SubagentAwaitResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"notFound\",\n\t\t\t\t\tvalue: create(SubagentAwaitNotFoundSchema, { agentId: args.agentId }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"subagentAwaitResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"forceBackgroundShellArgs\": {\n\t\t\t// Backgrounding targets a running tool call by id. This client runs\n\t\t\t// every shell to completion in band, so there is never one to move.\n\t\t\tconst execResult = create(ForceBackgroundShellResultSchema, {\n\t\t\t\tstatus: ForceBackgroundShellStatus.NOT_FOUND,\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"forceBackgroundShellResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"forceBackgroundSubagentArgs\": {\n\t\t\tconst execResult = create(ForceBackgroundSubagentResultSchema, {\n\t\t\t\tstatus: ForceBackgroundSubagentStatus.NOT_FOUND,\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"forceBackgroundSubagentResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"smartModeClassifierArgs\": {\n\t\t\t// The classifier decides whether a risky action needs approval.\n\t\t\t// Answering `ALLOW` would silently wave through actions the server\n\t\t\t// asked us to judge, so the honest answer is that no classifier\n\t\t\t// exists here.\n\t\t\tconst execResult = create(SmartModeClassifierResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(SmartModeClassifierErrorSchema, {\n\t\t\t\t\t\terror: `Smart-mode classification is ${NOT_IMPLEMENTED_SUFFIX}`,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"smartModeClassifierResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"canvasDiagnosticsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(CanvasDiagnosticsResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(CanvasDiagnosticsErrorSchema, {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\terror: `Canvas diagnostics are ${NOT_IMPLEMENTED_SUFFIX}`,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"canvasDiagnosticsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"shellAllowlistPrecheckArgs\": {\n\t\t\t// The prechecks ask \"is this pre-approved, so may it skip the approval\n\t\t\t// prompt?\". This client keeps no allowlist, so the answer is always\n\t\t\t// no: `false` costs an approval round-trip, `true` would grant one\n\t\t\t// that was never configured.\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"shellAllowlistPrecheckResult\",\n\t\t\t\tcreate(ShellAllowlistPrecheckResultSchema, { allowlisted: false }),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"mcpAllowlistPrecheckArgs\": {\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"mcpAllowlistPrecheckResult\",\n\t\t\t\tcreate(McpAllowlistPrecheckResultSchema, { allowlisted: false }),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"webFetchAllowlistPrecheckArgs\": {\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"webFetchAllowlistPrecheckResult\",\n\t\t\t\tcreate(WebFetchAllowlistPrecheckResultSchema, { allowlisted: false }),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"conversationSearchArgs\": {\n\t\t\t// Cursor conversation history lives server-side; this client keeps no\n\t\t\t// local index of it to search. The streamed envelope announces this\n\t\t\t// call but the interaction decoder builds no block for it, so the\n\t\t\t// block and its paired result are synthesized here.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = args.toolCallId || randomUUID();\n\t\t\tconst error = `Conversation search is ${NOT_IMPLEMENTED_SUFFIX}`;\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"search_conversations\", {\n\t\t\t\tquery: args.query,\n\t\t\t\tlimit: args.limit,\n\t\t\t});\n\t\t\tawait pairSynthesizedExecResult(state, onToolResult, toolCallId, \"search_conversations\", error);\n\t\t\tconst execResult = create(ConversationSearchResultSchema, {\n\t\t\t\tresult: { case: \"error\", value: create(ConversationSearchErrorSchema, { error }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"conversationSearchResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"agentStoreConflictArgs\": {\n\t\t\t// The agent store is Cursor's own on-disk journal; this client never\n\t\t\t// writes one, so it has no conflict events to replay.\n\t\t\tconst execResult = create(AgentStoreConflictResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(AgentStoreConflictErrorSchema, {\n\t\t\t\t\t\terror: `Agent store conflicts are ${NOT_IMPLEMENTED_SUFFIX}`,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"agentStoreConflictResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"gitDiffRequest\": {\n\t\t\t// `GetDiffResponse` has no error variant, so any in-band answer is a\n\t\t\t// claim that a diff was computed; a `throw` is the only truthful reply.\n\t\t\tsendExecClientThrow(h2Request, execMsg, `Git diff is ${NOT_IMPLEMENTED_SUFFIX}`, \"exec_variant_unsupported\");\n\t\t\treturn;\n\t\t}\n\t\tdefault: {\n\t\t\t// A frame number this build recognises structurally but has no answer\n\t\t\t// for. Distinct from the unset-case path above: there the client\n\t\t\t// cannot even name the frame.\n\t\t\tlog(\"warn\", \"unhandledExecMessage\", { execCase });\n\t\t\tsendExecClientThrow(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t`No handler for exec message of type ${execCase}`,\n\t\t\t\t\"exec_variant_unsupported\",\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction armCursorExecHeartbeat(h2Request: http2.ClientHttp2Stream, execMsg: ExecServerMessage): () => void {\n\treturn armExecHeartbeat({\n\t\tintervalMs: EXEC_HEARTBEAT_INTERVAL_MS,\n\t\tisClosed: () => h2Request.closed,\n\t\twriteHeartbeat: (onComplete) => {\n\t\t\tconst controlMessage = create(ExecClientControlMessageSchema, {\n\t\t\t\tmessage: {\n\t\t\t\t\tcase: \"heartbeat\",\n\t\t\t\t\tvalue: create(ExecClientHeartbeatSchema, { id: execMsg.id }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\t\t\tmessage: { case: \"execClientControlMessage\", value: controlMessage },\n\t\t\t});\n\t\t\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)), onComplete);\n\t\t\tlog(\"execClientControl\", \"heartbeat\", { id: execMsg.id, execId: execMsg.execId });\n\t\t},\n\t});\n}\n\n/**\n * Send one typed answer on the exec channel.\n *\n * `ExecClientMessage[\"message\"]` is a discriminated union pairing each case\n * with its own result type, so the generic is keyed on the case: passing a\n * `ReadResult` under `\"shellResult\"` is a compile error rather than a wire\n * message the server rejects at runtime.\n */\nfunction sendExecClientMessage<TCase extends NonNullable<ExecClientMessage[\"message\"][\"case\"]>>(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\tmessageCase: TCase,\n\tvalue: Extract<ExecClientMessage[\"message\"], { case: TCase }>[\"value\"],\n): void {\n\tconst execClientMessage = create(ExecClientMessageSchema, {\n\t\tid: execMsg.id,\n\t\texecId: execMsg.execId,\n\t\tmessage: { case: messageCase, value } as ExecClientMessage[\"message\"],\n\t});\n\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"execClientMessage\", value: execClientMessage },\n\t});\n\n\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)));\n\n\tlog(\"execClientMessage\", messageCase);\n}\n\n/**\n * Fail one exec frame in band.\n *\n * `ExecClientThrow` is the protocol's failure channel for a frame that cannot\n * be answered at all — as opposed to a frame answered with its own typed\n * error variant, which means \"the tool ran and failed\". The server surfaces\n * the error to the model instead of blocking on a reply that never comes.\n */\nfunction sendExecClientThrow(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\terror: string,\n\terrorCode?: string,\n): void {\n\tconst controlMessage = create(ExecClientControlMessageSchema, {\n\t\tmessage: {\n\t\t\tcase: \"throw\",\n\t\t\tvalue: create(ExecClientThrowSchema, { id: execMsg.id, error, errorCode }),\n\t\t},\n\t});\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"execClientControlMessage\", value: controlMessage },\n\t});\n\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)));\n\tlog(\"execClientControl\", \"throw\", { id: execMsg.id, execId: execMsg.execId, error, errorCode });\n}\n\nfunction sendExecClientStreamClose(h2Request: http2.ClientHttp2Stream, execMsg: ExecServerMessage): void {\n\tconst closeMessage = create(ExecClientControlMessageSchema, {\n\t\tmessage: {\n\t\t\tcase: \"streamClose\",\n\t\t\tvalue: create(ExecClientStreamCloseSchema, {\n\t\t\t\tid: execMsg.id,\n\t\t\t}),\n\t\t},\n\t});\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"execClientControlMessage\", value: closeMessage },\n\t});\n\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)));\n\tlog(\"execClientControl\", \"streamClose\", { id: execMsg.id, execId: execMsg.execId });\n}\n\n/**\n * Exported for tests: dispatches one exec frame onto its handler.\n *\n * Every exit pairs a `toolResult`. The synthesized block was already marked\n * `kCursorExecResolved` before this runs, so the agent loop emits no\n * placeholder for it: a path that returns without a result leaves the call\n * unpaired and transcript rebuilds strip the whole interaction. The three\n * result-less paths — no handler installed, a handler that produced nothing,\n * and a thrown handler — therefore synthesize one from the same text the\n * server sees in `execResult`.\n *\n * `pairing` is required so a new callsite cannot silently recreate the\n * orphan, and nullable for the callers whose block is NOT pre-resolved (MCP\n * without an `mcp` handler, which the agent loop runs locally and pairs\n * itself, and frames that never synthesize a block).\n */\nexport async function resolveExecHandler<TArgs, TResult>(\n\targs: TArgs,\n\thandler: ((args: TArgs) => Promise<CursorExecHandlerResult<TResult>>) | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n\tbuildFromToolResult: (toolResult: ToolResultMessage) => TResult,\n\tbuildRejected: (reason: string) => TResult,\n\tbuildError: (error: string) => TResult,\n\tpairing: CursorExecPairing | null,\n): Promise<{ execResult: TResult; toolResult?: ToolResultMessage }> {\n\tconst pair = async (text: string, isError: boolean): Promise<ToolResultMessage | undefined> => {\n\t\tif (!pairing) return undefined;\n\t\tconst synthesized: ToolResultMessage = {\n\t\t\trole: \"toolResult\",\n\t\t\ttoolCallId: pairing.toolCallId,\n\t\t\ttoolName: pairing.toolName,\n\t\t\tcontent: [{ type: \"text\", text }],\n\t\t\tisError,\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\t\treturn await applyToolResultHandler(synthesized, onToolResult);\n\t};\n\n\tif (!handler) {\n\t\tconst reason = \"Tool not available\";\n\t\treturn { execResult: buildRejected(reason), toolResult: await pair(reason, true) };\n\t}\n\n\ttry {\n\t\tconst handlerResult = await handler(args);\n\t\tconst { execResult, toolResult } = splitExecHandlerResult(handlerResult);\n\t\tconst finalToolResult = await applyToolResultHandler(toolResult, onToolResult);\n\n\t\tif (execResult) {\n\t\t\t// TResult-only is a supported return form, so the transcript entry\n\t\t\t// has to be synthesized here, derived from the raw result so the two\n\t\t\t// views stay consistent.\n\t\t\treturn {\n\t\t\t\texecResult,\n\t\t\t\ttoolResult: finalToolResult ?? (await pair(...describeExecResult(execResult))),\n\t\t\t};\n\t\t}\n\t\tif (finalToolResult) {\n\t\t\treturn { execResult: buildFromToolResult(finalToolResult), toolResult: finalToolResult };\n\t\t}\n\t\tconst reason = \"Tool returned no result\";\n\t\treturn { execResult: buildRejected(reason), toolResult: await pair(reason, true) };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\treturn { execResult: buildError(message), toolResult: await pair(message, true) };\n\t}\n}\n\n/**\n * Derive the transcript state of an exec result the handler returned in the\n * TResult-only form, which carries no `toolResult` to copy it from.\n *\n * Every exec result in `agent.proto` is a `oneof result` whose success\n * variant is named `success` — the rest are failures. MCP is the one shape\n * where `success` is not enough: `McpSuccess.is_error` carries an\n * application-level tool failure inside the success variant.\n */\nfunction describeExecResult(execResult: unknown): [text: string, isError: boolean] {\n\tconst result = (execResult as { result?: { case?: string; value?: unknown } } | null)?.result;\n\tconst variant = result?.case;\n\tif (variant === \"success\") {\n\t\tconst success = result?.value as { isError?: boolean; content?: unknown[] } | undefined;\n\t\tif (!success?.isError) return [\"Tool produced no transcript result\", false];\n\t\treturn [mcpContentToText(success.content) || \"MCP tool reported an error\", true];\n\t}\n\tif (!variant) return [\"Tool produced no transcript result\", false];\n\tconst value = result?.value as { error?: string; reason?: string } | undefined;\n\treturn [value?.error || value?.reason || `Tool call ${variant}`, true];\n}\n\n/** Flatten `McpSuccess.content` into transcript text. */\nfunction mcpContentToText(content: unknown[] | undefined): string {\n\tif (!Array.isArray(content)) return \"\";\n\tconst parts: string[] = [];\n\tfor (const item of content) {\n\t\tconst inner = (item as { content?: { case?: string; value?: { text?: string } } } | null)?.content;\n\t\tif (inner?.case === \"text\" && inner.value?.text) parts.push(inner.value.text);\n\t}\n\treturn parts.join(\"\\n\");\n}\n\nfunction splitExecHandlerResult<TResult>(result: CursorExecHandlerResult<TResult>): {\n\texecResult?: TResult;\n\ttoolResult?: ToolResultMessage;\n} {\n\tif (isToolResultMessage(result)) {\n\t\treturn { toolResult: result };\n\t}\n\tif (result && typeof result === \"object\") {\n\t\tconst record = result as Record<string, unknown>;\n\t\tif (\"execResult\" in record) {\n\t\t\tconst { execResult, toolResult } = record as {\n\t\t\t\texecResult: TResult;\n\t\t\t\ttoolResult?: ToolResultMessage;\n\t\t\t};\n\t\t\treturn { execResult, toolResult };\n\t\t}\n\t\tif (\"toolResult\" in record && !isToolResultMessage(record)) {\n\t\t\tconst { result: execResult, toolResult } = record as {\n\t\t\t\tresult?: TResult;\n\t\t\t\ttoolResult?: ToolResultMessage;\n\t\t\t};\n\t\t\treturn { execResult, toolResult };\n\t\t}\n\t\tif (\"result\" in record && !(\"$typeName\" in record)) {\n\t\t\tconst { result: execResult, toolResult } = record as {\n\t\t\t\tresult: TResult;\n\t\t\t\ttoolResult?: ToolResultMessage;\n\t\t\t};\n\t\t\treturn { execResult, toolResult };\n\t\t}\n\t}\n\treturn { execResult: result as TResult };\n}\n\nfunction isToolResultMessage(value: unknown): value is ToolResultMessage {\n\treturn !!value && typeof value === \"object\" && (value as ToolResultMessage).role === \"toolResult\";\n}\n\nasync function applyToolResultHandler(\n\ttoolResult: ToolResultMessage | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n): Promise<ToolResultMessage | undefined> {\n\tif (!toolResult || !onToolResult) {\n\t\treturn toolResult;\n\t}\n\tconst updated = await onToolResult(toolResult);\n\treturn updated ?? toolResult;\n}\n\nfunction toolResultToText(toolResult: ToolResultMessage): string {\n\treturn toolResult.content.map((item) => (item.type === \"text\" ? item.text : `[${item.mimeType} image]`)).join(\"\\n\");\n}\n\nfunction toolResultWasTruncated(toolResult: ToolResultMessage): boolean {\n\tif (!toolResult.details || typeof toolResult.details !== \"object\") {\n\t\treturn false;\n\t}\n\tconst truncation = (toolResult.details as { truncation?: { truncated?: boolean } }).truncation;\n\treturn !!truncation?.truncated;\n}\n\nfunction toolResultDetailBoolean(toolResult: ToolResultMessage, key: string): boolean {\n\tif (!toolResult.details || typeof toolResult.details !== \"object\") {\n\t\treturn false;\n\t}\n\tconst value = (toolResult.details as Record<string, unknown>)[key];\n\treturn typeof value === \"boolean\" ? value : false;\n}\n\n/** The file's own line count, when the tool recorded one. */\nfunction readTotalLinesFromDetails(toolResult: ToolResultMessage): number | undefined {\n\tconst details = toolResult.details;\n\tif (!details || typeof details !== \"object\") return undefined;\n\tconst direct = \"totalLines\" in details ? details.totalLines : undefined;\n\tif (typeof direct === \"number\" && Number.isFinite(direct)) return direct;\n\tconst meta = \"meta\" in details ? details.meta : undefined;\n\tif (!meta || typeof meta !== \"object\") return undefined;\n\tconst truncation = \"truncation\" in meta ? meta.truncation : undefined;\n\tif (!truncation || typeof truncation !== \"object\") return undefined;\n\tconst totalLines = \"totalLines\" in truncation ? truncation.totalLines : undefined;\n\treturn typeof totalLines === \"number\" && Number.isFinite(totalLines) ? totalLines : undefined;\n}\n\nfunction readFileSizeFromDetails(toolResult: ToolResultMessage): number | undefined {\n\tconst details = toolResult.details;\n\tif (!details || typeof details !== \"object\" || !(\"fileSize\" in details)) return undefined;\n\tconst { fileSize } = details;\n\treturn typeof fileSize === \"number\" && Number.isSafeInteger(fileSize) && fileSize >= 0 ? fileSize : undefined;\n}\n\nfunction buildReadResultFromToolResult(path: string, toolResult: ToolResultMessage, rangeApplied = false) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildReadErrorResult(path, text || \"Read failed\");\n\t}\n\t// Counting the payload is only the file's length when the payload is the\n\t// whole file: under a windowed read, answering a 20-line page of a 100-line\n\t// file with `total_lines: 20` tells a paginating server it reached the end.\n\tconst totalLines = readTotalLinesFromDetails(toolResult) ?? (rangeApplied ? 0 : text ? text.split(\"\\n\").length : 0);\n\treturn create(ReadResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(ReadSuccessSchema, {\n\t\t\t\tpath,\n\t\t\t\ttotalLines,\n\t\t\t\tfileSize: BigInt(readFileSizeFromDetails(toolResult) ?? Buffer.byteLength(text, \"utf-8\")),\n\t\t\t\ttruncated: toolResultWasTruncated(toolResult),\n\t\t\t\toutput: { case: \"content\", value: text },\n\t\t\t\trangeApplied,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildReadErrorResult(path: string, error: string) {\n\treturn create(ReadResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(ReadErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildReadRejectedResult(path: string, reason: string) {\n\treturn create(ReadResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(ReadRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildWriteResultFromToolResult(\n\targs: { path: string; fileText?: string; fileBytes?: Uint8Array; returnFileContentAfterWrite?: boolean },\n\ttoolResult: ToolResultMessage,\n) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildWriteErrorResult(args.path, text || \"Write failed\");\n\t}\n\tconst fileText = args.fileText ?? \"\";\n\tconst fileSize = args.fileBytes?.length ?? Buffer.byteLength(fileText, \"utf-8\");\n\tconst linesCreated = fileText ? fileText.split(\"\\n\").length : 0;\n\treturn create(WriteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(WriteSuccessSchema, {\n\t\t\t\tpath: args.path,\n\t\t\t\tlinesCreated,\n\t\t\t\tfileSize,\n\t\t\t\tfileContentAfterWrite: args.returnFileContentAfterWrite ? fileText : undefined,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildWriteErrorResult(path: string, error: string) {\n\treturn create(WriteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(WriteErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildWriteRejectedResult(path: string, reason: string) {\n\treturn create(WriteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(WriteRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildDeleteResultFromToolResult(path: string, toolResult: ToolResultMessage) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildDeleteErrorResult(path, text || \"Delete failed\");\n\t}\n\treturn create(DeleteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(DeleteSuccessSchema, {\n\t\t\t\tpath,\n\t\t\t\tdeletedFile: path,\n\t\t\t\tfileSize: BigInt(0),\n\t\t\t\tprevContent: \"\",\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildDeleteErrorResult(path: string, error: string) {\n\treturn create(DeleteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(DeleteErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildDeleteRejectedResult(path: string, reason: string) {\n\treturn create(DeleteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(DeleteRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildShellResultFromToolResult(\n\targs: { command: string; workingDirectory: string },\n\ttoolResult: ToolResultMessage,\n) {\n\tconst output = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildShellFailureResult(args.command, args.workingDirectory, output || \"Shell failed\");\n\t}\n\treturn create(ShellResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(ShellSuccessSchema, {\n\t\t\t\tcommand: args.command,\n\t\t\t\tworkingDirectory: args.workingDirectory,\n\t\t\t\texitCode: 0,\n\t\t\t\tsignal: \"\",\n\t\t\t\tstdout: output,\n\t\t\t\tstderr: \"\",\n\t\t\t\texecutionTime: 0,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildShellFailureResult(command: string, workingDirectory: string, error: string) {\n\treturn create(ShellResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"failure\",\n\t\t\tvalue: create(ShellFailureSchema, {\n\t\t\t\tcommand,\n\t\t\t\tworkingDirectory,\n\t\t\t\texitCode: 1,\n\t\t\t\tsignal: \"\",\n\t\t\t\tstdout: \"\",\n\t\t\t\tstderr: error,\n\t\t\t\texecutionTime: 0,\n\t\t\t\taborted: false,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildShellRejectedResult(command: string, workingDirectory: string, reason: string) {\n\treturn create(ShellResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(ShellRejectedSchema, {\n\t\t\t\tcommand,\n\t\t\t\tworkingDirectory,\n\t\t\t\treason,\n\t\t\t\tisReadonly: false,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildLsResultFromToolResult(path: string, toolResult: ToolResultMessage) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildLsErrorResult(path, text || \"Ls failed\");\n\t}\n\tconst rootPath = path || \".\";\n\tconst entries = text\n\t\t.split(\"\\n\")\n\t\t.map((line) => line.trim())\n\t\t.filter((line) => line.length > 0 && !line.startsWith(\"[\"));\n\tconst childrenDirs: LsDirectoryTreeNode[] = [];\n\tconst childrenFiles: LsDirectoryTreeNode_File[] = [];\n\n\tfor (const entry of entries) {\n\t\tconst name = entry.split(\" (\")[0];\n\t\tif (name.endsWith(\"/\")) {\n\t\t\tconst dirName = name.slice(0, -1);\n\t\t\tchildrenDirs.push(\n\t\t\t\tcreate(LsDirectoryTreeNodeSchema, {\n\t\t\t\t\tabsPath: `${rootPath.replace(/\\/$/, \"\")}/${dirName}`,\n\t\t\t\t\tchildrenDirs: [],\n\t\t\t\t\tchildrenFiles: [],\n\t\t\t\t\tchildrenWereProcessed: false,\n\t\t\t\t\tfullSubtreeExtensionCounts: {},\n\t\t\t\t\tnumFiles: 0,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenFiles.push(create(LsDirectoryTreeNode_FileSchema, { name }));\n\t\t}\n\t}\n\n\tconst root = create(LsDirectoryTreeNodeSchema, {\n\t\tabsPath: rootPath,\n\t\tchildrenDirs,\n\t\tchildrenFiles,\n\t\tchildrenWereProcessed: true,\n\t\tfullSubtreeExtensionCounts: {},\n\t\tnumFiles: childrenFiles.length,\n\t});\n\n\treturn create(LsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(LsSuccessSchema, { directoryTreeRoot: root }),\n\t\t},\n\t});\n}\n\nfunction buildLsErrorResult(path: string, error: string) {\n\treturn create(LsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(LsErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildLsRejectedResult(path: string, reason: string) {\n\treturn create(LsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(LsRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildGrepResultFromToolResult(\n\targs: { pattern: string; path?: string; outputMode?: string; offset?: number },\n\ttoolResult: ToolResultMessage,\n) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildGrepErrorResult(text || \"Grep failed\");\n\t}\n\n\tconst outputMode = args.outputMode || \"content\";\n\tconst clientTruncated = toolResultDetailBoolean(toolResult, \"truncated\");\n\tconst lines = text\n\t\t.split(\"\\n\")\n\t\t.map((line) => line.trimEnd())\n\t\t.filter((line) => line.length > 0 && !line.startsWith(\"[\") && !line.toLowerCase().startsWith(\"no matches\"));\n\n\tconst workspaceKey = args.path || \".\";\n\tlet unionResult: GrepUnionResult;\n\n\tif (outputMode === \"files_with_matches\") {\n\t\tconst files = lines;\n\t\tunionResult = create(GrepUnionResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"files\",\n\t\t\t\tvalue: create(GrepFilesResultSchema, {\n\t\t\t\t\tfiles,\n\t\t\t\t\ttotalFiles: files.length,\n\t\t\t\t\tclientTruncated,\n\t\t\t\t\tripgrepTruncated: false,\n\t\t\t\t\toffsetApplied: args.offset,\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t} else if (outputMode === \"count\") {\n\t\tconst counts = lines\n\t\t\t.map((line) => {\n\t\t\t\tconst separatorIndex = line.lastIndexOf(\":\");\n\t\t\t\tif (separatorIndex === -1) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst file = line.slice(0, separatorIndex);\n\t\t\t\tconst count = Number.parseInt(line.slice(separatorIndex + 1), 10);\n\t\t\t\tif (!file || Number.isNaN(count)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn create(GrepFileCountSchema, { file, count });\n\t\t\t})\n\t\t\t.filter((entry): entry is GrepFileCount => entry !== null);\n\t\tconst totalMatches = counts.reduce((sum, entry) => sum + entry.count, 0);\n\t\tunionResult = create(GrepUnionResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"count\",\n\t\t\t\tvalue: create(GrepCountResultSchema, {\n\t\t\t\t\tcounts,\n\t\t\t\t\ttotalFiles: counts.length,\n\t\t\t\t\ttotalMatches,\n\t\t\t\t\tclientTruncated,\n\t\t\t\t\tripgrepTruncated: false,\n\t\t\t\t\toffsetApplied: args.offset,\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t} else {\n\t\tconst matchMap = new Map<string, Array<{ line: number; content: string; isContextLine: boolean }>>();\n\t\tlet totalMatchedLines = 0;\n\n\t\tfor (const line of lines) {\n\t\t\tconst matchLine = line.match(/^(.+?):(\\d+):\\s?(.*)$/);\n\t\t\tconst contextLine = line.match(/^(.+?)-(\\d+)-\\s?(.*)$/);\n\t\t\tconst match = matchLine ?? contextLine;\n\t\t\tif (!match) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst [, file, lineNumber, content] = match;\n\t\t\tconst isContextLine = Boolean(contextLine);\n\t\t\tconst list = matchMap.get(file) ?? [];\n\t\t\tlist.push({ line: Number(lineNumber), content, isContextLine });\n\t\t\tmatchMap.set(file, list);\n\t\t\tif (!isContextLine) {\n\t\t\t\ttotalMatchedLines += 1;\n\t\t\t}\n\t\t}\n\n\t\tconst matches = Array.from(matchMap.entries()).map(([file, fileMatches]) =>\n\t\t\tcreate(GrepFileMatchSchema, {\n\t\t\t\tfile,\n\t\t\t\tmatches: fileMatches.map((entry) =>\n\t\t\t\t\tcreate(GrepContentMatchSchema, {\n\t\t\t\t\t\tlineNumber: entry.line,\n\t\t\t\t\t\tcontent: entry.content,\n\t\t\t\t\t\tcontentTruncated: false,\n\t\t\t\t\t\tisContextLine: entry.isContextLine,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t}),\n\t\t);\n\t\tconst totalLines = matches.reduce((sum, entry) => sum + entry.matches.length, 0);\n\t\tunionResult = create(GrepUnionResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"content\",\n\t\t\t\tvalue: create(GrepContentResultSchema, {\n\t\t\t\t\tmatches,\n\t\t\t\t\ttotalLines,\n\t\t\t\t\ttotalMatchedLines,\n\t\t\t\t\tclientTruncated,\n\t\t\t\t\tripgrepTruncated: false,\n\t\t\t\t\toffsetApplied: args.offset,\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t}\n\n\treturn create(GrepResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(GrepSuccessSchema, {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || \"\",\n\t\t\t\toutputMode,\n\t\t\t\tworkspaceResults: { [workspaceKey]: unionResult },\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildGrepErrorResult(error: string) {\n\treturn create(GrepResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(GrepErrorSchema, { error }),\n\t\t},\n\t});\n}\n\n/**\n * Reject a Cursor exec-channel `grepArgs` frame whose `pattern` is empty or\n * whitespace-only. Returns an actionable error message (with a `glob`-aware\n * hint when the model likely meant to list files) or `null` when the pattern\n * is valid and grep should run. Exported for tests.\n */\nexport function emptyGrepPatternRejection(pattern: string | undefined, glob: string | undefined): string | null {\n\tif (pattern && pattern.trim().length > 0) return null;\n\tif (glob && glob.length > 0) {\n\t\treturn (\n\t\t\t`grep pattern is required (received an empty pattern). To list files matching \"${glob}\", ` +\n\t\t\t`pass a non-empty regex (e.g. \".\") and set path to that glob, or use the ls/read tool instead.`\n\t\t);\n\t}\n\treturn \"grep pattern is required (received an empty pattern).\";\n}\n\nfunction buildDiagnosticsResultFromToolResult(path: string, toolResult: ToolResultMessage) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildDiagnosticsErrorResult(path, text || \"Diagnostics failed\");\n\t}\n\treturn create(DiagnosticsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(DiagnosticsSuccessSchema, {\n\t\t\t\tpath,\n\t\t\t\tdiagnostics: [],\n\t\t\t\ttotalDiagnostics: 0,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildDiagnosticsErrorResult(_path: string, error: string) {\n\treturn create(DiagnosticsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(DiagnosticsErrorSchema, { error }),\n\t\t},\n\t});\n}\n\nfunction buildDiagnosticsRejectedResult(path: string, reason: string) {\n\treturn create(DiagnosticsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(DiagnosticsRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction parseToolArgsJson(text: string): unknown {\n\tconst trimmed = text.trim();\n\tif (!trimmed) {\n\t\treturn text;\n\t}\n\ttry {\n\t\treturn parseJsonWithRepair<unknown>(trimmed);\n\t} catch {\n\t\treturn text;\n\t}\n}\n\nfunction decodeMcpArgValue(value: Uint8Array): unknown {\n\ttry {\n\t\tconst parsedValue = fromBinary(ValueSchema, value);\n\t\tconst jsonValue = toJson(ValueSchema, parsedValue) as PbJsonValue;\n\t\tif (typeof jsonValue === \"string\") {\n\t\t\treturn parseToolArgsJson(jsonValue);\n\t\t}\n\t\treturn jsonValue;\n\t} catch {}\n\tconst text = new TextDecoder().decode(value);\n\treturn parseToolArgsJson(text);\n}\n\nfunction decodeMcpArgsMap(args?: Record<string, Uint8Array>): Record<string, unknown> | undefined {\n\tif (!args) {\n\t\treturn undefined;\n\t}\n\tconst decoded: Record<string, unknown> = {};\n\tfor (const [key, value] of Object.entries(args)) {\n\t\tdecoded[key] = decodeMcpArgValue(value);\n\t}\n\treturn decoded;\n}\n\nfunction decodeMcpCall(args: {\n\tname: string;\n\targs: Record<string, Uint8Array>;\n\ttoolCallId: string;\n\tproviderIdentifier: string;\n\ttoolName: string;\n\tsmartModeApprovalOnly?: boolean;\n}): CursorMcpCall {\n\tconst decodedArgs: Record<string, unknown> = {};\n\tfor (const [key, value] of Object.entries(args.args ?? {})) {\n\t\tdecodedArgs[key] = decodeMcpArgValue(value);\n\t}\n\treturn {\n\t\tname: args.name,\n\t\tproviderIdentifier: args.providerIdentifier,\n\t\ttoolName: args.toolName || args.name,\n\t\ttoolCallId: args.toolCallId,\n\t\targs: decodedArgs,\n\t\trawArgs: args.args ?? {},\n\t\tapprovalOnly: args.smartModeApprovalOnly === true,\n\t};\n}\n\n/**\n * Map Cursor's `TodoStatus` enum onto display statuses. Cancelled (4) maps to\n * `abandoned` rather than collapsing to `pending`, which would resurrect a\n * task the model explicitly cancelled.\n */\nfunction mapTodoStatusValue(status?: number): \"pending\" | \"in_progress\" | \"completed\" | \"abandoned\" {\n\tswitch (status) {\n\t\tcase 2:\n\t\t\treturn \"in_progress\";\n\t\tcase 3:\n\t\t\treturn \"completed\";\n\t\tcase 4:\n\t\t\treturn \"abandoned\";\n\t\tdefault:\n\t\t\treturn \"pending\";\n\t}\n}\n\ninterface CursorTodoItem {\n\tid?: string;\n\tcontent?: string;\n\tstatus?: number;\n\tdependencies?: string[];\n}\n\ninterface CursorTodoResult {\n\tresult?: {\n\t\tcase?: \"success\" | \"error\";\n\t\tvalue?: { todos?: CursorTodoItem[]; totalCount?: number; wasMerge?: boolean; error?: string };\n\t};\n}\n\ninterface CursorUpdateTodosCall {\n\targs?: { todos?: CursorTodoItem[]; merge?: boolean };\n\tresult?: CursorTodoResult;\n}\n\ninterface CursorReadTodosCall {\n\targs?: { statusFilter?: number[]; idFilter?: string[] };\n\tresult?: CursorTodoResult;\n}\n\n/**\n * `ToolCall` is a protobuf oneof, so a decoded message exposes the selected\n * variant as `tool: { case, value }` — NOT as a named property. Hand-built\n * fixtures use the flattened form, so both are accepted here.\n */\ninterface CursorTodoToolCall {\n\ttool?: { case?: string; value?: unknown };\n\tupdateTodosToolCall?: CursorUpdateTodosCall;\n\treadTodosToolCall?: CursorReadTodosCall;\n}\n\nfunction selectTodoCalls(toolCall: CursorTodoToolCall): {\n\tupdate?: CursorUpdateTodosCall;\n\tread?: CursorReadTodosCall;\n} {\n\tconst oneof = toolCall.tool;\n\tif (oneof?.case === \"updateTodosToolCall\") return { update: oneof.value as CursorUpdateTodosCall };\n\tif (oneof?.case === \"readTodosToolCall\") return { read: oneof.value as CursorReadTodosCall };\n\treturn { update: toolCall.updateTodosToolCall, read: toolCall.readTodosToolCall };\n}\n\nfunction mapTodoSnapshot(todos: CursorTodoItem[]) {\n\treturn todos.map((todo) => ({\n\t\tcontent: typeof todo.content === \"string\" ? todo.content : \"\",\n\t\tstatus: mapTodoStatusValue(typeof todo.status === \"number\" ? todo.status : undefined),\n\t}));\n}\n\ninterface CursorMcpToolCall {\n\targs?: {\n\t\tname?: string;\n\t\ttoolName?: string;\n\t\ttoolCallId?: string;\n\t\targs?: Record<string, Uint8Array>;\n\t};\n}\n\ninterface CursorMcpToolCallCarrier {\n\ttool?: { case?: string; value?: unknown };\n\tmcpToolCall?: CursorMcpToolCall;\n}\n\n/**\n * `ToolCall.tool` is a protobuf oneof: a wire-decoded message exposes the\n * variant as `{ case, value }` and NEVER as a flattened property. The flat\n * fallback is kept for hand-shaped test fixtures.\n */\nfunction selectMcpCall(toolCall: CursorMcpToolCallCarrier | undefined): CursorMcpToolCall | undefined {\n\tconst oneof = toolCall?.tool;\n\tif (oneof?.case === \"mcpToolCall\") return oneof.value as CursorMcpToolCall;\n\treturn toolCall?.mcpToolCall;\n}\n\n/**\n * The streamed `ToolCall` variants whose block the exec channel owns.\n *\n * Each of these is announced on the interaction stream AND dispatched as its\n * own `ExecServerMessage` frame, so the block is synthesized once, by the\n * exec handler, which is the side that has the result.\n */\nconst EXEC_OWNED_TOOL_CALL_CASES: ReadonlySet<string> = new Set([\n\t\"piReadToolCall\",\n\t\"piBashToolCall\",\n\t\"piEditToolCall\",\n\t\"piWriteToolCall\",\n\t\"piGrepToolCall\",\n\t\"piFindToolCall\",\n\t\"piLsToolCall\",\n\t\"listMcpResourcesToolCall\",\n\t\"readMcpResourceToolCall\",\n]);\n\nfunction isExecOwnedToolCall(toolCall: { tool?: { case?: string } } | undefined): boolean {\n\tconst variant = toolCall?.tool?.case;\n\treturn variant !== undefined && EXEC_OWNED_TOOL_CALL_CASES.has(variant);\n}\n\n/**\n * Close every tool-call block still open when the stream ends.\n *\n * Not just the last one started: with interleaved calls several can be open\n * at once, and an unclosed block leaves its live card animating and its call\n * unpaired. Only blocks fed by a streamed argument buffer get reparsed.\n * Server-owned blocks (`connect-scm`, `todo`) are also paired here: they are\n * stamped resolved the moment they open, so only their completion frame pairs\n * a result — a transport that closes before that frame would leave the call\n * unpaired. MCP blocks are excluded even when resolved: the exec dispatch\n * that marked them owns their result.\n */\nexport function flushOpenToolCalls(\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n): void {\n\tconst openBlocks = new Set<ToolCallState>(state.openToolCalls.values());\n\tif (state.currentToolCall) openBlocks.add(state.currentToolCall);\n\tfor (const block of openBlocks) {\n\t\tconst idx = output.content.indexOf(block);\n\t\tconst partialJson = block[kStreamingPartialJson];\n\t\tif (partialJson !== undefined) {\n\t\t\tblock.arguments = parseStreamingJson(partialJson);\n\t\t\tclearStreamingPartialJson(block);\n\t\t}\n\t\tconst kind = block[kStreamingBlockKind];\n\t\tif (kind === \"connect-scm\" || kind === \"todo\") {\n\t\t\tvoid state.onToolResult?.({\n\t\t\t\trole: \"toolResult\",\n\t\t\t\ttoolCallId: block.id,\n\t\t\t\ttoolName: block.name,\n\t\t\t\tcontent: [{ type: \"text\", text: \"The connection to Cursor closed before this call completed.\" }],\n\t\t\t\tisError: true,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\t\tstream.push({ type: \"toolcall_end\", contentIndex: idx, toolCall: block, partial: output });\n\t}\n\tstate.openToolCalls.clear();\n\tstate.setToolCall(null);\n}\n\n/**\n * Retain a freshly opened streamed tool-call block, keyed by the interaction\n * envelope's `call_id`. `currentToolCall` is still set as the fallback for\n * frames that carry no `call_id`.\n */\nfunction retainStreamedCall(state: BlockState, block: ToolCallState, envelopeId: string | undefined): void {\n\tif (envelopeId) state.openToolCalls.set(envelopeId, block);\n\tstate.setToolCall(block);\n}\n\n/**\n * The open block a streamed update addresses, or `null` to ignore the update.\n *\n * Cursor interleaves calls: `start A, start B, complete A` is legal, so the\n * update must reach block A even though B opened last. An id naming no open\n * block is ignored rather than misapplied. A missing id falls back to the\n * current block.\n */\nfunction resolveStreamedCall(state: BlockState, envelopeId: string | undefined): ToolCallState | null {\n\tif (!envelopeId) return state.currentToolCall;\n\tconst keyed = state.openToolCalls.get(envelopeId);\n\tif (keyed) return keyed;\n\tconst current = state.currentToolCall;\n\treturn current && current[kStreamingEnvelopeId] === undefined ? current : null;\n}\n\n/** Release a settled block from both the keyed map and the current slot. */\nfunction releaseStreamedCall(state: BlockState, block: ToolCallState): void {\n\tconst envelopeId = block[kStreamingEnvelopeId];\n\tif (envelopeId) state.openToolCalls.delete(envelopeId);\n\tif (state.currentToolCall === block) state.setToolCall(null);\n}\n\ninterface CursorConnectScmRepository {\n\towner?: string;\n\trepo?: string;\n}\n\ninterface CursorConnectScmCall {\n\targs?: {\n\t\ttoolCallId?: string;\n\t\ttarget?: { case?: string; value?: { repository?: CursorConnectScmRepository } };\n\t\tgithub?: { repository?: CursorConnectScmRepository };\n\t};\n\tresult?: { result?: { case?: string; value?: { error?: string; reason?: string } } };\n}\n\ninterface CursorConnectScmCarrier {\n\ttool?: { case?: string; value?: unknown };\n\tconnectScmToolCall?: CursorConnectScmCall;\n}\n\nfunction selectConnectScmCall(toolCall: CursorConnectScmCarrier | undefined): CursorConnectScmCall | undefined {\n\tconst oneof = toolCall?.tool;\n\tif (oneof?.case === \"connectScmToolCall\") return oneof.value as CursorConnectScmCall;\n\treturn toolCall?.connectScmToolCall;\n}\n\nfunction selectConnectScmRepository(call: CursorConnectScmCall | undefined): CursorConnectScmRepository | undefined {\n\tconst target = call?.args?.target;\n\tif (target?.case === \"github\") return target.value?.repository;\n\treturn call?.args?.github?.repository;\n}\n\n/** Render a settled `ConnectScmResult` as the text of its paired tool result. */\nfunction describeConnectScmResult(call: CursorConnectScmCall | undefined): { text: string; isError: boolean } {\n\tconst result = call?.result?.result;\n\tswitch (result?.case) {\n\t\tcase \"success\":\n\t\t\treturn { text: \"SCM connected\", isError: false };\n\t\tcase \"error\":\n\t\t\treturn { text: result.value?.error || \"SCM connection failed\", isError: true };\n\t\tcase \"rejected\":\n\t\t\treturn { text: result.value?.reason || \"SCM connection rejected\", isError: true };\n\t\tdefault:\n\t\t\treturn { text: \"SCM connection reported no result\", isError: true };\n\t}\n}\n\n/**\n * Extract the authoritative full todo list from a completed native todo call.\n * Only `result.success.todos` is authoritative; filtered/partial/ambiguous\n * responses return `null`, which the caller MUST treat as \"nothing to mirror\".\n */\nfunction extractTodoSnapshot(\n\ttoolCall: CursorTodoToolCall,\n): { todos: ReturnType<typeof mapTodoSnapshot>; merged: boolean } | null {\n\tconst { update, read } = selectTodoCalls(toolCall);\n\tif (read && ((read.args?.statusFilter?.length ?? 0) > 0 || (read.args?.idFilter?.length ?? 0) > 0)) {\n\t\treturn null;\n\t}\n\tconst call = update ?? read;\n\tif (!call) return null;\n\tconst result = call.result?.result;\n\tif (result?.case !== \"success\") return null;\n\tconst todos = result.value?.todos;\n\tif (!todos) return null;\n\tconst totalCount = result.value?.totalCount;\n\tif (typeof totalCount === \"number\" && totalCount !== todos.length) {\n\t\treturn null;\n\t}\n\tif (read && todos.length === 0) {\n\t\treturn null;\n\t}\n\tconst mapped = mapTodoSnapshot(todos);\n\tif (mapped.some((todo) => todo.content.length === 0)) return null;\n\treturn {\n\t\ttodos: mapped,\n\t\tmerged: result.value?.wasMerge === true,\n\t};\n}\n\n/** Error text when the server itself rejected the call. */\nfunction extractTodoError(toolCall: CursorTodoToolCall): string | null {\n\tconst { update, read } = selectTodoCalls(toolCall);\n\tconst result = (update ?? read)?.result?.result;\n\tif (result?.case !== \"error\") return null;\n\tconst error = result.value?.error;\n\treturn typeof error === \"string\" && error.length > 0 ? error : \"Todo operation failed\";\n}\n\n/** Args echoed onto the synthesized display block, for rendering only. */\nfunction buildTodoDisplayArgs(toolCall: CursorTodoToolCall): {\n\ttodos: ReturnType<typeof mapTodoSnapshot>;\n\tmerge?: boolean;\n} {\n\tconst args = selectTodoCalls(toolCall).update?.args;\n\treturn {\n\t\ttodos: args?.todos ? mapTodoSnapshot(args.todos) : [],\n\t\tmerge: args?.merge === true ? true : undefined,\n\t};\n}\n\n/**\n * Paired result for a server-resolved native todo call. Nothing else would\n * produce a `toolResult` for the block — and transcript rebuilds strip any\n * `toolCall` left unpaired.\n */\nfunction buildTodoToolResult(\n\ttoolCallId: string,\n\tsnapshot: { todos: ReturnType<typeof mapTodoSnapshot> } | null,\n\terror: string | null,\n): ToolResultMessage {\n\tconst text = error ?? (snapshot ? formatTodoSnapshotSummary(snapshot.todos) : \"Todo snapshot not mirrored\");\n\treturn {\n\t\trole: \"toolResult\",\n\t\ttoolCallId,\n\t\ttoolName: \"todo\",\n\t\tcontent: [{ type: \"text\", text }],\n\t\tisError: error !== null,\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction formatTodoSnapshotSummary(todos: { status: string }[]): string {\n\tif (todos.length === 0) return \"No todos\";\n\tconst done = todos.filter((todo) => todo.status === \"completed\").length;\n\treturn `${done}/${todos.length} tasks completed`;\n}\n\nfunction buildMcpResultFromToolResult(_mcpCall: CursorMcpCall, toolResult: ToolResultMessage) {\n\tif (toolResult.isError) {\n\t\treturn buildMcpErrorResult(toolResultToText(toolResult) || \"MCP tool failed\");\n\t}\n\tconst content = toolResult.content.map((item) => {\n\t\tif (item.type === \"image\") {\n\t\t\treturn create(McpToolResultContentItemSchema, {\n\t\t\t\tcontent: {\n\t\t\t\t\tcase: \"image\",\n\t\t\t\t\tvalue: create(McpImageContentSchema, {\n\t\t\t\t\t\tdata: Uint8Array.from(Buffer.from(item.data, \"base64\")),\n\t\t\t\t\t\tmimeType: item.mimeType,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t\treturn create(McpToolResultContentItemSchema, {\n\t\t\tcontent: {\n\t\t\t\tcase: \"text\",\n\t\t\t\tvalue: create(McpTextContentSchema, { text: item.text }),\n\t\t\t},\n\t\t});\n\t});\n\n\treturn create(McpResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(McpSuccessSchema, {\n\t\t\t\tcontent,\n\t\t\t\tisError: false,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildMcpToolNotFoundResult(mcpCall: CursorMcpCall) {\n\treturn create(McpResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"toolNotFound\",\n\t\t\tvalue: create(McpToolNotFoundSchema, { name: mcpCall.toolName, availableTools: [] }),\n\t\t},\n\t});\n}\n\nfunction buildMcpErrorResult(error: string) {\n\treturn create(McpResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(McpErrorSchema, { error }),\n\t\t},\n\t});\n}\n\n/**\n * Merge the decoded completion-frame `McpArgs` map into the args assembled\n * from streamed `args_text_delta` snapshots.\n *\n * The completion frame is authoritative for the scalars it carries — but it\n * can omit oversized parameters entirely and can downgrade a structured value\n * to its raw string fallback. Rules per key:\n * - completion key absent → keep the streamed value.\n * - completion is a string while the streamed value is structured → keep the\n * streamed value (the completion frame downgraded it).\n * - otherwise → completion wins.\n */\nexport function mergeCursorMcpToolCallArgs(\n\tstreamed: Record<string, unknown> | undefined,\n\tcompletion: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n\tconst merged: Record<string, unknown> = { ...(streamed ?? {}) };\n\tif (!completion) return merged;\n\tfor (const [key, completionValue] of Object.entries(completion)) {\n\t\tconst streamedValue = merged[key];\n\t\tif (typeof completionValue === \"string\" && streamedValue !== null && typeof streamedValue === \"object\") {\n\t\t\tcontinue;\n\t\t}\n\t\tmerged[key] = completionValue;\n\t}\n\treturn merged;\n}\n\nfunction endCurrentTextBlock(output: AssistantMessage, stream: AssistantMessageEventStream, state: BlockState): void {\n\tconst block = state.currentTextBlock;\n\tif (!block) return;\n\tconst idx = output.content.indexOf(block);\n\tstream.push({\n\t\ttype: \"text_end\",\n\t\tcontentIndex: idx,\n\t\tcontent: block.text,\n\t\tpartial: output,\n\t});\n\tstate.setTextBlock(null);\n}\n\nfunction endCurrentThinkingBlock(\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n): void {\n\tconst block = state.currentThinkingBlock;\n\tif (!block) return;\n\tconst idx = output.content.indexOf(block);\n\tstream.push({\n\t\ttype: \"thinking_end\",\n\t\tcontentIndex: idx,\n\t\tcontent: block.thinking,\n\t\tpartial: output,\n\t});\n\tstate.setThinkingBlock(null);\n}\n\n/**\n * Synthesize a completed `toolCall` content block for a Cursor exec-channel\n * native tool or for an MCP exec frame whose corresponding interaction block\n * is absent.\n *\n * Args arrive complete on the exec message, so the block opens and closes in\n * one step. Without this the persisted assistant message carries only\n * text/thinking blocks, and on replay the following `toolResult` messages\n * have no matching `toolCall.id`.\n *\n * The block is stamped with {@link kCursorExecResolved} so the agent loop's\n * execution pass skips it — Cursor's server-driven exec channel already ran\n * the tool via the bridge and buffered the result. Exported for tests.\n */\nexport function synthesizeCursorExecToolCall(\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n\ttoolCallId: string,\n\ttoolName: string,\n\targs: Record<string, unknown>,\n): void {\n\tendCurrentTextBlock(output, stream, state);\n\tendCurrentThinkingBlock(output, stream, state);\n\tconst block: ToolCallState = {\n\t\ttype: \"toolCall\",\n\t\tid: toolCallId,\n\t\tname: toolName,\n\t\targuments: omitUndefinedArgs(args),\n\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t[kStreamingBlockKind]: \"cursor-exec\",\n\t\t[kCursorExecResolved]: true,\n\t};\n\toutput.content.push(block);\n\tconst idx = output.content.length - 1;\n\tstream.push({ type: \"toolcall_start\", contentIndex: idx, partial: output });\n\tstream.push({ type: \"toolcall_end\", contentIndex: idx, toolCall: block, partial: output });\n}\n\n/**\n * Pair a `toolResult` for a synthesized block the client answered itself,\n * without ever consulting a handler. Frames answered from a fixed verdict —\n * no handler, no local execution — still need the pair: the block was stamped\n * {@link kCursorExecResolved}, so the agent loop emits no placeholder for it\n * and transcript rebuilds strip an unpaired call.\n */\nasync function pairSynthesizedExecResult(\n\tstate: BlockState,\n\tonToolResult: CursorToolResultHandler | undefined,\n\ttoolCallId: string,\n\ttoolName: string,\n\ttext: string,\n\tisError = true,\n): Promise<void> {\n\tconst synthesized: ToolResultMessage = {\n\t\trole: \"toolResult\",\n\t\ttoolCallId,\n\t\ttoolName,\n\t\tcontent: [{ type: \"text\", text }],\n\t\tisError,\n\t\ttimestamp: Date.now(),\n\t};\n\tconst sink = onToolResult ?? state.onToolResult;\n\tif (!sink) return;\n\tawait sink(synthesized);\n}\n\n/**\n * Throttle threshold for mid-stream argument JSON parses: reparse only when\n * the buffer grew by this much since the last successful parse, keeping total\n * parse work bounded while the authoritative full parse runs on completion.\n */\nconst STREAMING_ARGS_REPARSE_DELTA = 1024;\n\n/** Exported for tests: drives one Cursor interaction update through the streaming state machine. */\nexport function processInteractionUpdate(\n\tupdate: any,\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n\tusageState: UsageState,\n): void {\n\tconst updateCase = update.message?.case;\n\n\tlog(\"interactionUpdate\", updateCase);\n\n\tif (updateCase === \"textDelta\") {\n\t\tconst delta = update.message.value.text || \"\";\n\t\tif (!state.currentTextBlock) {\n\t\t\tconst block: TextContent & { [kStreamingBlockIndex]: number } = {\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: \"\",\n\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t};\n\t\t\toutput.content.push(block);\n\t\t\tstate.setTextBlock(block);\n\t\t\tstream.push({ type: \"text_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t}\n\t\tstate.currentTextBlock!.text += delta;\n\t\tconst idx = output.content.indexOf(state.currentTextBlock!);\n\t\tstream.push({ type: \"text_delta\", contentIndex: idx, delta, partial: output });\n\t} else if (updateCase === \"thinkingDelta\") {\n\t\tconst delta = update.message.value.text || \"\";\n\t\tif (!state.currentThinkingBlock) {\n\t\t\tconst block: ThinkingContent & { [kStreamingBlockIndex]: number } = {\n\t\t\t\ttype: \"thinking\",\n\t\t\t\tthinking: \"\",\n\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t};\n\t\t\toutput.content.push(block);\n\t\t\tstate.setThinkingBlock(block);\n\t\t\tstream.push({ type: \"thinking_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t}\n\t\tstate.currentThinkingBlock!.thinking += delta;\n\t\tconst idx = output.content.indexOf(state.currentThinkingBlock!);\n\t\tstream.push({ type: \"thinking_delta\", contentIndex: idx, delta, partial: output });\n\t} else if (updateCase === \"thinkingCompleted\") {\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t} else if (updateCase === \"toolCallStarted\" && selectConnectScmCall(update.message.value.toolCall)) {\n\t\t// `connect_scm` is resolved entirely server-side and has NO exec frame:\n\t\t// the streamed pair is the only signal this client sees. The\n\t\t// authoritative outcome rides on the COMPLETION's `result` oneof, so the\n\t\t// block is opened here and settled there.\n\t\tendCurrentTextBlock(output, stream, state);\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t\tconst scmCall = selectConnectScmCall(update.message.value.toolCall);\n\t\tconst repository = selectConnectScmRepository(scmCall);\n\t\tconst block: ToolCallState = {\n\t\t\ttype: \"toolCall\",\n\t\t\tid: scmCall?.args?.toolCallId || update.message.value.callId || randomUUID(),\n\t\t\tname: \"connect_scm\",\n\t\t\targuments: repository ? { owner: repository.owner, repo: repository.repo } : {},\n\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t[kStreamingBlockKind]: \"connect-scm\",\n\t\t\t[kStreamingEnvelopeId]: update.message.value.callId || undefined,\n\t\t\t[kCursorExecResolved]: true,\n\t\t};\n\t\toutput.content.push(block);\n\t\tretainStreamedCall(state, block, update.message.value.callId);\n\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t} else if (updateCase === \"toolCallStarted\" && isExecOwnedToolCall(update.message.value.toolCall)) {\n\t\t// The exec channel already synthesized this block (and marked it\n\t\t// resolved) when it ran the tool locally, so the streamed announcement\n\t\t// must not create a second one.\n\t\tendCurrentTextBlock(output, stream, state);\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t\tlog(\"exec\", \"streamedToolCallOwnedByExec\", { case: update.message.value.toolCall?.tool?.case });\n\t} else if (updateCase === \"toolCallStarted\") {\n\t\tendCurrentTextBlock(output, stream, state);\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t\tconst toolCall = update.message.value.toolCall;\n\t\tif (toolCall) {\n\t\t\tconst mcpCall = selectMcpCall(toolCall);\n\t\t\tif (mcpCall) {\n\t\t\t\tconst args = mcpCall.args || {};\n\t\t\t\tconst id = args.toolCallId || randomUUID();\n\t\t\t\tconst resolvedByExec = state.resolvedMcpToolCallIds.delete(id);\n\t\t\t\tif (resolvedByExec && output.content.some((block) => block.type === \"toolCall\" && block.id === id)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst block: ToolCallState = {\n\t\t\t\t\ttype: \"toolCall\",\n\t\t\t\t\tid,\n\t\t\t\t\t// Same precedence as `decodeMcpCall` (`toolName || name`), which\n\t\t\t\t\t// is what the exec channel pairs its result under.\n\t\t\t\t\tname: args.toolName || args.name || \"\",\n\t\t\t\t\targuments: {},\n\t\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t\t\t[kStreamingPartialJson]: \"\",\n\t\t\t\t\t[kStreamingBlockKind]: \"mcp\",\n\t\t\t\t\t[kStreamingEnvelopeId]: update.message.value.callId || undefined,\n\t\t\t\t};\n\t\t\t\tif (resolvedByExec) {\n\t\t\t\t\tmarkCursorExecResolved(block);\n\t\t\t\t}\n\t\t\t\toutput.content.push(block);\n\t\t\t\tretainStreamedCall(state, block, update.message.value.callId);\n\t\t\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Cursor resolves `update_todos` / `read_todos` server-side and\n\t\t\t// settles them on the tool call's `result`. Both blocks are stamped\n\t\t\t// resolved so the agent loop never runs them locally.\n\t\t\tconst todoCalls = selectTodoCalls(toolCall);\n\t\t\tif (todoCalls.update || todoCalls.read) {\n\t\t\t\tconst callId = update.message.value.callId || randomUUID();\n\t\t\t\tconst block: ToolCallState = {\n\t\t\t\t\ttype: \"toolCall\",\n\t\t\t\t\tid: callId,\n\t\t\t\t\tname: \"todo\",\n\t\t\t\t\targuments: buildTodoDisplayArgs(toolCall),\n\t\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t\t\t[kStreamingBlockKind]: \"todo\",\n\t\t\t\t\t[kStreamingEnvelopeId]: update.message.value.callId || undefined,\n\t\t\t\t\t[kCursorExecResolved]: true,\n\t\t\t\t};\n\t\t\t\toutput.content.push(block);\n\t\t\t\tretainStreamedCall(state, block, update.message.value.callId);\n\t\t\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t\t}\n\t\t}\n\t} else if (updateCase === \"toolCallDelta\" || updateCase === \"partialToolCall\") {\n\t\t// An argument delta belonging to a different call must not be appended\n\t\t// to this block's buffer, which would corrupt the JSON both parse.\n\t\tconst target = resolveStreamedCall(state, update.message.value.callId);\n\t\tif (target?.[kStreamingBlockKind] === \"mcp\") {\n\t\t\t// Cursor's `args_text_delta` is \"aggregated args text so far\": each\n\t\t\t// delta is a cumulative snapshot. Strip the prefix we already have to\n\t\t\t// recover the new suffix; fall back to treating the value as an\n\t\t\t// incremental fragment when it doesn't extend the buffer.\n\t\t\tconst snapshot: string = update.message.value.argsTextDelta || \"\";\n\t\t\tconst current = target[kStreamingPartialJson] ?? \"\";\n\t\t\tconst chunk = snapshot.startsWith(current) ? snapshot.slice(current.length) : snapshot;\n\t\t\tif (chunk.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextBuffer = current + chunk;\n\t\t\ttarget[kStreamingPartialJson] = nextBuffer;\n\t\t\t// Throttle mid-stream parses to keep total parse work bounded; the\n\t\t\t// authoritative full parse runs in `toolCallCompleted`.\n\t\t\tconst lastParseLen = target[kStreamingLastParseLen] ?? 0;\n\t\t\tif (nextBuffer.length - lastParseLen >= STREAMING_ARGS_REPARSE_DELTA) {\n\t\t\t\ttarget.arguments = parseStreamingJson(nextBuffer);\n\t\t\t\ttarget[kStreamingLastParseLen] = nextBuffer.length;\n\t\t\t}\n\t\t\tconst idx = output.content.indexOf(target);\n\t\t\tstream.push({ type: \"toolcall_delta\", contentIndex: idx, delta: chunk, partial: output });\n\t\t}\n\t} else if (updateCase === \"toolCallCompleted\") {\n\t\t// Correlate on the envelope's `call_id`, NOT the block id: MCP, Pi and\n\t\t// SCM blocks are filed under the id inside the call's `args`, and that\n\t\t// need not equal the envelope id.\n\t\tconst settled = resolveStreamedCall(state, update.message.value.callId);\n\t\tif (settled) {\n\t\t\tconst toolCall = update.message.value.toolCall;\n\t\t\tif (settled[kStreamingBlockKind] === \"mcp\") {\n\t\t\t\t// Authoritative full parse of the accumulated argument buffer.\n\t\t\t\tconst partial = settled[kStreamingPartialJson];\n\t\t\t\tif (partial !== undefined) {\n\t\t\t\t\tsettled.arguments = parseStreamingJson(partial);\n\t\t\t\t}\n\t\t\t\tconst decodedArgs = decodeMcpArgsMap(selectMcpCall(toolCall)?.args?.args);\n\t\t\t\tsettled.arguments = mergeCursorMcpToolCallArgs(\n\t\t\t\t\tsettled.arguments as Record<string, unknown> | undefined,\n\t\t\t\t\tdecodedArgs,\n\t\t\t\t);\n\t\t\t} else if (settled[kStreamingBlockKind] === \"connect-scm\") {\n\t\t\t\t// The authoritative outcome arrives only here. Late args are merged\n\t\t\t\t// too — a start frame may announce the call before the target\n\t\t\t\t// repository is known.\n\t\t\t\tconst scmCall = selectConnectScmCall(toolCall);\n\t\t\t\tconst repository = selectConnectScmRepository(scmCall);\n\t\t\t\tif (repository) {\n\t\t\t\t\tsettled.arguments = { owner: repository.owner, repo: repository.repo };\n\t\t\t\t}\n\t\t\t\tconst { text, isError } = describeConnectScmResult(scmCall);\n\t\t\t\tvoid state.onToolResult?.({\n\t\t\t\t\trole: \"toolResult\",\n\t\t\t\t\ttoolCallId: settled.id,\n\t\t\t\t\ttoolName: \"connect_scm\",\n\t\t\t\t\tcontent: [{ type: \"text\", text }],\n\t\t\t\t\tisError,\n\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t});\n\t\t\t} else if (settled[kStreamingBlockKind] === \"todo\") {\n\t\t\t\t// Only the server's success snapshot is authoritative. A completion\n\t\t\t\t// frame whose optional `toolCall` is absent still settles: the block\n\t\t\t\t// is already marked resolved, so nothing downstream pairs it.\n\t\t\t\tconst snapshot = toolCall ? extractTodoSnapshot(toolCall) : null;\n\t\t\t\tconst error = toolCall ? extractTodoError(toolCall) : null;\n\t\t\t\tif (snapshot) {\n\t\t\t\t\tsettled.arguments = { todos: snapshot.todos, merged: snapshot.merged };\n\t\t\t\t}\n\t\t\t\tvoid state.onToolResult?.(buildTodoToolResult(settled.id, snapshot, error));\n\t\t\t}\n\t\t\tconst idx = output.content.indexOf(settled);\n\t\t\tclearStreamingPartialJson(settled);\n\t\t\tstream.push({ type: \"toolcall_end\", contentIndex: idx, toolCall: settled, partial: output });\n\t\t\treleaseStreamedCall(state, settled);\n\t\t}\n\t} else if (updateCase === \"turnEnded\") {\n\t\toutput.stopReason = \"stop\";\n\t} else if (updateCase === \"tokenDelta\") {\n\t\tconst tokenDelta = update.message.value;\n\t\tusageState.sawTokenDelta = true;\n\t\toutput.usage.output += tokenDelta.tokens || 0;\n\t\toutput.usage.totalTokens = output.usage.input + output.usage.output;\n\t}\n}\n\nfunction createBlobId(data: Uint8Array): Uint8Array {\n\treturn new Uint8Array(createHash(\"sha256\").update(data).digest());\n}\n\nfunction storeCursorBlob(blobStore: Map<string, Uint8Array>, data: Uint8Array): Uint8Array {\n\tconst blobId = createBlobId(data);\n\tblobStore.set(Buffer.from(blobId).toString(\"hex\"), data);\n\treturn blobId;\n}\n\nfunction readCursorBlob(blobStore: Map<string, Uint8Array>, blobId: Uint8Array): Uint8Array {\n\tconst data = blobStore.get(Buffer.from(blobId).toString(\"hex\"));\n\tif (!data) {\n\t\tthrow new Error(\"Cursor blob not found\");\n\t}\n\treturn data;\n}\n\n/**\n * Local tools Cursor already drives natively over the exec channel, so\n * advertising them again as MCP tools would give the model two ways to call\n * the same thing.\n */\nconst CURSOR_NATIVE_TOOL_NAMES = new Set([\"bash\", \"read\", \"write\", \"delete\", \"ls\", \"grep\", \"todo\"]);\n\n/** Strip TypeBox symbol metadata down to a plain JSON Schema document. */\nfunction toolParametersToJsonSchema(tool: Tool): unknown {\n\ttry {\n\t\treturn JSON.parse(JSON.stringify(tool.parameters));\n\t} catch {\n\t\treturn { type: \"object\", properties: {}, required: [] };\n\t}\n}\n\nexport function buildMcpToolDefinitions(tools: Tool[] | undefined): McpToolDefinition[] {\n\tif (!tools || tools.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst advertisedTools = tools.filter((tool) => !CURSOR_NATIVE_TOOL_NAMES.has(tool.name));\n\tif (advertisedTools.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn advertisedTools.map((tool) => {\n\t\tconst jsonSchema = toolParametersToJsonSchema(tool);\n\t\tconst schemaValue: PbJsonValue =\n\t\t\tjsonSchema && typeof jsonSchema === \"object\"\n\t\t\t\t? (jsonSchema as PbJsonValue)\n\t\t\t\t: { type: \"object\", properties: {}, required: [] };\n\t\tconst inputSchema = toBinary(ValueSchema, fromJson(ValueSchema, schemaValue));\n\t\treturn create(McpToolDefinitionSchema, {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description || \"\",\n\t\t\tproviderIdentifier: \"pi-agent\",\n\t\t\ttoolName: tool.name,\n\t\t\tinputSchema,\n\t\t});\n\t});\n}\n\n/** Extract text content from a user message. */\nfunction extractUserMessageText(msg: Message): string {\n\tif (msg.role !== \"user\") return \"\";\n\tconst content = msg.content;\n\tif (typeof content === \"string\") return content.trim();\n\tconst text = content\n\t\t.filter((c): c is TextContent => c.type === \"text\")\n\t\t.map((c) => c.text)\n\t\t.join(\"\\n\");\n\treturn text.trim();\n}\n\nfunction hasUserMessageImages(msg: Message): boolean {\n\treturn msg.role === \"user\" && Array.isArray(msg.content) && msg.content.some((item) => item.type === \"image\");\n}\n\ntype CursorRootPromptContentPart = { type: \"text\"; text: string } | { type: \"image\"; image: string; mediaType: string };\n\nfunction buildCursorRootPromptContent(content: string | (TextContent | ImageContent)[]): CursorRootPromptContentPart[] {\n\tif (typeof content === \"string\") {\n\t\tconst text = content.trim();\n\t\treturn text ? [{ type: \"text\", text }] : [];\n\t}\n\tconst parts: CursorRootPromptContentPart[] = [];\n\tfor (const item of content) {\n\t\tif (item.type === \"text\") {\n\t\t\tconst text = item.text.trim();\n\t\t\tif (text) {\n\t\t\t\tparts.push({ type: \"text\", text });\n\t\t\t}\n\t\t} else {\n\t\t\tparts.push({ type: \"image\", image: `data:${item.mimeType};base64,${item.data}`, mediaType: item.mimeType });\n\t\t}\n\t}\n\treturn parts;\n}\n\nfunction cursorUserContentKey(content: string | (TextContent | ImageContent)[]): string {\n\tif (typeof content === \"string\") {\n\t\treturn content.trim();\n\t}\n\tconst hash = createHash(\"sha256\");\n\tfor (const item of content) {\n\t\thash.update(item.type);\n\t\tif (item.type === \"text\") {\n\t\t\thash.update(item.text);\n\t\t} else {\n\t\t\thash.update(item.mimeType);\n\t\t\thash.update(item.data);\n\t\t}\n\t}\n\treturn hash.digest(\"hex\");\n}\n\ntype CursorRootPromptAssistantContentPart =\n\t| { type: \"text\"; text: string }\n\t| { type: \"tool-call\"; toolCallId: string; toolName: string; args: Record<string, unknown> };\n\nfunction buildCursorAssistantContent(msg: AssistantMessage): CursorRootPromptAssistantContentPart[] {\n\tconst content: CursorRootPromptAssistantContentPart[] = [];\n\tfor (const item of msg.content) {\n\t\tif (item.type === \"text\") {\n\t\t\tif (item.text) content.push({ type: \"text\", text: item.text });\n\t\t} else if (item.type === \"toolCall\") {\n\t\t\tcontent.push({\n\t\t\t\ttype: \"tool-call\",\n\t\t\t\ttoolCallId: item.id,\n\t\t\t\ttoolName: item.name,\n\t\t\t\targs: item.arguments,\n\t\t\t});\n\t\t}\n\t\t// Thinking is never replayed: Cursor manages reasoning server-side and\n\t\t// foreign/hidden reasoning must not leak into history as native thinking.\n\t}\n\treturn content;\n}\n\n/**\n * Index of the last user message in `messages`, or -1 if none. Used to\n * exclude the current user turn from history builders — it goes in the\n * `userMessageAction`, not in history structures.\n */\nfunction findLastUserMessageIndex(messages: Message[]): number {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tif (messages[i].role === \"user\") {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * Build one Cursor system-message JSON blob per system prompt. When no system\n * prompt is provided, returns a single default greeting so we never emit an\n * empty `rootPromptMessagesJson` head.\n */\nexport function buildCursorSystemPromptJsons(systemPrompt: string | undefined): string[] {\n\tconst trimmed = systemPrompt?.trim();\n\tif (!trimmed) {\n\t\treturn [JSON.stringify({ role: \"system\", content: \"You are a helpful assistant.\" })];\n\t}\n\treturn [JSON.stringify({ role: \"system\", content: trimmed })];\n}\n\n/**\n * Build `ConversationStateStructure.rootPromptMessagesJson` blob IDs for the\n * system prompt plus prior conversation history, as JSON blobs matching\n * Cursor's internal Vercel-AI-SDK-shaped message format.\n *\n * Cursor's server uses `rootPromptMessagesJson` (not `turns[]`) to build the\n * actual model prompt; `turns[]` is UI/display metadata. The active user\n * message is excluded because it is sent in the action.\n */\nfunction buildRootPromptMessagesJson(\n\tmessages: Message[],\n\tsystemPromptIds: Uint8Array[],\n\tblobStore: Map<string, Uint8Array>,\n\tactiveUserMessageIndex = findLastUserMessageIndex(messages),\n): Uint8Array[] {\n\tconst entries: Uint8Array[] = [...systemPromptIds];\n\tconst pushJson = (obj: unknown) => {\n\t\tconst bytes = new TextEncoder().encode(JSON.stringify(obj));\n\t\tentries.push(storeCursorBlob(blobStore, bytes));\n\t};\n\n\tfor (let i = 0; i < messages.length; i++) {\n\t\tif (i === activeUserMessageIndex) break;\n\t\tconst msg = messages[i];\n\t\tif (msg.role === \"user\") {\n\t\t\tconst content = buildCursorRootPromptContent(msg.content);\n\t\t\tif (content.length === 0) continue;\n\t\t\tpushJson({ role: \"user\", content });\n\t\t} else if (msg.role === \"assistant\") {\n\t\t\tconst content = buildCursorAssistantContent(msg);\n\t\t\tif (content.length === 0) continue;\n\t\t\tpushJson({ role: \"assistant\", content });\n\t\t} else if (msg.role === \"toolResult\") {\n\t\t\t// Emit even when the result text is empty: the assistant `tool-call`\n\t\t\t// is already in history, so dropping the pair would replay an\n\t\t\t// orphaned call.\n\t\t\tpushJson({\n\t\t\t\trole: \"tool\",\n\t\t\t\tid: msg.toolCallId,\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\t\ttoolName: msg.toolName,\n\t\t\t\t\t\ttoolCallId: msg.toolCallId,\n\t\t\t\t\t\tresult: toolResultToText(msg),\n\t\t\t\t\t\t...(msg.isError ? { isError: true } : {}),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t});\n\t\t}\n\t}\n\n\treturn entries;\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\n\nfunction isJsonValue(value: unknown): value is PbJsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) return value.every(isJsonValue);\n\tif (!isPlainRecord(value)) return false;\n\tfor (const key in value) {\n\t\tif (!isJsonValue(value[key])) return false;\n\t}\n\treturn true;\n}\n\nfunction encodeCursorMcpArguments(toolCall: ToolCall): Record<string, Uint8Array> {\n\tconst encoded: Record<string, Uint8Array> = {};\n\tfor (const name in toolCall.arguments) {\n\t\tconst value = toolCall.arguments[name];\n\t\tif (value === undefined) continue;\n\t\tif (!isJsonValue(value)) {\n\t\t\tthrow new Error(`Cursor tool argument ${toolCall.name}.${name} is not JSON-serializable`);\n\t\t}\n\t\tencoded[name] = toBinary(ValueSchema, fromJson(ValueSchema, value));\n\t}\n\treturn encoded;\n}\n\nfunction createCursorMcpResult(result: ToolResultMessage) {\n\tif (result.isError) {\n\t\treturn create(McpToolResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"error\",\n\t\t\t\tvalue: create(McpToolErrorSchema, { error: toolResultToText(result) }),\n\t\t\t},\n\t\t});\n\t}\n\treturn create(McpToolResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(McpSuccessSchema, {\n\t\t\t\tcontent: result.content.map((item) =>\n\t\t\t\t\titem.type === \"text\"\n\t\t\t\t\t\t? create(McpToolResultContentItemSchema, {\n\t\t\t\t\t\t\t\tcontent: { case: \"text\", value: create(McpTextContentSchema, { text: item.text }) },\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: create(McpToolResultContentItemSchema, {\n\t\t\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t\t\tcase: \"image\",\n\t\t\t\t\t\t\t\t\tvalue: create(McpImageContentSchema, {\n\t\t\t\t\t\t\t\t\t\tdata: Uint8Array.from(Buffer.from(item.data, \"base64\")),\n\t\t\t\t\t\t\t\t\t\tmimeType: item.mimeType,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction createCursorToolCallStep(toolCall: ToolCall, result: ToolResultMessage | undefined) {\n\tconst mcpCall = create(McpToolCallSchema, {\n\t\targs: create(McpArgsSchema, {\n\t\t\tname: toolCall.name,\n\t\t\targs: encodeCursorMcpArguments(toolCall),\n\t\t\ttoolCallId: toolCall.id,\n\t\t\tproviderIdentifier: \"pi-agent\",\n\t\t\ttoolName: toolCall.name,\n\t\t}),\n\t\t...(result ? { result: createCursorMcpResult(result) } : {}),\n\t});\n\treturn create(ConversationStepSchema, {\n\t\tmessage: {\n\t\t\tcase: \"toolCall\",\n\t\t\tvalue: create(ToolCallSchema, {\n\t\t\t\ttool: { case: \"mcpToolCall\", value: mcpCall },\n\t\t\t\ttoolCallId: toolCall.id,\n\t\t\t}),\n\t\t},\n\t});\n}\n\n/**\n * Convert context.messages to Cursor's ConversationTurnStructure blob IDs.\n * Groups messages into turns: each turn is a user message followed by the\n * assistant's response. Excludes the active user message (which goes in the\n * action).\n */\nfunction buildConversationTurns(\n\tmessages: Message[],\n\tblobStore: Map<string, Uint8Array>,\n\tactiveUserMessageIndex = findLastUserMessageIndex(messages),\n): Uint8Array[] {\n\tconst turns: Uint8Array[] = [];\n\tconst historyEnd = activeUserMessageIndex >= 0 ? activeUserMessageIndex : messages.length;\n\tconst toolResults = new Map<string, ToolResultMessage>();\n\tconst pairedToolCallIds = new Set<string>();\n\tfor (let index = 0; index < historyEnd; index++) {\n\t\tconst message = messages[index];\n\t\tif (message.role === \"toolResult\") {\n\t\t\ttoolResults.set(message.toolCallId, message);\n\t\t} else if (message.role === \"assistant\") {\n\t\t\tfor (const item of message.content) {\n\t\t\t\tif (item.type === \"toolCall\") pairedToolCallIds.add(item.id);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet i = 0;\n\twhile (i < messages.length) {\n\t\tconst msg = messages[i];\n\t\tif (msg.role !== \"user\") {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (i === activeUserMessageIndex) break;\n\n\t\tconst userText = extractUserMessageText(msg);\n\t\tif (userText.length === 0 && !hasUserMessageImages(msg)) {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst userMessage = createCursorUserMessage(\n\t\t\tmsg.content,\n\t\t\tuserText,\n\t\t\tdeterministicUuid(`u:${turns.length}:${cursorUserContentKey(msg.content)}`),\n\t\t);\n\t\tconst userMessageBlobId = storeCursorBlob(blobStore, toBinary(UserMessageSchema, userMessage));\n\t\tconst stepBlobIds: Uint8Array[] = [];\n\t\ti++;\n\n\t\twhile (i < messages.length && messages[i].role !== \"user\") {\n\t\t\tconst stepMsg = messages[i];\n\t\t\tif (stepMsg.role === \"assistant\") {\n\t\t\t\tfor (const item of stepMsg.content) {\n\t\t\t\t\tlet step: ConversationStep;\n\t\t\t\t\tif (item.type === \"text\") {\n\t\t\t\t\t\tif (!item.text) continue;\n\t\t\t\t\t\tstep = create(ConversationStepSchema, {\n\t\t\t\t\t\t\tmessage: {\n\t\t\t\t\t\t\t\tcase: \"assistantMessage\",\n\t\t\t\t\t\t\t\tvalue: create(AssistantMessageSchema, { text: item.text }),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (item.type === \"thinking\") {\n\t\t\t\t\t\t// Foreign/hidden reasoning never leaks into Cursor's turn\n\t\t\t\t\t\t// history as native thinking.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (item.type === \"toolCall\") {\n\t\t\t\t\t\tstep = createCursorToolCallStep(item, toolResults.get(item.id));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstepBlobIds.push(storeCursorBlob(blobStore, toBinary(ConversationStepSchema, step)));\n\t\t\t\t}\n\t\t\t} else if (stepMsg.role === \"toolResult\" && !pairedToolCallIds.has(stepMsg.toolCallId)) {\n\t\t\t\tconst text = toolResultToText(stepMsg);\n\t\t\t\tif (text) {\n\t\t\t\t\tconst prefix = stepMsg.isError ? \"[Tool Error]\" : \"[Tool Result]\";\n\t\t\t\t\tconst step = create(ConversationStepSchema, {\n\t\t\t\t\t\tmessage: {\n\t\t\t\t\t\t\tcase: \"assistantMessage\",\n\t\t\t\t\t\t\tvalue: create(AssistantMessageSchema, { text: `${prefix}\\n${text}` }),\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tstepBlobIds.push(storeCursorBlob(blobStore, toBinary(ConversationStepSchema, step)));\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\tconst agentTurn = create(AgentConversationTurnStructureSchema, {\n\t\t\tuserMessage: userMessageBlobId,\n\t\t\tsteps: stepBlobIds,\n\t\t});\n\t\tconst turn = create(ConversationTurnStructureSchema, {\n\t\t\tturn: {\n\t\t\t\tcase: \"agentConversationTurn\",\n\t\t\t\tvalue: agentTurn,\n\t\t\t},\n\t\t});\n\t\tturns.push(storeCursorBlob(blobStore, toBinary(ConversationTurnStructureSchema, turn)));\n\t}\n\n\treturn turns;\n}\n\n/** Exported for tests: decodes Cursor history blobs built from conversation messages. */\nexport function buildCursorHistoryForTest(\n\tmessages: Message[],\n\tactiveUserMessageIndex = findLastUserMessageIndex(messages),\n): {\n\trootPromptMessagesJson: unknown[];\n\tturnUserMessagesJson: unknown[];\n\tturnStepMessagesJson: unknown[][];\n} {\n\tconst blobStore = new Map<string, Uint8Array>();\n\tconst rootPromptMessagesJson = buildRootPromptMessagesJson(messages, [], blobStore, activeUserMessageIndex).map(\n\t\t(blobId) => JSON.parse(new TextDecoder().decode(readCursorBlob(blobStore, blobId))),\n\t);\n\tconst turnUserMessagesJson: unknown[] = [];\n\tconst turnStepMessagesJson: unknown[][] = [];\n\tfor (const turnBlobId of buildConversationTurns(messages, blobStore, activeUserMessageIndex)) {\n\t\tconst turn = fromBinary(ConversationTurnStructureSchema, readCursorBlob(blobStore, turnBlobId));\n\t\tif (turn.turn.case !== \"agentConversationTurn\") {\n\t\t\tcontinue;\n\t\t}\n\t\tconst userMessage = fromBinary(UserMessageSchema, readCursorBlob(blobStore, turn.turn.value.userMessage));\n\t\tturnUserMessagesJson.push(toJson(UserMessageSchema, userMessage));\n\t\tturnStepMessagesJson.push(\n\t\t\tturn.turn.value.steps.map((stepBlobId) => {\n\t\t\t\tconst step = fromBinary(ConversationStepSchema, readCursorBlob(blobStore, stepBlobId));\n\t\t\t\treturn toJson(ConversationStepSchema, step);\n\t\t\t}),\n\t\t);\n\t}\n\treturn { rootPromptMessagesJson, turnUserMessagesJson, turnStepMessagesJson };\n}\n\nfunction createCursorUserMessage(\n\tcontent: string | (TextContent | ImageContent)[],\n\ttext: string,\n\tmessageId = randomUUID() as string,\n) {\n\tconst images = typeof content === \"string\" ? [] : extractImages(content);\n\treturn create(UserMessageSchema, {\n\t\ttext,\n\t\tmessageId,\n\t\t...(images.length > 0\n\t\t\t? {\n\t\t\t\t\tselectedContext: create(SelectedContextSchema, {\n\t\t\t\t\t\tselectedImages: images,\n\t\t\t\t\t}),\n\t\t\t\t}\n\t\t\t: {}),\n\t});\n}\n\nfunction extractImages(content: (TextContent | ImageContent)[]) {\n\treturn content\n\t\t.filter((item): item is ImageContent => item.type === \"image\")\n\t\t.map((image) =>\n\t\t\tcreate(SelectedImageSchema, {\n\t\t\t\tuuid: randomUUID(),\n\t\t\t\tmimeType: image.mimeType,\n\t\t\t\tdataOrBlobId: {\n\t\t\t\t\tcase: \"data\",\n\t\t\t\t\tvalue: Uint8Array.from(Buffer.from(image.data, \"base64\")),\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n}\n\nasync function buildGrpcRequest(\n\tmodel: Model<\"cursor-agent\">,\n\tcontext: Context,\n\toptions: CursorAgentOptions | undefined,\n\tstate: {\n\t\tconversationId: string;\n\t\tblobStore: Map<string, Uint8Array>;\n\t\tconversationState?: ConversationStateStructure;\n\t},\n): Promise<{\n\trequestBytes: Uint8Array;\n\tblobStore: Map<string, Uint8Array>;\n\tconversationState: ConversationStateStructure;\n}> {\n\tconst blobStore = state.blobStore;\n\n\tconst systemPromptIds = buildCursorSystemPromptJsons(context.systemPrompt).map((json) =>\n\t\tstoreCursorBlob(blobStore, new TextEncoder().encode(json)),\n\t);\n\n\tconst activeUserMessageIndex = context.messages.length - 1;\n\tconst activeMessage = context.messages[activeUserMessageIndex];\n\tconst activeUserMessage = activeMessage?.role === \"user\" ? activeMessage : undefined;\n\tlet userContent: string | (TextContent | ImageContent)[] | undefined;\n\tlet userText = \"\";\n\tlet hasUserImages = false;\n\tif (activeUserMessage) {\n\t\tuserContent = activeUserMessage.content;\n\t\tif (typeof userContent === \"string\") {\n\t\t\tuserText = userContent.trim();\n\t\t} else {\n\t\t\tuserText = extractText(userContent);\n\t\t\thasUserImages = hasImages(userContent);\n\t\t}\n\t}\n\n\tconst action = create(ConversationActionSchema, {\n\t\taction:\n\t\t\tuserContent && (userText.trim().length > 0 || hasUserImages)\n\t\t\t\t? {\n\t\t\t\t\t\tcase: \"userMessageAction\",\n\t\t\t\t\t\tvalue: create(UserMessageActionSchema, {\n\t\t\t\t\t\t\tuserMessage: createCursorUserMessage(userContent, userText),\n\t\t\t\t\t\t}),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tcase: \"resumeAction\",\n\t\t\t\t\t\tvalue: create(ResumeActionSchema, {}),\n\t\t\t\t\t},\n\t});\n\n\t// Build conversation turns from prior messages, excluding only the active\n\t// user message when the request is sending one. Resume actions must\n\t// preserve trailing tool results.\n\tconst turns = buildConversationTurns(context.messages, blobStore, activeUserMessage ? activeUserMessageIndex : -1);\n\n\t// Cursor's server uses `rootPromptMessagesJson` (not `turns[]`) to build\n\t// the actual model prompt; without it multi-turn conversations lose prior\n\t// context.\n\tconst rootPromptMessagesJson = buildRootPromptMessagesJson(\n\t\tcontext.messages,\n\t\tsystemPromptIds,\n\t\tblobStore,\n\t\tactiveUserMessage ? activeUserMessageIndex : -1,\n\t);\n\n\t// Preserve cached non-history state fields (todos, file states, summaries)\n\t// when the system prompt is unchanged; otherwise start fresh.\n\tconst cachedPromptHead = state.conversationState?.rootPromptMessagesJson?.slice(0, systemPromptIds.length) ?? [];\n\tconst hasMatchingPrompt =\n\t\tcachedPromptHead.length === systemPromptIds.length &&\n\t\tsystemPromptIds.every((id, idx) => Buffer.from(cachedPromptHead[idx]).equals(id));\n\tconst baseState =\n\t\tstate.conversationState && hasMatchingPrompt\n\t\t\t? state.conversationState\n\t\t\t: create(ConversationStateStructureSchema, {\n\t\t\t\t\trootPromptMessagesJson: systemPromptIds,\n\t\t\t\t\tturns: [],\n\t\t\t\t\ttodos: [],\n\t\t\t\t\tpendingToolCalls: [],\n\t\t\t\t\tpreviousWorkspaceUris: [],\n\t\t\t\t\tfileStates: {},\n\t\t\t\t\tfileStatesV2: {},\n\t\t\t\t\tsummaryArchives: [],\n\t\t\t\t\tturnTimings: [],\n\t\t\t\t\tsubagentStates: {},\n\t\t\t\t\tselfSummaryCount: 0,\n\t\t\t\t\treadPaths: [],\n\t\t\t\t});\n\n\t// Always override `rootPromptMessagesJson` and `turns` with content freshly\n\t// built from `context.messages`: the server-echoed checkpoint replaces\n\t// historical user entries with empty placeholders.\n\tconst conversationState = create(ConversationStateStructureSchema, {\n\t\t...baseState,\n\t\trootPromptMessagesJson,\n\t\tturns,\n\t});\n\n\tconst wireModelId = model.upstreamModelId ?? model.id;\n\tconst cursorMaxMode = model.compat?.cursorMaxMode === true;\n\tconst modelDetails = create(ModelDetailsSchema, {\n\t\tmodelId: wireModelId,\n\t\tdisplayModelId: model.id,\n\t\tdisplayName: model.name,\n\t\t...(cursorMaxMode ? { maxMode: true } : undefined),\n\t});\n\tconst requestedModel = create(RequestedModelSchema, {\n\t\tmodelId: wireModelId,\n\t\tmaxMode: cursorMaxMode,\n\t});\n\n\tconst runRequest = create(AgentRunRequestSchema, {\n\t\tconversationState,\n\t\taction,\n\t\tmodelDetails,\n\t\trequestedModel,\n\t\tconversationId: state.conversationId,\n\t});\n\n\tif (options?.customSystemPrompt) {\n\t\trunRequest.customSystemPrompt = options.customSystemPrompt;\n\t}\n\n\tawait options?.onPayload?.(runRequest, model as Model<Api>);\n\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"runRequest\", value: runRequest },\n\t});\n\n\tconst requestBytes = toBinary(AgentClientMessageSchema, clientMessage);\n\n\tlog(\"info\", \"builtRunRequest\", {\n\t\tbytes: requestBytes.length,\n\t\ttools: context.tools?.length ?? 0,\n\t});\n\n\treturn { requestBytes, blobStore, conversationState };\n}\n\nfunction hasImages(content: (TextContent | ImageContent)[]): boolean {\n\treturn content.some((item) => item.type === \"image\");\n}\n\nfunction extractText(content: (TextContent | ImageContent)[]): string {\n\treturn content\n\t\t.filter((c): c is TextContent => c.type === \"text\")\n\t\t.map((c) => c.text)\n\t\t.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Model discovery (GetUsableModels)\n// ---------------------------------------------------------------------------\n\nconst CURSOR_GET_USABLE_MODELS_PATH = \"/agent.v1.AgentService/GetUsableModels\";\nconst CURSOR_DEFAULT_CONTEXT_WINDOW = 200_000;\nconst CURSOR_DEFAULT_MAX_TOKENS = 64_000;\n/**\n * `GetUsableModels` carries no context-window field, so the 1M ceiling is\n * recovered from the signals Cursor does send: display-name \"1M\" labels and\n * the max-mode flag on Claude/Gemini families.\n */\nconst CURSOR_1M_CONTEXT_WINDOW = 1_000_000;\nconst CURSOR_1M_NAME_PATTERN = /\\b1m\\b/i;\nconst CURSOR_MAX_MODE_1M_ID_PATTERN = /claude|gemini/;\n/**\n * Model-id families whose native catalogs are multimodal. Cursor-only or\n * text-only families (`composer-*`, `grok-code-*`) stay outside this pattern.\n */\nconst CURSOR_MULTIMODAL_ID_PATTERN = /claude|gemini|gpt-|codex/;\n\nexport interface CursorDiscoveredModel {\n\tid: string;\n\tname: string;\n\treasoning: boolean;\n\tinput: (\"text\" | \"image\")[];\n\tcontextWindow: number;\n\tmaxTokens: number;\n\tcursorMaxMode: boolean;\n}\n\n/**\n * Fetches Cursor models through `GetUsableModels` (unary protobuf over\n * HTTP/2; the ALB rejects HTTP/1.1 with 464) and normalizes them.\n *\n * Returns `null` on request/decode failures; `[]` only when the endpoint\n * responds successfully with no usable models.\n */\nexport async function fetchCursorUsableModels(options: {\n\tapiKey: string;\n\tbaseUrl?: string;\n\ttimeoutMs?: number;\n\tsignal?: AbortSignal;\n}): Promise<CursorDiscoveredModel[] | null> {\n\tconst timeoutMs = options.timeoutMs ?? 10_000;\n\ttry {\n\t\tconst requestPayload = create(GetUsableModelsRequestSchema, { customModelIds: [] });\n\t\tconst body = toBinary(GetUsableModelsRequestSchema, requestPayload);\n\t\tconst baseUrl = (options.baseUrl ?? CURSOR_API_URL).replace(/\\/+$/, \"\");\n\n\t\tconst responseBuffer = await new Promise<Uint8Array | null>((resolve) => {\n\t\t\tconst client = http2.connect(baseUrl);\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tclient.destroy();\n\t\t\t\tresolve(null);\n\t\t\t}, timeoutMs);\n\t\t\tconst abort = () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tclient.destroy();\n\t\t\t\tresolve(null);\n\t\t\t};\n\t\t\toptions.signal?.addEventListener(\"abort\", abort, { once: true });\n\n\t\t\tclient.on(\"error\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(null);\n\t\t\t});\n\n\t\t\tconst req = client.request({\n\t\t\t\t\":method\": \"POST\",\n\t\t\t\t\":path\": CURSOR_GET_USABLE_MODELS_PATH,\n\t\t\t\t\"content-type\": \"application/proto\",\n\t\t\t\tte: \"trailers\",\n\t\t\t\tauthorization: `Bearer ${options.apiKey}`,\n\t\t\t\t\"x-ghost-mode\": \"true\",\n\t\t\t\t\"x-cursor-client-version\": CURSOR_CLIENT_VERSION,\n\t\t\t\t\"x-cursor-client-type\": \"cli\",\n\t\t\t});\n\n\t\t\tconst chunks: Buffer[] = [];\n\t\t\treq.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n\t\t\treq.on(\"end\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tclient.close();\n\t\t\t\tresolve(new Uint8Array(Buffer.concat(chunks)));\n\t\t\t});\n\t\t\treq.on(\"error\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tclient.close();\n\t\t\t\tresolve(null);\n\t\t\t});\n\t\t\treq.on(\"response\", (headers) => {\n\t\t\t\tconst status = Number(headers[\":status\"] ?? 0);\n\t\t\t\tif (status < 200 || status >= 300) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tclient.close();\n\t\t\t\t\tresolve(null);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (body.length > 0) {\n\t\t\t\treq.end(Buffer.from(body));\n\t\t\t} else {\n\t\t\t\treq.end();\n\t\t\t}\n\t\t});\n\n\t\tif (!responseBuffer || responseBuffer.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst decoded = decodeGetUsableModelsResponse(responseBuffer);\n\t\tif (!decoded) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst byId = new Map<string, CursorDiscoveredModel>();\n\t\tfor (const model of decoded.models ?? []) {\n\t\t\tconst id = model.modelId?.trim();\n\t\t\tif (!id) continue;\n\t\t\tconst name = pickModelDisplayName(model, id);\n\t\t\tconst labeled1M =\n\t\t\t\tCURSOR_1M_NAME_PATTERN.test(id) ||\n\t\t\t\t[model.displayName, model.displayNameShort, model.displayModelId, ...(model.aliases ?? [])].some(\n\t\t\t\t\t(candidate) => typeof candidate === \"string\" && CURSOR_1M_NAME_PATTERN.test(candidate),\n\t\t\t\t);\n\t\t\tconst maxMode = model.maxMode === true;\n\t\t\tconst contextWindow =\n\t\t\t\tlabeled1M || (maxMode && CURSOR_MAX_MODE_1M_ID_PATTERN.test(id))\n\t\t\t\t\t? CURSOR_1M_CONTEXT_WINDOW\n\t\t\t\t\t: CURSOR_DEFAULT_CONTEXT_WINDOW;\n\t\t\tbyId.set(id, {\n\t\t\t\tid,\n\t\t\t\tname,\n\t\t\t\treasoning: Boolean(model.thinkingDetails),\n\t\t\t\tinput: CURSOR_MULTIMODAL_ID_PATTERN.test(id.toLowerCase()) ? [\"text\", \"image\"] : [\"text\"],\n\t\t\t\tcontextWindow,\n\t\t\t\tmaxTokens: CURSOR_DEFAULT_MAX_TOKENS,\n\t\t\t\tcursorMaxMode: maxMode,\n\t\t\t});\n\t\t}\n\t\treturn [...byId.values()].sort((a, b) => a.id.localeCompare(b.id));\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction decodeGetUsableModelsResponse(payload: Uint8Array) {\n\tconst framedBody = decodeConnectUnaryBody(payload);\n\tif (framedBody) {\n\t\ttry {\n\t\t\treturn fromBinary(GetUsableModelsResponseSchema, framedBody);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\ttry {\n\t\treturn fromBinary(GetUsableModelsResponseSchema, payload);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction decodeConnectUnaryBody(payload: Uint8Array): Uint8Array | null {\n\tif (payload.length < 5) {\n\t\treturn null;\n\t}\n\n\tlet offset = 0;\n\twhile (offset + 5 <= payload.length) {\n\t\tconst flags = payload[offset];\n\t\tconst view = new DataView(payload.buffer, payload.byteOffset + offset, payload.byteLength - offset);\n\t\tconst messageLength = view.getUint32(1, false);\n\t\tconst frameEnd = offset + 5 + messageLength;\n\t\tif (frameEnd > payload.length) {\n\t\t\treturn null;\n\t\t}\n\t\tconst compressionFlagSet = (flags & 0b0000_0001) !== 0;\n\t\tif (compressionFlagSet) {\n\t\t\treturn null;\n\t\t}\n\t\tconst endStreamFlagSet = (flags & 0b0000_0010) !== 0;\n\t\tif (!endStreamFlagSet) {\n\t\t\treturn payload.subarray(offset + 5, frameEnd);\n\t\t}\n\n\t\toffset = frameEnd;\n\t}\n\n\treturn null;\n}\n\nfunction pickModelDisplayName(\n\tmodel: { displayName?: string; displayNameShort?: string; displayModelId?: string; aliases?: string[] },\n\tfallbackId: string,\n): string {\n\tconst candidates = [model.displayName, model.displayNameShort, model.displayModelId, ...(model.aliases ?? [])];\n\tfor (const candidate of candidates) {\n\t\tif (typeof candidate !== \"string\") {\n\t\t\tcontinue;\n\t\t}\n\t\tconst trimmed = candidate.trim();\n\t\tif (trimmed) {\n\t\t\treturn trimmed;\n\t\t}\n\t}\n\treturn fallbackId;\n}\n"]}
1
+ {"version":3,"file":"cursor-agent.js","sourceRoot":"","sources":["../../src/api/cursor-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAiC,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAgB7C,OAAO,EAEN,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,i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QACpC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YACnC,SAAS;QACV,CAAC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,OAAO,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Cursor agent protocol (`agent.v1.AgentService/Run`) over HTTP/2 Connect.\n *\n * Ported from upstream oh-my-pi's Cursor provider and adapted to senpi's\n * provider-neutral API architecture. The protocol is server-driven: the\n * client opens one `Run` stream per assistant turn, the server streams\n * interaction updates (text/thinking/tool-call deltas) and, mid-turn, sends\n * `ExecServerMessage` frames asking the CLIENT to execute a tool and blocks\n * until the answer arrives on the same stream. Tool execution is therefore\n * bridged through injected {@link CursorExecHandlers}; each bridged call is\n * synthesized into the assistant message as an already-resolved `toolCall`\n * block (marked {@link kCursorExecResolved} so the agent loop never re-runs\n * it) and paired with a `ToolResultMessage` delivered via `onToolResult`.\n *\n * NOTE: This module is Node-only (node:http2) and must only be reached\n * through the lazy wrapper (`cursor-agent.lazy.ts`).\n */\n\nimport { createHash, randomUUID } from \"node:crypto\";\nimport * as http2 from \"node:http2\";\nimport { create, fromBinary, fromJson, type JsonValue as PbJsonValue, toBinary, toJson } from \"@bufbuild/protobuf\";\nimport { ValueSchema } from \"@bufbuild/protobuf/wkt\";\nimport { calculateCost } from \"../models.ts\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tContext,\n\tImageContent,\n\tMessage,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tTextContent,\n\tThinkingContent,\n\tTool,\n\tToolCall,\n\tToolResultMessage,\n} from \"../types.ts\";\nimport {\n\ttype CursorExecResolvedCarrier,\n\tclearStreamingPartialJson,\n\tkCursorExecResolved,\n\tkStreamingBlockIndex,\n\tkStreamingBlockKind,\n\tkStreamingEnvelopeId,\n\tkStreamingLastParseLen,\n\tkStreamingPartialJson,\n} from \"../utils/block-symbols.ts\";\nimport { AssistantMessageEventStream } from \"../utils/event-stream.ts\";\nimport { providerHeadersToRecord } from \"../utils/headers.ts\";\nimport { parseJsonWithRepair, parseStreamingJson } from \"../utils/json-parse.ts\";\nimport { sanitizeSurrogates } from \"../utils/sanitize-unicode.ts\";\nimport { deterministicUuid } from \"./cursor-agent/deterministic-id.ts\";\nimport { armExecHeartbeat } from \"./cursor-agent/exec-lifecycle.ts\";\nimport {\n\tbuildMcpStateResult,\n\tbuildNeutralHookResult,\n\tbuildPiBashError,\n\tbuildPiBashResult,\n\tbuildPiEditError,\n\tbuildPiEditRejected,\n\tbuildPiEditResult,\n\tbuildPiFindError,\n\tbuildPiFindResult,\n\tbuildPiGrepError,\n\tbuildPiGrepResult,\n\tbuildPiLsError,\n\tbuildPiLsResult,\n\tbuildPiReadError,\n\tbuildPiReadResult,\n\tbuildPiWriteError,\n\tbuildPiWriteRejected,\n\tbuildPiWriteResult,\n} from \"./cursor-agent/exec-modern.ts\";\nimport {\n\tAgentClientMessageSchema,\n\tAgentConversationTurnStructureSchema,\n\tAgentRunRequestSchema,\n\ttype AgentServerMessage,\n\tAgentServerMessageSchema,\n\tAgentStoreConflictErrorSchema,\n\tAgentStoreConflictResultSchema,\n\tAssistantMessageSchema,\n\tBackgroundShellSpawnResultSchema,\n\tCanvasDiagnosticsErrorSchema,\n\tCanvasDiagnosticsResultSchema,\n\tClientHeartbeatSchema,\n\tComputerUseErrorSchema,\n\tComputerUseResultSchema,\n\tConversationActionSchema,\n\tConversationSearchErrorSchema,\n\tConversationSearchResultSchema,\n\ttype ConversationStateStructure,\n\tConversationStateStructureSchema,\n\ttype ConversationStep,\n\tConversationStepSchema,\n\tConversationTurnStructureSchema,\n\tDeleteErrorSchema,\n\tDeleteRejectedSchema,\n\tDeleteResultSchema,\n\tDeleteSuccessSchema,\n\tDiagnosticsErrorSchema,\n\tDiagnosticsRejectedSchema,\n\tDiagnosticsResultSchema,\n\tDiagnosticsSuccessSchema,\n\tExecClientControlMessageSchema,\n\tExecClientHeartbeatSchema,\n\ttype ExecClientMessage,\n\tExecClientMessageSchema,\n\tExecClientStreamCloseSchema,\n\tExecClientThrowSchema,\n\ttype ExecServerMessage,\n\tFetchErrorSchema,\n\tFetchResultSchema,\n\tForceBackgroundShellResultSchema,\n\tForceBackgroundShellStatus,\n\tForceBackgroundSubagentResultSchema,\n\tForceBackgroundSubagentStatus,\n\tGetBlobResultSchema,\n\tGetUsableModelsRequestSchema,\n\tGetUsableModelsResponseSchema,\n\tGrepContentMatchSchema,\n\tGrepContentResultSchema,\n\tGrepCountResultSchema,\n\tGrepErrorSchema,\n\ttype GrepFileCount,\n\tGrepFileCountSchema,\n\tGrepFileMatchSchema,\n\tGrepFilesResultSchema,\n\tGrepResultSchema,\n\tGrepSuccessSchema,\n\ttype GrepUnionResult,\n\tGrepUnionResultSchema,\n\tKvClientMessageSchema,\n\ttype KvServerMessage,\n\tListMcpResourcesExecResultSchema,\n\tListMcpResourcesSuccessSchema,\n\ttype LsDirectoryTreeNode,\n\ttype LsDirectoryTreeNode_File,\n\tLsDirectoryTreeNode_FileSchema,\n\tLsDirectoryTreeNodeSchema,\n\tLsErrorSchema,\n\tLsRejectedSchema,\n\tLsResultSchema,\n\tLsSuccessSchema,\n\tMcpAllowlistPrecheckResultSchema,\n\tMcpApprovedSchema,\n\tMcpArgsSchema,\n\tMcpErrorSchema,\n\tMcpImageContentSchema,\n\tMcpRejectedSchema,\n\tMcpResultSchema,\n\tMcpSuccessSchema,\n\tMcpTextContentSchema,\n\tMcpToolCallSchema,\n\ttype McpToolDefinition,\n\tMcpToolDefinitionSchema,\n\tMcpToolErrorSchema,\n\tMcpToolNotFoundSchema,\n\tMcpToolResultContentItemSchema,\n\tMcpToolResultSchema,\n\tModelDetailsSchema,\n\tReadErrorSchema,\n\tReadMcpResourceExecResultSchema,\n\tReadMcpResourceNotFoundSchema,\n\tReadRejectedSchema,\n\tReadResultSchema,\n\tReadSuccessSchema,\n\tRecordScreenFailureSchema,\n\tRecordScreenResultSchema,\n\tRequestContextResultSchema,\n\tRequestContextSchema,\n\tRequestContextSuccessSchema,\n\tResumeActionSchema,\n\tSelectedContextSchema,\n\tSelectedImageSchema,\n\tSetBlobResultSchema,\n\tShellAllowlistPrecheckResultSchema,\n\ttype ShellArgs,\n\tShellFailureSchema,\n\tShellRejectedSchema,\n\ttype ShellResult,\n\tShellResultSchema,\n\ttype ShellStream,\n\tShellStreamExitSchema,\n\tShellStreamSchema,\n\tShellStreamStartSchema,\n\tShellStreamStderrSchema,\n\tShellStreamStdoutSchema,\n\tShellSuccessSchema,\n\tSmartModeClassifierErrorSchema,\n\tSmartModeClassifierResultSchema,\n\tSubagentAwaitNotFoundSchema,\n\tSubagentAwaitResultSchema,\n\tSubagentErrorSchema,\n\tSubagentResultSchema,\n\tToolCallSchema,\n\ttype TurnEndedUpdate,\n\tUserMessageActionSchema,\n\tUserMessageSchema,\n\tWebFetchAllowlistPrecheckResultSchema,\n\tWriteErrorSchema,\n\tWriteRejectedSchema,\n\tWriteResultSchema,\n\tWriteShellStdinErrorSchema,\n\tWriteShellStdinResultSchema,\n\tWriteSuccessSchema,\n} from \"./cursor-agent/gen/agent_pb.ts\";\nimport {\n\tcomposeShellCommand,\n\tomitUndefinedArgs,\n\tpiLimit,\n\tpiLsPath,\n\tpiReadArgs,\n\tpiTimeout,\n} from \"./cursor-agent/pi-args.ts\";\nimport { buildRequestedModel } from \"./cursor-agent/reasoning-params.ts\";\nimport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./cursor-agent/types.ts\";\n\nexport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorPiCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./cursor-agent/types.ts\";\n\nexport const CURSOR_API_URL = \"https://api2.cursor.sh\";\nexport const CURSOR_CLIENT_VERSION = \"cli-2026.07.23-e383d2b\";\nconst EXEC_HEARTBEAT_INTERVAL_MS = 3000;\n\n/**\n * HTTP/1 connection-specific headers that HTTP/2 forbids. Node's\n * `http2.request()` throws on these rather than dropping them.\n */\nconst HTTP2_FORBIDDEN_HEADERS = new Set([\n\t\"connection\",\n\t\"keep-alive\",\n\t\"proxy-connection\",\n\t\"transfer-encoding\",\n\t\"upgrade\",\n\t\"http2-settings\",\n]);\n\n/**\n * Header names the Cursor request sets for itself. A caller copy in ANY\n * casing has to go: the spread below adds the fixed lower-case name\n * regardless, and two spellings of one field are a duplicate (node throws\n * `ERR_HTTP2_HEADER_SINGLE_VALUE`) rather than an override.\n */\nconst CURSOR_RESERVED_HEADERS = new Set([\n\t\"content-type\",\n\t\"connect-protocol-version\",\n\t\"te\",\n\t\"authorization\",\n\t\"x-ghost-mode\",\n\t\"x-cursor-client-version\",\n\t\"x-cursor-client-type\",\n\t\"x-request-id\",\n\t// Transport-owned: a plain `host` header suppresses the `:authority` node\n\t// derives from the URL, silently retargeting the request.\n\t\"host\",\n\t// The Connect body is streamed after the headers (initial frame,\n\t// heartbeats, tool responses), so no caller-supplied length can describe it.\n\t\"content-length\",\n]);\n\n/** Reduce caller-supplied headers to what this HTTP/2 request can legally carry. */\nexport function sanitizeCursorCallerHeaders(headers: Record<string, string> | undefined): Record<string, string> {\n\tconst sanitized: Record<string, string> = {};\n\tfor (const [name, value] of Object.entries(headers ?? {})) {\n\t\tconst field = name.toLowerCase();\n\t\tif (field.startsWith(\":\")) continue;\n\t\tif (HTTP2_FORBIDDEN_HEADERS.has(field)) continue;\n\t\tif (CURSOR_RESERVED_HEADERS.has(field)) continue;\n\t\tsanitized[field] = value;\n\t}\n\treturn sanitized;\n}\n\n/**\n * Text for a recognised frame this client answers with its own typed error\n * variant. Phrased as a client capability statement, not a tool failure: the\n * model reads it and should route around the capability, not retry the call.\n */\nconst NOT_IMPLEMENTED_SUFFIX = \"not implemented by this client\";\nconst NOT_IMPLEMENTED = \"Not implemented by this client\";\n/** Bare gRPC `resource_exhausted` end-streams (also inside a Connect error message). */\nconst RESOURCE_EXHAUSTED_PATTERN = /resource.?exhausted/i;\n\nconst conversationStateCache = new Map<string, ConversationStateStructure>();\nconst conversationBlobStores = new Map<string, Map<string, Uint8Array>>();\n/**\n * Base conversation id → rotated wire id. Cursor's backend can pin a\n * per-conversation rejection (bare `resource_exhausted`, zero tokens) to one\n * conversationId forever. On the first such failure the id is rotated once\n * and the cached state migrates, so the retry loop's next attempt starts a\n * fresh conversation. Keyed by the base id so a failed rotation never repeats.\n */\nconst rotatedConversationIds = new Map<string, string>();\n\nconst CONNECT_END_STREAM_FLAG = 0b00000010;\n\nfunction log(type: string, subtype?: string, data?: unknown): void {\n\tif (!process.env.DEBUG_CURSOR) return;\n\tconst verbose = process.env.DEBUG_CURSOR === \"2\" || process.env.DEBUG_CURSOR === \"verbose\";\n\tlet dataStr = \"\";\n\tif (verbose && data !== undefined) {\n\t\ttry {\n\t\t\tdataStr = ` ${JSON.stringify(data, (_key, value) => {\n\t\t\t\tif (value instanceof Uint8Array) return `bytes(${value.length})`;\n\t\t\t\tif (typeof value === \"bigint\") return value.toString();\n\t\t\t\treturn value;\n\t\t\t})?.slice(0, 500)}`;\n\t\t} catch {\n\t\t\tdataStr = \" [unserializable]\";\n\t\t}\n\t}\n\tconsole.error(`[CURSOR] ${type}${subtype ? `: ${subtype}` : \"\"}${dataStr}`);\n}\n\nexport function frameConnectMessage(data: Uint8Array, flags = 0): Buffer {\n\tconst frame = Buffer.alloc(5 + data.length);\n\tframe[0] = flags;\n\tframe.writeUInt32BE(data.length, 1);\n\tframe.set(data, 5);\n\treturn frame;\n}\n\nfunction parseConnectEndStream(data: Uint8Array): Error | null {\n\ttry {\n\t\tconst payload = JSON.parse(new TextDecoder().decode(data));\n\t\tconst error = payload?.error;\n\t\tif (error) {\n\t\t\tconst code = typeof error.code === \"string\" ? error.code : \"unknown\";\n\t\t\tconst message = typeof error.message === \"string\" ? error.message : \"Unknown error\";\n\t\t\treturn new Error(`Connect error ${code}: ${message}`);\n\t\t}\n\t\treturn null;\n\t} catch {\n\t\treturn new Error(\"Failed to parse Connect end stream\");\n\t}\n}\n\n/**\n * Maps an opaque HTTP/2 negotiation failure into an actionable error. The\n * Cursor run RPC is HTTP/2-only (the ALB rejects HTTP/1.1 with 464), so a\n * TLS-intercepting proxy that strips ALPN kills the run with no h1 fallback.\n */\nexport function mapH2TransportError(error: unknown, baseUrl: string): unknown {\n\tconst code = (error as { code?: unknown } | null)?.code;\n\tconst message = error instanceof Error ? error.message : String(error);\n\tif (code === \"ERR_HTTP2_ERROR\" && /h2 is not supported/i.test(message)) {\n\t\treturn new Error(\n\t\t\t`Cursor run transport could not negotiate HTTP/2 with ${baseUrl}: \"h2 is not supported\". ` +\n\t\t\t\t\"This host serves the run RPC over HTTP/2 only, and the TLS handshake did not negotiate \" +\n\t\t\t\t\"h2 via ALPN — typically an ALPN-stripping TLS-intercepting proxy. \" +\n\t\t\t\t\"Front the provider with a local HTTP/2 bridge and point the model's baseUrl at it.\",\n\t\t);\n\t}\n\treturn error;\n}\n\nexport const stream: StreamFunction<\"cursor-agent\", CursorAgentOptions> = (\n\tmodel: Model<\"cursor-agent\">,\n\tcontext: Context,\n\toptions?: CursorAgentOptions,\n): AssistantMessageEventStream => {\n\tconst stream = new AssistantMessageEventStream();\n\n\t(async () => {\n\t\tconst output: AssistantMessage = {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: [],\n\t\t\tapi: \"cursor-agent\" as Api,\n\t\t\tprovider: model.provider,\n\t\t\tmodel: model.id,\n\t\t\tusage: {\n\t\t\t\tinput: 0,\n\t\t\t\toutput: 0,\n\t\t\t\tcacheRead: 0,\n\t\t\t\tcacheWrite: 0,\n\t\t\t\ttotalTokens: 0,\n\t\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t\t},\n\t\t\tstopReason: \"stop\",\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\n\t\t// Declared outside the `try` because BOTH exits must drain it: an exec\n\t\t// handler decoded from the last chunk can still be running when the\n\t\t// transport fails, and the error path finalizes the synthesized call\n\t\t// just like the success path does.\n\t\tconst inFlightDispatches = new Set<Promise<void>>();\n\t\t// A dispatch can spawn another, so re-check rather than awaiting one\n\t\t// snapshot. The wait is bounded by the abort signal: exec handlers have\n\t\t// no cancellation contract, so a hung tool must not hold the terminal\n\t\t// event hostage after the user already gave up on the turn.\n\t\tlet abortSettled: Promise<void> | undefined;\n\t\tconst drainInFlightDispatches = async (): Promise<void> => {\n\t\t\tconst signal = options?.signal;\n\t\t\twhile (inFlightDispatches.size > 0) {\n\t\t\t\tif (signal?.aborted) return;\n\t\t\t\tconst settled = Promise.all([...inFlightDispatches]);\n\t\t\t\tif (!signal) {\n\t\t\t\t\tawait settled;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tabortSettled ??= new Promise<void>((resolve) =>\n\t\t\t\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true }),\n\t\t\t\t);\n\t\t\t\tawait Promise.race([settled, abortSettled]);\n\t\t\t}\n\t\t};\n\n\t\tlet h2Client: http2.ClientHttp2Session | null = null;\n\t\tlet h2Request: http2.ClientHttp2Stream | null = null;\n\t\tlet heartbeatTimer: NodeJS.Timeout | null = null;\n\t\tlet h2Settled = false;\n\t\tlet sawTurnEnded = false;\n\t\tlet endStreamError: Error | null = null;\n\t\t// Reachable from the catch: a stream that dies mid-turn must still close\n\t\t// and pair the blocks it left open.\n\t\tlet openBlockState: BlockState | undefined;\n\t\tlet resolveH2: () => void = () => {};\n\t\tlet rejectH2: (error: unknown) => void = () => {};\n\t\tconst h2Completion = new Promise<void>((resolve, reject) => {\n\t\t\tresolveH2 = resolve;\n\t\t\trejectH2 = reject;\n\t\t});\n\t\tconst settleH2 = (error?: unknown): void => {\n\t\t\tif (h2Settled) return;\n\t\t\th2Settled = true;\n\t\t\tif (error !== undefined) {\n\t\t\t\trejectH2(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (endStreamError) {\n\t\t\t\trejectH2(endStreamError);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!sawTurnEnded) {\n\t\t\t\trejectH2(new Error(\"Cursor stream ended before turnEnded\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolveH2();\n\t\t};\n\n\t\t// Hoisted out of the try block: the rotation in the catch path needs\n\t\t// both ids, and the catch block cannot see try-scoped consts.\n\t\tlet baseConversationId: string | undefined;\n\t\tlet conversationId: string | undefined;\n\t\tlet usageState: UsageState | undefined;\n\t\ttry {\n\t\t\tconst apiKey = options?.apiKey;\n\t\t\tif (!apiKey) {\n\t\t\t\tthrow new Error(\"Cursor access token is required; run /login cursor\");\n\t\t\t}\n\n\t\t\tbaseConversationId = options?.conversationId ?? options?.sessionId ?? randomUUID();\n\t\t\tconversationId = rotatedConversationIds.get(baseConversationId) ?? baseConversationId;\n\t\t\tconst blobStore = conversationBlobStores.get(conversationId) ?? new Map<string, Uint8Array>();\n\t\t\tconversationBlobStores.set(conversationId, blobStore);\n\t\t\tconst cachedState = conversationStateCache.get(conversationId);\n\t\t\tconst { requestBytes, conversationState } = await buildGrpcRequest(model, context, options, {\n\t\t\t\tconversationId,\n\t\t\t\tblobStore,\n\t\t\t\tconversationState: cachedState,\n\t\t\t});\n\t\t\tconversationStateCache.set(conversationId, conversationState);\n\t\t\tconst requestContextTools = buildMcpToolDefinitions(context.tools);\n\n\t\t\tconst baseUrl = model.baseUrl || CURSOR_API_URL;\n\t\t\tconst requestPath = \"/agent.v1.AgentService/Run\";\n\t\t\t// Caller headers are additive, and are spread FIRST so the protocol\n\t\t\t// framing, auth, and request id below always win.\n\t\t\tconst callerHeaders = sanitizeCursorCallerHeaders(providerHeadersToRecord(options?.headers));\n\t\t\tconst requestHeaders = {\n\t\t\t\t...callerHeaders,\n\t\t\t\t\":method\": \"POST\",\n\t\t\t\t\":path\": requestPath,\n\t\t\t\t\"content-type\": \"application/connect+proto\",\n\t\t\t\t\"connect-protocol-version\": \"1\",\n\t\t\t\tte: \"trailers\",\n\t\t\t\tauthorization: `Bearer ${apiKey}`,\n\t\t\t\t\"x-ghost-mode\": \"true\",\n\t\t\t\t\"x-cursor-client-version\": CURSOR_CLIENT_VERSION,\n\t\t\t\t\"x-cursor-client-type\": \"cli\",\n\t\t\t\t\"x-request-id\": randomUUID(),\n\t\t\t};\n\n\t\t\th2Client = http2.connect(baseUrl);\n\t\t\th2Client.on(\"error\", (error) => settleH2(mapH2TransportError(error, baseUrl)));\n\n\t\t\th2Request = h2Client.request(requestHeaders);\n\n\t\t\tstream.push({ type: \"start\", partial: output });\n\n\t\t\tlet pendingBuffer: Buffer = Buffer.alloc(0);\n\t\t\tlet currentTextBlock: (TextContent & { [kStreamingBlockIndex]: number }) | null = null;\n\t\t\tlet currentThinkingBlock: (ThinkingContent & { [kStreamingBlockIndex]: number }) | null = null;\n\t\t\tlet currentToolCall: ToolCallState | null = null;\n\t\t\tconst resolvedMcpToolCallIds = new Set<string>();\n\t\t\tusageState = { sawTokenDelta: false, sawTurnEndedUsage: false };\n\n\t\t\tconst state: BlockState = {\n\t\t\t\tget currentTextBlock() {\n\t\t\t\t\treturn currentTextBlock;\n\t\t\t\t},\n\t\t\t\tget currentThinkingBlock() {\n\t\t\t\t\treturn currentThinkingBlock;\n\t\t\t\t},\n\t\t\t\tget currentToolCall() {\n\t\t\t\t\treturn currentToolCall;\n\t\t\t\t},\n\t\t\t\topenToolCalls: new Map<string, ToolCallState>(),\n\t\t\t\tresolvedMcpToolCallIds,\n\t\t\t\tsetTextBlock: (b) => {\n\t\t\t\t\tcurrentTextBlock = b;\n\t\t\t\t},\n\t\t\t\tsetThinkingBlock: (b) => {\n\t\t\t\t\tcurrentThinkingBlock = b;\n\t\t\t\t},\n\t\t\t\tsetToolCall: (t) => {\n\t\t\t\t\tcurrentToolCall = t;\n\t\t\t\t},\n\t\t\t\tonToolResult: options?.onToolResult ?? options?.execHandlers?.onToolResult,\n\t\t\t};\n\t\t\topenBlockState = state;\n\n\t\t\tconst onConversationCheckpoint = (checkpoint: ConversationStateStructure) => {\n\t\t\t\tconversationStateCache.set(conversationId!, checkpoint);\n\t\t\t};\n\n\t\t\th2Request.on(\"data\", (chunk: Buffer) => {\n\t\t\t\t// Steady state drains fully per chunk; alias the fresh h2 chunk\n\t\t\t\t// instead of copying it through Buffer.concat.\n\t\t\t\tpendingBuffer = pendingBuffer.length === 0 ? chunk : Buffer.concat([pendingBuffer, chunk]);\n\n\t\t\t\twhile (pendingBuffer.length >= 5) {\n\t\t\t\t\tconst flags = pendingBuffer[0];\n\t\t\t\t\tconst msgLen = pendingBuffer.readUInt32BE(1);\n\t\t\t\t\tif (pendingBuffer.length < 5 + msgLen) break;\n\n\t\t\t\t\tconst messageBytes = pendingBuffer.subarray(5, 5 + msgLen);\n\t\t\t\t\tpendingBuffer = pendingBuffer.subarray(5 + msgLen);\n\n\t\t\t\t\tif (flags & CONNECT_END_STREAM_FLAG) {\n\t\t\t\t\t\tconst endError = parseConnectEndStream(messageBytes);\n\t\t\t\t\t\tif (endError) {\n\t\t\t\t\t\t\tendStreamError = endError;\n\t\t\t\t\t\t\th2Request?.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst serverMessage = fromBinary(AgentServerMessageSchema, messageBytes);\n\t\t\t\t\t\tconst isTurnEnded =\n\t\t\t\t\t\t\tserverMessage.message.case === \"interactionUpdate\" &&\n\t\t\t\t\t\t\tserverMessage.message.value.message?.case === \"turnEnded\";\n\t\t\t\t\t\t// Dispatch is fire-and-forget so the socket keeps draining\n\t\t\t\t\t\t// while a handler runs, but the promise is tracked: `done`\n\t\t\t\t\t\t// must not be pushed while an exec handler is still resolving,\n\t\t\t\t\t\t// or the buffered tool result is delivered after the turn\n\t\t\t\t\t\t// already finalized and the call is left unpaired.\n\t\t\t\t\t\tconst dispatch = handleServerMessage(\n\t\t\t\t\t\t\tserverMessage,\n\t\t\t\t\t\t\toutput,\n\t\t\t\t\t\t\tstream,\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblobStore,\n\t\t\t\t\t\t\th2Request!,\n\t\t\t\t\t\t\toptions?.execHandlers,\n\t\t\t\t\t\t\tstate.onToolResult,\n\t\t\t\t\t\t\tusageState!,\n\t\t\t\t\t\t\trequestContextTools,\n\t\t\t\t\t\t\tonConversationCheckpoint,\n\t\t\t\t\t\t).catch((error) => {\n\t\t\t\t\t\t\tlog(\"error\", \"handleServerMessage\", { error: String(error) });\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinFlightDispatches.add(dispatch);\n\t\t\t\t\t\tvoid dispatch.finally(() => inFlightDispatches.delete(dispatch));\n\n\t\t\t\t\t\t// Application completion is not protocol success; wait for a\n\t\t\t\t\t\t// clean HTTP/2 end.\n\t\t\t\t\t\tif (isTurnEnded) {\n\t\t\t\t\t\t\tsawTurnEnded = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog(\"error\", \"parseServerMessage\", { error: String(e) });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst sendHeartbeat = () => {\n\t\t\t\tif (!h2Request || h2Request.closed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst heartbeatMessage = create(AgentClientMessageSchema, {\n\t\t\t\t\tmessage: { case: \"clientHeartbeat\", value: create(ClientHeartbeatSchema, {}) },\n\t\t\t\t});\n\t\t\t\tconst heartbeatBytes = toBinary(AgentClientMessageSchema, heartbeatMessage);\n\t\t\t\th2Request.write(frameConnectMessage(heartbeatBytes));\n\t\t\t};\n\n\t\t\th2Request.on(\"trailers\", (trailers) => {\n\t\t\t\tconst status = trailers[\"grpc-status\"];\n\t\t\t\tconst msg = trailers[\"grpc-message\"];\n\t\t\t\tif (status && status !== \"0\" && !endStreamError) {\n\t\t\t\t\tendStreamError = new Error(`gRPC error ${status}: ${decodeURIComponent(String(msg || \"\"))}`);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\th2Request.on(\"end\", () => {\n\t\t\t\tsettleH2();\n\t\t\t});\n\n\t\t\th2Request.on(\"error\", (error) => {\n\t\t\t\tsettleH2(mapH2TransportError(error, baseUrl));\n\t\t\t});\n\n\t\t\tif (options?.signal) {\n\t\t\t\toptions.signal.addEventListener(\"abort\", () => {\n\t\t\t\t\th2Request?.close();\n\t\t\t\t\tsettleH2(new Error(\"Request was aborted\"));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\th2Request.write(frameConnectMessage(requestBytes));\n\t\t\theartbeatTimer = setInterval(sendHeartbeat, 5000);\n\t\t\tawait h2Completion;\n\t\t\t// The transport is done, but a handler decoded from the last chunk\n\t\t\t// may still be running. Pushing `done` now would let the host drain\n\t\t\t// its buffered tool results before such a handler reserved its entry,\n\t\t\t// leaving the call unpaired and stripped from rebuilt transcripts.\n\t\t\tawait drainInFlightDispatches();\n\n\t\t\tendCurrentTextBlock(output, stream, state);\n\t\t\tendCurrentThinkingBlock(output, stream, state);\n\t\t\tflushOpenToolCalls(output, stream, state);\n\n\t\t\tcalculateCost(model, output.usage);\n\n\t\t\tstream.push({\n\t\t\t\ttype: \"done\",\n\t\t\t\treason: output.stopReason as \"stop\" | \"length\" | \"toolUse\",\n\t\t\t\tmessage: output,\n\t\t\t});\n\t\t\tstream.end();\n\t\t} catch (error) {\n\t\t\t// Same reason as the success path: a handler still running would land\n\t\t\t// its real result after the turn finalized and be discarded — even\n\t\t\t// though the tool may already have run side effects. On abort the\n\t\t\t// drain returns immediately.\n\t\t\tawait drainInFlightDispatches();\n\t\t\t// A stream that dies mid-turn leaves blocks open. Closing them here\n\t\t\t// settles their live cards and pairs the server-owned calls that\n\t\t\t// nothing else answers — an unpaired call is stripped from every\n\t\t\t// rebuilt transcript.\n\t\t\tif (openBlockState) {\n\t\t\t\tendCurrentTextBlock(output, stream, openBlockState);\n\t\t\t\tendCurrentThinkingBlock(output, stream, openBlockState);\n\t\t\t\tflushOpenToolCalls(output, stream, openBlockState);\n\t\t\t}\n\t\t\tconst message = error instanceof Error ? error.message : JSON.stringify(error);\n\t\t\t// A server-side per-conversation rejection surfaces as a bare\n\t\t\t// resource_exhausted with zero tokens — the conversation is poisoned,\n\t\t\t// not the account. Rotate the wire id once and migrate cached state\n\t\t\t// so the caller's retry loop starts a fresh conversation.\n\t\t\tif (\n\t\t\t\tconversationId !== undefined &&\n\t\t\t\tbaseConversationId !== undefined &&\n\t\t\t\tusageState !== undefined &&\n\t\t\t\t!usageState.sawTokenDelta &&\n\t\t\t\tRESOURCE_EXHAUSTED_PATTERN.test(message) &&\n\t\t\t\t!rotatedConversationIds.has(baseConversationId)\n\t\t\t) {\n\t\t\t\tconst rotated = randomUUID();\n\t\t\t\trotatedConversationIds.set(baseConversationId, rotated);\n\t\t\t\tconst cached = conversationStateCache.get(conversationId);\n\t\t\t\tif (cached) conversationStateCache.set(rotated, cached);\n\t\t\t\tconst blobs = conversationBlobStores.get(conversationId);\n\t\t\t\tif (blobs) conversationBlobStores.set(rotated, blobs);\n\t\t\t}\n\t\t\toutput.stopReason = options?.signal?.aborted ? \"aborted\" : \"error\";\n\t\t\toutput.errorMessage = message;\n\t\t\tstream.push({ type: \"error\", reason: output.stopReason, error: output });\n\t\t\tstream.end();\n\t\t} finally {\n\t\t\tif (heartbeatTimer) {\n\t\t\t\tclearInterval(heartbeatTimer);\n\t\t\t\theartbeatTimer = null;\n\t\t\t}\n\t\t\th2Request?.close();\n\t\t\th2Client?.close();\n\t\t}\n\t})();\n\n\treturn stream;\n};\n\n/**\n * `streamSimple` for Cursor: an explicit thinking selection (`options.thinkingSelection`)\n * is rendered into `RequestedModel.parameters`; reasoning output itself streams back as\n * `ThinkingContent` regardless of the selection.\n */\nexport const streamSimple: StreamFunction<\"cursor-agent\", SimpleStreamOptions> = (\n\tmodel: Model<\"cursor-agent\">,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): AssistantMessageEventStream => {\n\treturn stream(model, context, options as CursorAgentOptions);\n};\n\nexport type ToolCallState = ToolCall & {\n\t[kStreamingBlockIndex]: number;\n\t[kStreamingPartialJson]?: string;\n\t[kStreamingLastParseLen]?: number;\n\t[kStreamingBlockKind]: \"mcp\" | \"todo\" | \"cursor-exec\" | \"connect-scm\";\n\t[kStreamingEnvelopeId]?: string;\n\t[kCursorExecResolved]?: true;\n};\n\nexport interface BlockState {\n\tcurrentTextBlock: (TextContent & { [kStreamingBlockIndex]: number }) | null;\n\tcurrentThinkingBlock: (ThinkingContent & { [kStreamingBlockIndex]: number }) | null;\n\tcurrentToolCall: ToolCallState | null;\n\t/**\n\t * Open streamed tool-call blocks, keyed by the interaction envelope's\n\t * `call_id`. Cursor interleaves calls: two `toolCallStarted` frames can\n\t * arrive before either completes.\n\t */\n\topenToolCalls: Map<string, ToolCallState>;\n\t/** MCP call IDs synthesized from exec frames before their redundant streamed block arrives. */\n\tresolvedMcpToolCallIds: Set<string>;\n\tsetTextBlock: (b: (TextContent & { [kStreamingBlockIndex]: number }) | null) => void;\n\tsetThinkingBlock: (b: (ThinkingContent & { [kStreamingBlockIndex]: number }) | null) => void;\n\tsetToolCall: (t: ToolCallState | null) => void;\n\t/**\n\t * Persist a paired `toolResult` for a server-resolved call. Native todo\n\t * calls never travel the exec channel, so without this the resolved block\n\t * has no matching result and every transcript rebuild strips it as dangling.\n\t */\n\tonToolResult?: CursorToolResultHandler;\n}\n\nfunction markCursorExecResolved(block: CursorExecResolvedCarrier): void {\n\tblock[kCursorExecResolved] = true;\n}\n\nexport interface UsageState {\n\tsawTokenDelta: boolean;\n\tsawTurnEndedUsage: boolean;\n}\n\n/** Exported for tests: drives one Cursor server message through the stream (exec waits mark the stream busy). */\nexport async function handleServerMessage(\n\tmsg: AgentServerMessage,\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n\tblobStore: Map<string, Uint8Array>,\n\th2Request: http2.ClientHttp2Stream,\n\texecHandlers: CursorExecHandlers | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n\tusageState: UsageState,\n\trequestContextTools: McpToolDefinition[],\n\tonConversationCheckpoint?: (checkpoint: ConversationStateStructure) => void,\n): Promise<void> {\n\tconst msgCase = msg.message.case;\n\n\tlog(\"serverMessage\", msgCase);\n\n\tif (msgCase === \"interactionUpdate\") {\n\t\tprocessInteractionUpdate(msg.message.value, output, stream, state, usageState);\n\t} else if (msgCase === \"kvServerMessage\") {\n\t\thandleKvServerMessage(msg.message.value as KvServerMessage, blobStore, h2Request);\n\t} else if (msgCase === \"execServerMessage\") {\n\t\t// The server is waiting on OUR local tool result during this window — no\n\t\t// AssistantMessageEvent flows until the handler finishes. Mark the wait\n\t\t// as local work so idle watchdogs attribute the silence to the tool run\n\t\t// instead of aborting a healthy stream.\n\t\tawait stream.trackLocalWork(\n\t\t\thandleExecServerMessage(\n\t\t\t\tmsg.message.value as ExecServerMessage,\n\t\t\t\th2Request,\n\t\t\t\texecHandlers,\n\t\t\t\tonToolResult,\n\t\t\t\trequestContextTools,\n\t\t\t\toutput,\n\t\t\t\tstream,\n\t\t\t\tstate,\n\t\t\t),\n\t\t);\n\t} else if (msgCase === \"conversationCheckpointUpdate\") {\n\t\tapplyCheckpointTokenDetails(msg.message.value, output, usageState);\n\t\tonConversationCheckpoint?.(msg.message.value);\n\t}\n}\n\nfunction handleKvServerMessage(\n\tkvMsg: KvServerMessage,\n\tblobStore: Map<string, Uint8Array>,\n\th2Request: http2.ClientHttp2Stream,\n): void {\n\tconst kvCase = kvMsg.message.case;\n\n\tif (kvCase === \"getBlobArgs\") {\n\t\tconst blobId = kvMsg.message.value.blobId;\n\t\tconst blobIdKey = Buffer.from(blobId).toString(\"hex\");\n\t\tconst blobData = blobStore.get(blobIdKey);\n\t\tconst response = create(KvClientMessageSchema, {\n\t\t\tid: kvMsg.id,\n\t\t\tmessage: {\n\t\t\t\tcase: \"getBlobResult\",\n\t\t\t\tvalue: create(GetBlobResultSchema, blobData ? { blobData } : {}),\n\t\t\t},\n\t\t});\n\t\tconst kvClientMessage = create(AgentClientMessageSchema, {\n\t\t\tmessage: { case: \"kvClientMessage\", value: response },\n\t\t});\n\t\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, kvClientMessage)));\n\t\tlog(\"kvClient\", \"getBlobResult\", { blobId: blobIdKey.slice(0, 40) });\n\t} else if (kvCase === \"setBlobArgs\") {\n\t\tconst { blobId, blobData } = kvMsg.message.value;\n\t\tconst blobIdKey = Buffer.from(blobId).toString(\"hex\");\n\t\tblobStore.set(blobIdKey, blobData);\n\t\tconst response = create(KvClientMessageSchema, {\n\t\t\tid: kvMsg.id,\n\t\t\tmessage: {\n\t\t\t\tcase: \"setBlobResult\",\n\t\t\t\tvalue: create(SetBlobResultSchema, {}),\n\t\t\t},\n\t\t});\n\t\tconst kvClientMessage = create(AgentClientMessageSchema, {\n\t\t\tmessage: { case: \"kvClientMessage\", value: response },\n\t\t});\n\t\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, kvClientMessage)));\n\t\tlog(\"kvClient\", \"setBlobResult\", { blobId: blobIdKey.slice(0, 40) });\n\t}\n}\n\nfunction sendShellStreamEvent(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\tevent: ShellStream[\"event\"],\n): void {\n\tsendExecClientMessage(h2Request, execMsg, \"shellStream\", create(ShellStreamSchema, { event }));\n}\n\nfunction sanitizeShellExecResult(execResult: ShellResult): ShellResult {\n\tconst result = execResult.result;\n\tif (!result) return execResult;\n\n\tswitch (result.case) {\n\t\tcase \"success\":\n\t\tcase \"failure\": {\n\t\t\tconst value = result.value;\n\t\t\treturn {\n\t\t\t\t...execResult,\n\t\t\t\tresult: {\n\t\t\t\t\tcase: result.case,\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t...value,\n\t\t\t\t\t\tstdout: value.stdout ? sanitizeSurrogates(value.stdout) : value.stdout,\n\t\t\t\t\t\tstderr: value.stderr ? sanitizeSurrogates(value.stderr) : value.stderr,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} as ShellResult;\n\t\t}\n\t\tdefault:\n\t\t\treturn execResult;\n\t}\n}\n\nasync function handleShellStreamArgs(\n\targs: ShellArgs,\n\texecMsg: ExecServerMessage,\n\th2Request: http2.ClientHttp2Stream,\n\texecHandlers: CursorExecHandlers | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n): Promise<void> {\n\tconst normalizedWorkingDirectory = args.workingDirectory || process.cwd();\n\tconst normalizedArgs: ShellArgs = { ...args, workingDirectory: normalizedWorkingDirectory };\n\n\tsendShellStreamEvent(h2Request, execMsg, { case: \"start\", value: create(ShellStreamStartSchema, {}) });\n\n\t// Buffer for incomplete ANSI sequences across chunks.\n\tlet stdoutBuffer = \"\";\n\tlet stderrBuffer = \"\";\n\n\tconst incompleteEscapeRegex = /\\x1b(|\\[|\\[\\d*|\\[\\?|\\[\\?\\d*|\\]\\d*;?)$/;\n\n\tconst flushStdout = () => {\n\t\tif (stdoutBuffer) {\n\t\t\tlet safeEnd = stdoutBuffer.length;\n\t\t\tconst match = stdoutBuffer.match(incompleteEscapeRegex);\n\t\t\tif (match && match[0].length > 0) {\n\t\t\t\tsafeEnd = stdoutBuffer.length - match[0].length;\n\t\t\t}\n\t\t\tconst toSend = stdoutBuffer.slice(0, safeEnd);\n\t\t\tconst remaining = stdoutBuffer.slice(safeEnd);\n\t\t\tif (toSend) {\n\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\tcase: \"stdout\",\n\t\t\t\t\tvalue: create(ShellStreamStdoutSchema, { data: sanitizeSurrogates(toSend) }),\n\t\t\t\t});\n\t\t\t}\n\t\t\tstdoutBuffer = remaining;\n\t\t}\n\t};\n\n\tconst flushStderr = () => {\n\t\tif (stderrBuffer) {\n\t\t\tlet safeEnd = stderrBuffer.length;\n\t\t\tconst match = stderrBuffer.match(incompleteEscapeRegex);\n\t\t\tif (match && match[0].length > 0) {\n\t\t\t\tsafeEnd = stderrBuffer.length - match[0].length;\n\t\t\t}\n\t\t\tconst toSend = stderrBuffer.slice(0, safeEnd);\n\t\t\tconst remaining = stderrBuffer.slice(safeEnd);\n\t\t\tif (toSend) {\n\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\tcase: \"stderr\",\n\t\t\t\t\tvalue: create(ShellStreamStderrSchema, { data: sanitizeSurrogates(toSend) }),\n\t\t\t\t});\n\t\t\t}\n\t\t\tstderrBuffer = remaining;\n\t\t}\n\t};\n\n\tlet stdoutFlushTimer: NodeJS.Timeout | null = null;\n\tlet stderrFlushTimer: NodeJS.Timeout | null = null;\n\n\tconst scheduleStdoutFlush = () => {\n\t\tif (!stdoutFlushTimer) {\n\t\t\tstdoutFlushTimer = setTimeout(() => {\n\t\t\t\tstdoutFlushTimer = null;\n\t\t\t\tflushStdout();\n\t\t\t}, 100);\n\t\t}\n\t};\n\n\tconst scheduleStderrFlush = () => {\n\t\tif (!stderrFlushTimer) {\n\t\t\tstderrFlushTimer = setTimeout(() => {\n\t\t\t\tstderrFlushTimer = null;\n\t\t\t\tflushStderr();\n\t\t\t}, 100);\n\t\t}\n\t};\n\n\tconst streamCallbacks: CursorShellStreamCallbacks = {\n\t\tonStdout(data: string) {\n\t\t\tstdoutBuffer += data;\n\t\t\tif (stdoutBuffer.includes(\"\\n\") || stdoutBuffer.length > 4096) {\n\t\t\t\tif (stdoutFlushTimer) {\n\t\t\t\t\tclearTimeout(stdoutFlushTimer);\n\t\t\t\t\tstdoutFlushTimer = null;\n\t\t\t\t}\n\t\t\t\tflushStdout();\n\t\t\t} else {\n\t\t\t\tscheduleStdoutFlush();\n\t\t\t}\n\t\t},\n\t\tonStderr(data: string) {\n\t\t\tstderrBuffer += data;\n\t\t\tif (stderrBuffer.includes(\"\\n\") || stderrBuffer.length > 4096) {\n\t\t\t\tif (stderrFlushTimer) {\n\t\t\t\t\tclearTimeout(stderrFlushTimer);\n\t\t\t\t\tstderrFlushTimer = null;\n\t\t\t\t}\n\t\t\t\tflushStderr();\n\t\t\t} else {\n\t\t\t\tscheduleStderrFlush();\n\t\t\t}\n\t\t},\n\t};\n\n\t// Prefer the streaming handler — it forwards output chunks in real time.\n\tconst streamHandler = execHandlers?.shellStream?.bind(execHandlers);\n\tconst batchHandler = execHandlers?.shell?.bind(execHandlers);\n\tconst handler = streamHandler ? (shellArgs: ShellArgs) => streamHandler(shellArgs, streamCallbacks) : batchHandler;\n\n\tconst { execResult } = await resolveExecHandler(\n\t\tnormalizedArgs,\n\t\thandler as typeof batchHandler,\n\t\tonToolResult,\n\t\t(toolResult) => buildShellResultFromToolResult(normalizedArgs, toolResult),\n\t\t(reason) => buildShellRejectedResult(normalizedArgs.command, normalizedArgs.workingDirectory, reason),\n\t\t(error) => buildShellFailureResult(normalizedArgs.command, normalizedArgs.workingDirectory, error),\n\t\t{ toolCallId: args.toolCallId, toolName: \"bash\" },\n\t);\n\n\t// When using the batch handler (no shellStream), send buffered stdout/stderr\n\t// after execution completes. With shellStream these were already sent live.\n\tconst sendBufferedOutput = !streamHandler;\n\tconst sanitizedExecResult = sanitizeShellExecResult(execResult);\n\n\tif (stdoutFlushTimer) clearTimeout(stdoutFlushTimer);\n\tif (stderrFlushTimer) clearTimeout(stderrFlushTimer);\n\tflushStdout();\n\tflushStderr();\n\n\tsendShellStreamExitFromResult(h2Request, execMsg, sanitizedExecResult, sendBufferedOutput);\n\t// Cursor can keep the turn pending when it receives only stream deltas.\n\t// Send the final structured shellResult as completion acknowledgement.\n\tsendExecClientMessage(h2Request, execMsg, \"shellResult\", sanitizedExecResult);\n}\n\nfunction sendShellStreamExitFromResult(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\texecResult: ShellResult,\n\tsendBufferedOutput: boolean,\n): void {\n\tconst result = execResult.result;\n\tswitch (result.case) {\n\t\tcase \"success\": {\n\t\t\tconst value = result.value;\n\t\t\tif (sendBufferedOutput) {\n\t\t\t\tif (value.stdout) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stdout\",\n\t\t\t\t\t\tvalue: create(ShellStreamStdoutSchema, { data: sanitizeSurrogates(value.stdout) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (value.stderr) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stderr\",\n\t\t\t\t\t\tvalue: create(ShellStreamStderrSchema, { data: sanitizeSurrogates(value.stderr) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: value.exitCode,\n\t\t\t\t\tcwd: value.workingDirectory,\n\t\t\t\t\taborted: false,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"failure\": {\n\t\t\tconst value = result.value;\n\t\t\tif (sendBufferedOutput) {\n\t\t\t\tif (value.stdout) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stdout\",\n\t\t\t\t\t\tvalue: create(ShellStreamStdoutSchema, { data: sanitizeSurrogates(value.stdout) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (value.stderr) {\n\t\t\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\t\t\tcase: \"stderr\",\n\t\t\t\t\t\tvalue: create(ShellStreamStderrSchema, { data: sanitizeSurrogates(value.stderr) }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: value.exitCode,\n\t\t\t\t\tcwd: value.workingDirectory,\n\t\t\t\t\taborted: value.aborted,\n\t\t\t\t\tabortReason: value.abortReason,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"rejected\": {\n\t\t\tsendShellStreamEvent(h2Request, execMsg, { case: \"rejected\", value: result.value });\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: 1,\n\t\t\t\t\tcwd: result.value.workingDirectory,\n\t\t\t\t\taborted: false,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"timeout\": {\n\t\t\tconst value = result.value;\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"stderr\",\n\t\t\t\tvalue: create(ShellStreamStderrSchema, {\n\t\t\t\t\tdata: `Command timed out after ${value.timeoutMs}ms`,\n\t\t\t\t}),\n\t\t\t});\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: 1,\n\t\t\t\t\tcwd: value.workingDirectory,\n\t\t\t\t\taborted: true,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcase \"permissionDenied\": {\n\t\t\tsendShellStreamEvent(h2Request, execMsg, { case: \"permissionDenied\", value: result.value });\n\t\t\tsendShellStreamEvent(h2Request, execMsg, {\n\t\t\t\tcase: \"exit\",\n\t\t\t\tvalue: create(ShellStreamExitSchema, {\n\t\t\t\t\tcode: 1,\n\t\t\t\t\tcwd: result.value.workingDirectory,\n\t\t\t\t\taborted: false,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tdefault:\n\t\t\treturn;\n\t}\n}\n\ntype ExecDispatchContext = {\n\treadonly execMsg: ExecServerMessage;\n\treadonly h2Request: http2.ClientHttp2Stream;\n\treadonly execHandlers: CursorExecHandlers | undefined;\n\treadonly onToolResult: CursorToolResultHandler | undefined;\n\treadonly requestContextTools: McpToolDefinition[];\n\treadonly output: AssistantMessage;\n\treadonly stream: AssistantMessageEventStream;\n\treadonly state: BlockState;\n};\n\nasync function handleExecServerMessage(\n\texecMsg: ExecServerMessage,\n\th2Request: http2.ClientHttp2Stream,\n\texecHandlers: CursorExecHandlers | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n\trequestContextTools: McpToolDefinition[],\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n): Promise<void> {\n\tconst execCase = execMsg.message.case;\n\tlog(\"exec\", \"dispatch\", { execCase, execId: execMsg.execId, hasHandlers: !!execHandlers });\n\tif (!execCase) {\n\t\t// A frame carrying a oneof number this build's `agent.proto` does not\n\t\t// model at all. Returning silently strands the exec id — the server\n\t\t// waits on a reply that never comes.\n\t\tlog(\"warn\", \"unknownExecVariant\", { id: execMsg.id, execId: execMsg.execId });\n\t\tsendExecClientThrow(h2Request, execMsg, \"Unknown exec message variant\", \"unknown_exec_variant\");\n\t\tsendExecClientStreamClose(h2Request, execMsg);\n\t\treturn;\n\t}\n\n\tconst stopExecHeartbeat = armCursorExecHeartbeat(h2Request, execMsg);\n\ttry {\n\t\tawait dispatchExecServerMessage({\n\t\t\texecMsg,\n\t\t\th2Request,\n\t\t\texecHandlers,\n\t\t\tonToolResult,\n\t\t\trequestContextTools,\n\t\t\toutput,\n\t\t\tstream,\n\t\t\tstate,\n\t\t});\n\t} catch (error) {\n\t\tlog(\"error\", \"execDispatch\", {\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\tid: execMsg.id,\n\t\t\texecId: execMsg.execId,\n\t\t});\n\t\tsendExecClientThrow(h2Request, execMsg, \"Local exec dispatch failed\", \"exec_dispatch_failed\");\n\t} finally {\n\t\tstopExecHeartbeat();\n\t\tsendExecClientStreamClose(h2Request, execMsg);\n\t}\n}\n\nasync function dispatchExecServerMessage(context: ExecDispatchContext): Promise<void> {\n\tconst { execMsg, h2Request, execHandlers, onToolResult, requestContextTools, output, stream, state } = context;\n\tconst execCase = execMsg.message.case;\n\tif (!execCase) throw new Error(\"Expected a recognized exec message\");\n\tif (execCase === \"requestContextArgs\") {\n\t\tconst requestContext = create(RequestContextSchema, {\n\t\t\trules: [],\n\t\t\trepositoryInfo: [],\n\t\t\ttools: requestContextTools,\n\t\t\tgitRepos: [],\n\t\t\tprojectLayouts: [],\n\t\t\tmcpInstructions: [],\n\t\t\tfileContents: {},\n\t\t\tcustomSubagents: [],\n\t\t});\n\n\t\tconst requestContextResult = create(RequestContextResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"success\",\n\t\t\t\tvalue: create(RequestContextSuccessSchema, { requestContext }),\n\t\t\t},\n\t\t});\n\n\t\tsendExecClientMessage(h2Request, execMsg, \"requestContextResult\", requestContextResult);\n\t\treturn;\n\t}\n\n\tswitch (execCase) {\n\t\tcase \"readArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"read\", {\n\t\t\t\tpath: args.path,\n\t\t\t\toffset: args.offset,\n\t\t\t\tlimit: args.limit,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.read?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) =>\n\t\t\t\t\tbuildReadResultFromToolResult(\n\t\t\t\t\t\targs.path,\n\t\t\t\t\t\ttoolResult,\n\t\t\t\t\t\targs.offset !== undefined || args.limit !== undefined,\n\t\t\t\t\t),\n\t\t\t\t(reason) => buildReadRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildReadErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"read\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"readResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"lsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\t// The bridge maps `ls` onto the local `ls` tool; mirror that here so\n\t\t\t// the synthesized block matches the toolResult's `toolName`.\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"ls\", { path: piLsPath(args.path) });\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.ls?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildLsResultFromToolResult(args.path, toolResult),\n\t\t\t\t(reason) => buildLsRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildLsErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"ls\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"lsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"grepArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\t// Cursor's model sometimes emits `grepArgs` with an empty `pattern`\n\t\t\t// and a non-empty `glob`, expecting grep to list files matching the\n\t\t\t// glob. Reject that up front with an actionable error.\n\t\t\tconst emptyPatternError = emptyGrepPatternRejection(args.pattern, args.glob);\n\t\t\tif (emptyPatternError !== null) {\n\t\t\t\tsendExecClientMessage(h2Request, execMsg, \"grepResult\", buildGrepErrorResult(emptyPatternError));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Mirror the coding-agent bridge's arg mapping so live UI (from\n\t\t\t// `tool_execution_start`) and rebuilt transcript display identical args.\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"grep\", {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || undefined,\n\t\t\t\tglob: args.glob || undefined,\n\t\t\t\tignoreCase: args.caseInsensitive === true ? true : undefined,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.grep?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildGrepResultFromToolResult(args, toolResult),\n\t\t\t\t(reason) => buildGrepErrorResult(reason),\n\t\t\t\t(error) => buildGrepErrorResult(error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"grep\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"grepResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"writeArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\t// Match the bridge: prefer `fileText`, fall back to decoded `fileBytes`.\n\t\t\tconst content = args.fileText ?? new TextDecoder().decode(args.fileBytes ?? new Uint8Array());\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"write\", {\n\t\t\t\tpath: args.path,\n\t\t\t\tcontent,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.write?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) =>\n\t\t\t\t\tbuildWriteResultFromToolResult(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\t\tfileText: args.fileText,\n\t\t\t\t\t\t\tfileBytes: args.fileBytes,\n\t\t\t\t\t\t\treturnFileContentAfterWrite: args.returnFileContentAfterWrite,\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoolResult,\n\t\t\t\t\t),\n\t\t\t\t(reason) => buildWriteRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildWriteErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"write\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"writeResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"deleteArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"delete\", { path: args.path });\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.delete?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildDeleteResultFromToolResult(args.path, toolResult),\n\t\t\t\t(reason) => buildDeleteRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildDeleteErrorResult(args.path, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"delete\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"deleteResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"shellArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst normalizedArgs: ShellArgs = { ...args, workingDirectory: args.workingDirectory || process.cwd() };\n\t\t\tconst shellTimeout = args.timeout && args.timeout > 0 ? args.timeout : undefined;\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"bash\", {\n\t\t\t\tcommand: composeShellCommand(args.command, args.workingDirectory || undefined),\n\t\t\t\ttimeout: shellTimeout,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\tnormalizedArgs,\n\t\t\t\texecHandlers?.shell?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildShellResultFromToolResult(normalizedArgs, toolResult),\n\t\t\t\t(reason) => buildShellRejectedResult(normalizedArgs.command, normalizedArgs.workingDirectory, reason),\n\t\t\t\t(error) => buildShellFailureResult(normalizedArgs.command, normalizedArgs.workingDirectory, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"bash\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"shellResult\", sanitizeShellExecResult(execResult));\n\t\t\treturn;\n\t\t}\n\t\tcase \"shellStreamArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst shellStreamTimeout = args.timeout && args.timeout > 0 ? args.timeout : undefined;\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"bash\", {\n\t\t\t\tcommand: composeShellCommand(args.command, args.workingDirectory || undefined),\n\t\t\t\ttimeout: shellStreamTimeout,\n\t\t\t});\n\t\t\tawait handleShellStreamArgs(args, execMsg, h2Request, execHandlers, onToolResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"backgroundShellSpawnArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(BackgroundShellSpawnResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"rejected\",\n\t\t\t\t\tvalue: create(ShellRejectedSchema, {\n\t\t\t\t\t\tcommand: args.command,\n\t\t\t\t\t\tworkingDirectory: args.workingDirectory,\n\t\t\t\t\t\treason: \"Not implemented\",\n\t\t\t\t\t\tisReadonly: false,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"backgroundShellSpawnResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"writeShellStdinArgs\": {\n\t\t\tconst execResult = create(WriteShellStdinResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(WriteShellStdinErrorSchema, {\n\t\t\t\t\t\terror: \"Not implemented\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"writeShellStdinResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"fetchArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(FetchResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(FetchErrorSchema, {\n\t\t\t\t\t\turl: args.url,\n\t\t\t\t\t\terror: \"Not implemented\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"fetchResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"diagnosticsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\targs,\n\t\t\t\texecHandlers?.diagnostics?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildDiagnosticsResultFromToolResult(args.path, toolResult),\n\t\t\t\t(reason) => buildDiagnosticsRejectedResult(args.path, reason),\n\t\t\t\t(error) => buildDiagnosticsErrorResult(args.path, error),\n\t\t\t\t// senpi has no local diagnostics tool; the frame is answered with a\n\t\t\t\t// refusal and no block is synthesized (nothing ran).\n\t\t\t\tnull,\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"diagnosticsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"mcpArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst mcpCall = decodeMcpCall(args);\n\t\t\t// An approval probe, not an invocation: the frame asks whether the\n\t\t\t// call would be permitted. Only a definite allow is approved; without\n\t\t\t// a handler there is nothing to decide with, so it is refused. Either\n\t\t\t// way no block is synthesized — nothing ran.\n\t\t\tif (mcpCall.approvalOnly) {\n\t\t\t\tconst approved = (await execHandlers?.mcpApprovalPreflight?.(mcpCall)) === true;\n\t\t\t\tsendExecClientMessage(\n\t\t\t\t\th2Request,\n\t\t\t\t\texecMsg,\n\t\t\t\t\t\"mcpResult\",\n\t\t\t\t\tcreate(McpResultSchema, {\n\t\t\t\t\t\tresult: approved\n\t\t\t\t\t\t\t? { case: \"approved\", value: create(McpApprovedSchema, {}) }\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tcase: \"rejected\",\n\t\t\t\t\t\t\t\t\tvalue: create(McpRejectedSchema, {\n\t\t\t\t\t\t\t\t\t\treason: `Tool \"${mcpCall.toolName || mcpCall.name}\" is not approved to run without asking.`,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (execHandlers?.mcp) {\n\t\t\t\tconst existingBlock = output.content.find(\n\t\t\t\t\t(block) => block.type === \"toolCall\" && block.id === mcpCall.toolCallId,\n\t\t\t\t);\n\t\t\t\tif (existingBlock) {\n\t\t\t\t\tmarkCursorExecResolved(existingBlock);\n\t\t\t\t} else {\n\t\t\t\t\tsynthesizeCursorExecToolCall(\n\t\t\t\t\t\toutput,\n\t\t\t\t\t\tstream,\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\tmcpCall.toolCallId,\n\t\t\t\t\t\tmcpCall.toolName || mcpCall.name,\n\t\t\t\t\t\tmcpCall.args,\n\t\t\t\t\t);\n\t\t\t\t\tstate.resolvedMcpToolCallIds.add(mcpCall.toolCallId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\tmcpCall,\n\t\t\t\texecHandlers?.mcp?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildMcpResultFromToolResult(mcpCall, toolResult),\n\t\t\t\t(_reason) => buildMcpToolNotFoundResult(mcpCall),\n\t\t\t\t(error) => buildMcpErrorResult(error),\n\t\t\t\texecHandlers?.mcp ? { toolCallId: mcpCall.toolCallId, toolName: mcpCall.toolName } : null,\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"mcpResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"listMcpResourcesExecArgs\": {\n\t\t\t// This client hosts no MCP resources; the honest answer is an explicit\n\t\t\t// empty success. An unset-oneof result would read as \"the call\n\t\t\t// produced nothing\".\n\t\t\tconst execResult = create(ListMcpResourcesExecResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"success\",\n\t\t\t\t\tvalue: create(ListMcpResourcesSuccessSchema, { resources: [] }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"listMcpResourcesExecResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"readMcpResourceExecArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(ReadMcpResourceExecResultSchema, {\n\t\t\t\tresult: { case: \"notFound\", value: create(ReadMcpResourceNotFoundSchema, { uri: args.uri }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"readMcpResourceExecResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"recordScreenArgs\": {\n\t\t\tconst execResult = create(RecordScreenResultSchema, {\n\t\t\t\tresult: { case: \"failure\", value: create(RecordScreenFailureSchema, { error: NOT_IMPLEMENTED }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"recordScreenResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"computerUseArgs\": {\n\t\t\tconst execResult = create(ComputerUseResultSchema, {\n\t\t\t\tresult: { case: \"error\", value: create(ComputerUseErrorSchema, { error: NOT_IMPLEMENTED }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"computerUseResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piReadArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tconst readArgs = piReadArgs(args.path, args.offset, args.limit);\n\t\t\tsynthesizeCursorExecToolCall(\n\t\t\t\toutput,\n\t\t\t\tstream,\n\t\t\t\tstate,\n\t\t\t\ttoolCallId,\n\t\t\t\t\"read\",\n\t\t\t\treadArgs ?? { path: args.path, offset: args.offset, limit: 0 },\n\t\t\t);\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piRead?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiReadResult,\n\t\t\t\tbuildPiReadError,\n\t\t\t\tbuildPiReadError,\n\t\t\t\t{ toolCallId, toolName: \"read\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piReadResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piBashArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"bash\", {\n\t\t\t\tcommand: args.command,\n\t\t\t\ttimeout: piTimeout(args.timeout),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piBash?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiBashResult,\n\t\t\t\tbuildPiBashError,\n\t\t\t\tbuildPiBashError,\n\t\t\t\t{ toolCallId, toolName: \"bash\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piBashResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piEditArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\t// `PiEditReplacement[]` maps 1:1 onto the local `edit` tool's\n\t\t\t// `edits[{oldText,newText}]` shape.\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"edit\", {\n\t\t\t\tpath: args.path,\n\t\t\t\tedits: args.edits.map((edit) => ({ oldText: edit.oldText, newText: edit.newText })),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piEdit?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiEditResult,\n\t\t\t\tbuildPiEditRejected,\n\t\t\t\tbuildPiEditError,\n\t\t\t\t{ toolCallId, toolName: \"edit\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piEditResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piWriteArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"write\", {\n\t\t\t\tpath: args.path,\n\t\t\t\tcontent: args.content,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piWrite?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiWriteResult,\n\t\t\t\tbuildPiWriteRejected,\n\t\t\t\tbuildPiWriteError,\n\t\t\t\t{ toolCallId, toolName: \"write\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piWriteResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piGrepArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"grep\", {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || undefined,\n\t\t\t\tglob: args.glob || undefined,\n\t\t\t\tignoreCase: args.ignoreCase === true ? true : undefined,\n\t\t\t\tliteral: args.literal === true ? true : undefined,\n\t\t\t\tcontext: args.context,\n\t\t\t\tlimit: piLimit(args.limit),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piGrep?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiGrepResult,\n\t\t\t\tbuildPiGrepError,\n\t\t\t\tbuildPiGrepError,\n\t\t\t\t{ toolCallId, toolName: \"grep\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piGrepResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piFindArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"find\", {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || undefined,\n\t\t\t\tlimit: piLimit(args.limit),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piFind?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiFindResult,\n\t\t\t\tbuildPiFindError,\n\t\t\t\tbuildPiFindError,\n\t\t\t\t{ toolCallId, toolName: \"find\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piFindResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"piLsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = randomUUID();\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"ls\", {\n\t\t\t\tpath: piLsPath(args.path),\n\t\t\t\tlimit: piLimit(args.limit),\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\t{ args, toolCallId },\n\t\t\t\texecHandlers?.piLs?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\tbuildPiLsResult,\n\t\t\t\tbuildPiLsError,\n\t\t\t\tbuildPiLsError,\n\t\t\t\t{ toolCallId, toolName: \"ls\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"piLsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"miniSweAgentBashArgs\": {\n\t\t\t// Same `ShellArgs`/`ShellResult` pair as `shellArgs`, under its own\n\t\t\t// frame number, so the existing shell handler answers it unchanged.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tif (!args.toolCallId) args.toolCallId = randomUUID();\n\t\t\tconst normalizedArgs: ShellArgs = { ...args, workingDirectory: args.workingDirectory || process.cwd() };\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, args.toolCallId, \"bash\", {\n\t\t\t\tcommand: composeShellCommand(args.command, args.workingDirectory || undefined),\n\t\t\t\ttimeout: args.timeout && args.timeout > 0 ? args.timeout : undefined,\n\t\t\t});\n\t\t\tconst { execResult } = await resolveExecHandler(\n\t\t\t\tnormalizedArgs,\n\t\t\t\texecHandlers?.shell?.bind(execHandlers),\n\t\t\t\tonToolResult,\n\t\t\t\t(toolResult) => buildShellResultFromToolResult(normalizedArgs, toolResult),\n\t\t\t\t(reason) => buildShellRejectedResult(normalizedArgs.command, normalizedArgs.workingDirectory, reason),\n\t\t\t\t(error) => buildShellFailureResult(normalizedArgs.command, normalizedArgs.workingDirectory, error),\n\t\t\t\t{ toolCallId: args.toolCallId, toolName: \"bash\" },\n\t\t\t);\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"miniSweAgentBashResult\", sanitizeShellExecResult(execResult));\n\t\t\treturn;\n\t\t}\n\t\tcase \"redactedReadArgs\": {\n\t\t\t// The server expects the client to strip secrets from the content\n\t\t\t// first. No redaction is implemented here, and serving a plain read\n\t\t\t// would hand back exactly the unredacted bytes the frame exists to\n\t\t\t// withhold.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"redactedReadResult\",\n\t\t\t\tbuildReadErrorResult(args.path, \"Secret redaction is not implemented by this client\"),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"mcpStateExecArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"mcpStateExecResult\",\n\t\t\t\tbuildMcpStateResult(requestContextTools, args.serverIdentifiers),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"executeHookArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = buildNeutralHookResult(args.request);\n\t\t\tif (!execResult) {\n\t\t\t\tsendExecClientThrow(\n\t\t\t\t\th2Request,\n\t\t\t\t\texecMsg,\n\t\t\t\t\t`Unsupported hook request: ${args.request?.request.case ?? \"unset\"}`,\n\t\t\t\t\t\"unknown_hook_request\",\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"executeHookResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"subagentArgs\": {\n\t\t\tconst execResult = create(SubagentResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(SubagentErrorSchema, { error: `Subagents are ${NOT_IMPLEMENTED_SUFFIX}` }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"subagentResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"subagentAwaitArgs\": {\n\t\t\t// No subagent was ever spawned, so every awaited id is genuinely unknown.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(SubagentAwaitResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"notFound\",\n\t\t\t\t\tvalue: create(SubagentAwaitNotFoundSchema, { agentId: args.agentId }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"subagentAwaitResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"forceBackgroundShellArgs\": {\n\t\t\t// Backgrounding targets a running tool call by id. This client runs\n\t\t\t// every shell to completion in band, so there is never one to move.\n\t\t\tconst execResult = create(ForceBackgroundShellResultSchema, {\n\t\t\t\tstatus: ForceBackgroundShellStatus.NOT_FOUND,\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"forceBackgroundShellResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"forceBackgroundSubagentArgs\": {\n\t\t\tconst execResult = create(ForceBackgroundSubagentResultSchema, {\n\t\t\t\tstatus: ForceBackgroundSubagentStatus.NOT_FOUND,\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"forceBackgroundSubagentResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"smartModeClassifierArgs\": {\n\t\t\t// The classifier decides whether a risky action needs approval.\n\t\t\t// Answering `ALLOW` would silently wave through actions the server\n\t\t\t// asked us to judge, so the honest answer is that no classifier\n\t\t\t// exists here.\n\t\t\tconst execResult = create(SmartModeClassifierResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(SmartModeClassifierErrorSchema, {\n\t\t\t\t\t\terror: `Smart-mode classification is ${NOT_IMPLEMENTED_SUFFIX}`,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"smartModeClassifierResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"canvasDiagnosticsArgs\": {\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst execResult = create(CanvasDiagnosticsResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(CanvasDiagnosticsErrorSchema, {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\terror: `Canvas diagnostics are ${NOT_IMPLEMENTED_SUFFIX}`,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"canvasDiagnosticsResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"shellAllowlistPrecheckArgs\": {\n\t\t\t// The prechecks ask \"is this pre-approved, so may it skip the approval\n\t\t\t// prompt?\". This client keeps no allowlist, so the answer is always\n\t\t\t// no: `false` costs an approval round-trip, `true` would grant one\n\t\t\t// that was never configured.\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"shellAllowlistPrecheckResult\",\n\t\t\t\tcreate(ShellAllowlistPrecheckResultSchema, { allowlisted: false }),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"mcpAllowlistPrecheckArgs\": {\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"mcpAllowlistPrecheckResult\",\n\t\t\t\tcreate(McpAllowlistPrecheckResultSchema, { allowlisted: false }),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"webFetchAllowlistPrecheckArgs\": {\n\t\t\tsendExecClientMessage(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t\"webFetchAllowlistPrecheckResult\",\n\t\t\t\tcreate(WebFetchAllowlistPrecheckResultSchema, { allowlisted: false }),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tcase \"conversationSearchArgs\": {\n\t\t\t// Cursor conversation history lives server-side; this client keeps no\n\t\t\t// local index of it to search. The streamed envelope announces this\n\t\t\t// call but the interaction decoder builds no block for it, so the\n\t\t\t// block and its paired result are synthesized here.\n\t\t\tconst args = execMsg.message.value;\n\t\t\tconst toolCallId = args.toolCallId || randomUUID();\n\t\t\tconst error = `Conversation search is ${NOT_IMPLEMENTED_SUFFIX}`;\n\t\t\tsynthesizeCursorExecToolCall(output, stream, state, toolCallId, \"search_conversations\", {\n\t\t\t\tquery: args.query,\n\t\t\t\tlimit: args.limit,\n\t\t\t});\n\t\t\tawait pairSynthesizedExecResult(state, onToolResult, toolCallId, \"search_conversations\", error);\n\t\t\tconst execResult = create(ConversationSearchResultSchema, {\n\t\t\t\tresult: { case: \"error\", value: create(ConversationSearchErrorSchema, { error }) },\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"conversationSearchResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"agentStoreConflictArgs\": {\n\t\t\t// The agent store is Cursor's own on-disk journal; this client never\n\t\t\t// writes one, so it has no conflict events to replay.\n\t\t\tconst execResult = create(AgentStoreConflictResultSchema, {\n\t\t\t\tresult: {\n\t\t\t\t\tcase: \"error\",\n\t\t\t\t\tvalue: create(AgentStoreConflictErrorSchema, {\n\t\t\t\t\t\terror: `Agent store conflicts are ${NOT_IMPLEMENTED_SUFFIX}`,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t\tsendExecClientMessage(h2Request, execMsg, \"agentStoreConflictResult\", execResult);\n\t\t\treturn;\n\t\t}\n\t\tcase \"gitDiffRequest\": {\n\t\t\t// `GetDiffResponse` has no error variant, so any in-band answer is a\n\t\t\t// claim that a diff was computed; a `throw` is the only truthful reply.\n\t\t\tsendExecClientThrow(h2Request, execMsg, `Git diff is ${NOT_IMPLEMENTED_SUFFIX}`, \"exec_variant_unsupported\");\n\t\t\treturn;\n\t\t}\n\t\tdefault: {\n\t\t\t// A frame number this build recognises structurally but has no answer\n\t\t\t// for. Distinct from the unset-case path above: there the client\n\t\t\t// cannot even name the frame.\n\t\t\tlog(\"warn\", \"unhandledExecMessage\", { execCase });\n\t\t\tsendExecClientThrow(\n\t\t\t\th2Request,\n\t\t\t\texecMsg,\n\t\t\t\t`No handler for exec message of type ${execCase}`,\n\t\t\t\t\"exec_variant_unsupported\",\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction armCursorExecHeartbeat(h2Request: http2.ClientHttp2Stream, execMsg: ExecServerMessage): () => void {\n\treturn armExecHeartbeat({\n\t\tintervalMs: EXEC_HEARTBEAT_INTERVAL_MS,\n\t\tisClosed: () => h2Request.closed,\n\t\twriteHeartbeat: (onComplete) => {\n\t\t\tconst controlMessage = create(ExecClientControlMessageSchema, {\n\t\t\t\tmessage: {\n\t\t\t\t\tcase: \"heartbeat\",\n\t\t\t\t\tvalue: create(ExecClientHeartbeatSchema, { id: execMsg.id }),\n\t\t\t\t},\n\t\t\t});\n\t\t\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\t\t\tmessage: { case: \"execClientControlMessage\", value: controlMessage },\n\t\t\t});\n\t\t\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)), onComplete);\n\t\t\tlog(\"execClientControl\", \"heartbeat\", { id: execMsg.id, execId: execMsg.execId });\n\t\t},\n\t});\n}\n\n/**\n * Send one typed answer on the exec channel.\n *\n * `ExecClientMessage[\"message\"]` is a discriminated union pairing each case\n * with its own result type, so the generic is keyed on the case: passing a\n * `ReadResult` under `\"shellResult\"` is a compile error rather than a wire\n * message the server rejects at runtime.\n */\nfunction sendExecClientMessage<TCase extends NonNullable<ExecClientMessage[\"message\"][\"case\"]>>(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\tmessageCase: TCase,\n\tvalue: Extract<ExecClientMessage[\"message\"], { case: TCase }>[\"value\"],\n): void {\n\tconst execClientMessage = create(ExecClientMessageSchema, {\n\t\tid: execMsg.id,\n\t\texecId: execMsg.execId,\n\t\tmessage: { case: messageCase, value } as ExecClientMessage[\"message\"],\n\t});\n\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"execClientMessage\", value: execClientMessage },\n\t});\n\n\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)));\n\n\tlog(\"execClientMessage\", messageCase);\n}\n\n/**\n * Fail one exec frame in band.\n *\n * `ExecClientThrow` is the protocol's failure channel for a frame that cannot\n * be answered at all — as opposed to a frame answered with its own typed\n * error variant, which means \"the tool ran and failed\". The server surfaces\n * the error to the model instead of blocking on a reply that never comes.\n */\nfunction sendExecClientThrow(\n\th2Request: http2.ClientHttp2Stream,\n\texecMsg: ExecServerMessage,\n\terror: string,\n\terrorCode?: string,\n): void {\n\tconst controlMessage = create(ExecClientControlMessageSchema, {\n\t\tmessage: {\n\t\t\tcase: \"throw\",\n\t\t\tvalue: create(ExecClientThrowSchema, { id: execMsg.id, error, errorCode }),\n\t\t},\n\t});\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"execClientControlMessage\", value: controlMessage },\n\t});\n\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)));\n\tlog(\"execClientControl\", \"throw\", { id: execMsg.id, execId: execMsg.execId, error, errorCode });\n}\n\nfunction sendExecClientStreamClose(h2Request: http2.ClientHttp2Stream, execMsg: ExecServerMessage): void {\n\tconst closeMessage = create(ExecClientControlMessageSchema, {\n\t\tmessage: {\n\t\t\tcase: \"streamClose\",\n\t\t\tvalue: create(ExecClientStreamCloseSchema, {\n\t\t\t\tid: execMsg.id,\n\t\t\t}),\n\t\t},\n\t});\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"execClientControlMessage\", value: closeMessage },\n\t});\n\th2Request.write(frameConnectMessage(toBinary(AgentClientMessageSchema, clientMessage)));\n\tlog(\"execClientControl\", \"streamClose\", { id: execMsg.id, execId: execMsg.execId });\n}\n\n/**\n * Exported for tests: dispatches one exec frame onto its handler.\n *\n * Every exit pairs a `toolResult`. The synthesized block was already marked\n * `kCursorExecResolved` before this runs, so the agent loop emits no\n * placeholder for it: a path that returns without a result leaves the call\n * unpaired and transcript rebuilds strip the whole interaction. The three\n * result-less paths — no handler installed, a handler that produced nothing,\n * and a thrown handler — therefore synthesize one from the same text the\n * server sees in `execResult`.\n *\n * `pairing` is required so a new callsite cannot silently recreate the\n * orphan, and nullable for the callers whose block is NOT pre-resolved (MCP\n * without an `mcp` handler, which the agent loop runs locally and pairs\n * itself, and frames that never synthesize a block).\n */\nexport async function resolveExecHandler<TArgs, TResult>(\n\targs: TArgs,\n\thandler: ((args: TArgs) => Promise<CursorExecHandlerResult<TResult>>) | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n\tbuildFromToolResult: (toolResult: ToolResultMessage) => TResult,\n\tbuildRejected: (reason: string) => TResult,\n\tbuildError: (error: string) => TResult,\n\tpairing: CursorExecPairing | null,\n): Promise<{ execResult: TResult; toolResult?: ToolResultMessage }> {\n\tconst pair = async (text: string, isError: boolean): Promise<ToolResultMessage | undefined> => {\n\t\tif (!pairing) return undefined;\n\t\tconst synthesized: ToolResultMessage = {\n\t\t\trole: \"toolResult\",\n\t\t\ttoolCallId: pairing.toolCallId,\n\t\t\ttoolName: pairing.toolName,\n\t\t\tcontent: [{ type: \"text\", text }],\n\t\t\tisError,\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\t\treturn await applyToolResultHandler(synthesized, onToolResult);\n\t};\n\n\tif (!handler) {\n\t\tconst reason = \"Tool not available\";\n\t\treturn { execResult: buildRejected(reason), toolResult: await pair(reason, true) };\n\t}\n\n\ttry {\n\t\tconst handlerResult = await handler(args);\n\t\tconst { execResult, toolResult } = splitExecHandlerResult(handlerResult);\n\t\tconst finalToolResult = await applyToolResultHandler(toolResult, onToolResult);\n\n\t\tif (execResult) {\n\t\t\t// TResult-only is a supported return form, so the transcript entry\n\t\t\t// has to be synthesized here, derived from the raw result so the two\n\t\t\t// views stay consistent.\n\t\t\treturn {\n\t\t\t\texecResult,\n\t\t\t\ttoolResult: finalToolResult ?? (await pair(...describeExecResult(execResult))),\n\t\t\t};\n\t\t}\n\t\tif (finalToolResult) {\n\t\t\treturn { execResult: buildFromToolResult(finalToolResult), toolResult: finalToolResult };\n\t\t}\n\t\tconst reason = \"Tool returned no result\";\n\t\treturn { execResult: buildRejected(reason), toolResult: await pair(reason, true) };\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\treturn { execResult: buildError(message), toolResult: await pair(message, true) };\n\t}\n}\n\n/**\n * Derive the transcript state of an exec result the handler returned in the\n * TResult-only form, which carries no `toolResult` to copy it from.\n *\n * Every exec result in `agent.proto` is a `oneof result` whose success\n * variant is named `success` — the rest are failures. MCP is the one shape\n * where `success` is not enough: `McpSuccess.is_error` carries an\n * application-level tool failure inside the success variant.\n */\nfunction describeExecResult(execResult: unknown): [text: string, isError: boolean] {\n\tconst result = (execResult as { result?: { case?: string; value?: unknown } } | null)?.result;\n\tconst variant = result?.case;\n\tif (variant === \"success\") {\n\t\tconst success = result?.value as { isError?: boolean; content?: unknown[] } | undefined;\n\t\tif (!success?.isError) return [\"Tool produced no transcript result\", false];\n\t\treturn [mcpContentToText(success.content) || \"MCP tool reported an error\", true];\n\t}\n\tif (!variant) return [\"Tool produced no transcript result\", false];\n\tconst value = result?.value as { error?: string; reason?: string } | undefined;\n\treturn [value?.error || value?.reason || `Tool call ${variant}`, true];\n}\n\n/** Flatten `McpSuccess.content` into transcript text. */\nfunction mcpContentToText(content: unknown[] | undefined): string {\n\tif (!Array.isArray(content)) return \"\";\n\tconst parts: string[] = [];\n\tfor (const item of content) {\n\t\tconst inner = (item as { content?: { case?: string; value?: { text?: string } } } | null)?.content;\n\t\tif (inner?.case === \"text\" && inner.value?.text) parts.push(inner.value.text);\n\t}\n\treturn parts.join(\"\\n\");\n}\n\nfunction splitExecHandlerResult<TResult>(result: CursorExecHandlerResult<TResult>): {\n\texecResult?: TResult;\n\ttoolResult?: ToolResultMessage;\n} {\n\tif (isToolResultMessage(result)) {\n\t\treturn { toolResult: result };\n\t}\n\tif (result && typeof result === \"object\") {\n\t\tconst record = result as Record<string, unknown>;\n\t\tif (\"execResult\" in record) {\n\t\t\tconst { execResult, toolResult } = record as {\n\t\t\t\texecResult: TResult;\n\t\t\t\ttoolResult?: ToolResultMessage;\n\t\t\t};\n\t\t\treturn { execResult, toolResult };\n\t\t}\n\t\tif (\"toolResult\" in record && !isToolResultMessage(record)) {\n\t\t\tconst { result: execResult, toolResult } = record as {\n\t\t\t\tresult?: TResult;\n\t\t\t\ttoolResult?: ToolResultMessage;\n\t\t\t};\n\t\t\treturn { execResult, toolResult };\n\t\t}\n\t\tif (\"result\" in record && !(\"$typeName\" in record)) {\n\t\t\tconst { result: execResult, toolResult } = record as {\n\t\t\t\tresult: TResult;\n\t\t\t\ttoolResult?: ToolResultMessage;\n\t\t\t};\n\t\t\treturn { execResult, toolResult };\n\t\t}\n\t}\n\treturn { execResult: result as TResult };\n}\n\nfunction isToolResultMessage(value: unknown): value is ToolResultMessage {\n\treturn !!value && typeof value === \"object\" && (value as ToolResultMessage).role === \"toolResult\";\n}\n\nasync function applyToolResultHandler(\n\ttoolResult: ToolResultMessage | undefined,\n\tonToolResult: CursorToolResultHandler | undefined,\n): Promise<ToolResultMessage | undefined> {\n\tif (!toolResult || !onToolResult) {\n\t\treturn toolResult;\n\t}\n\tconst updated = await onToolResult(toolResult);\n\treturn updated ?? toolResult;\n}\n\nfunction toolResultToText(toolResult: ToolResultMessage): string {\n\treturn toolResult.content.map((item) => (item.type === \"text\" ? item.text : `[${item.mimeType} image]`)).join(\"\\n\");\n}\n\nfunction toolResultWasTruncated(toolResult: ToolResultMessage): boolean {\n\tif (!toolResult.details || typeof toolResult.details !== \"object\") {\n\t\treturn false;\n\t}\n\tconst truncation = (toolResult.details as { truncation?: { truncated?: boolean } }).truncation;\n\treturn !!truncation?.truncated;\n}\n\nfunction toolResultDetailBoolean(toolResult: ToolResultMessage, key: string): boolean {\n\tif (!toolResult.details || typeof toolResult.details !== \"object\") {\n\t\treturn false;\n\t}\n\tconst value = (toolResult.details as Record<string, unknown>)[key];\n\treturn typeof value === \"boolean\" ? value : false;\n}\n\n/** The file's own line count, when the tool recorded one. */\nfunction readTotalLinesFromDetails(toolResult: ToolResultMessage): number | undefined {\n\tconst details = toolResult.details;\n\tif (!details || typeof details !== \"object\") return undefined;\n\tconst direct = \"totalLines\" in details ? details.totalLines : undefined;\n\tif (typeof direct === \"number\" && Number.isFinite(direct)) return direct;\n\tconst meta = \"meta\" in details ? details.meta : undefined;\n\tif (!meta || typeof meta !== \"object\") return undefined;\n\tconst truncation = \"truncation\" in meta ? meta.truncation : undefined;\n\tif (!truncation || typeof truncation !== \"object\") return undefined;\n\tconst totalLines = \"totalLines\" in truncation ? truncation.totalLines : undefined;\n\treturn typeof totalLines === \"number\" && Number.isFinite(totalLines) ? totalLines : undefined;\n}\n\nfunction readFileSizeFromDetails(toolResult: ToolResultMessage): number | undefined {\n\tconst details = toolResult.details;\n\tif (!details || typeof details !== \"object\" || !(\"fileSize\" in details)) return undefined;\n\tconst { fileSize } = details;\n\treturn typeof fileSize === \"number\" && Number.isSafeInteger(fileSize) && fileSize >= 0 ? fileSize : undefined;\n}\n\nfunction buildReadResultFromToolResult(path: string, toolResult: ToolResultMessage, rangeApplied = false) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildReadErrorResult(path, text || \"Read failed\");\n\t}\n\t// Counting the payload is only the file's length when the payload is the\n\t// whole file: under a windowed read, answering a 20-line page of a 100-line\n\t// file with `total_lines: 20` tells a paginating server it reached the end.\n\tconst totalLines = readTotalLinesFromDetails(toolResult) ?? (rangeApplied ? 0 : text ? text.split(\"\\n\").length : 0);\n\treturn create(ReadResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(ReadSuccessSchema, {\n\t\t\t\tpath,\n\t\t\t\ttotalLines,\n\t\t\t\tfileSize: BigInt(readFileSizeFromDetails(toolResult) ?? Buffer.byteLength(text, \"utf-8\")),\n\t\t\t\ttruncated: toolResultWasTruncated(toolResult),\n\t\t\t\toutput: { case: \"content\", value: text },\n\t\t\t\trangeApplied,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildReadErrorResult(path: string, error: string) {\n\treturn create(ReadResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(ReadErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildReadRejectedResult(path: string, reason: string) {\n\treturn create(ReadResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(ReadRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildWriteResultFromToolResult(\n\targs: { path: string; fileText?: string; fileBytes?: Uint8Array; returnFileContentAfterWrite?: boolean },\n\ttoolResult: ToolResultMessage,\n) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildWriteErrorResult(args.path, text || \"Write failed\");\n\t}\n\tconst fileText = args.fileText ?? \"\";\n\tconst fileSize = args.fileBytes?.length ?? Buffer.byteLength(fileText, \"utf-8\");\n\tconst linesCreated = fileText ? fileText.split(\"\\n\").length : 0;\n\treturn create(WriteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(WriteSuccessSchema, {\n\t\t\t\tpath: args.path,\n\t\t\t\tlinesCreated,\n\t\t\t\tfileSize,\n\t\t\t\tfileContentAfterWrite: args.returnFileContentAfterWrite ? fileText : undefined,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildWriteErrorResult(path: string, error: string) {\n\treturn create(WriteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(WriteErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildWriteRejectedResult(path: string, reason: string) {\n\treturn create(WriteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(WriteRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildDeleteResultFromToolResult(path: string, toolResult: ToolResultMessage) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildDeleteErrorResult(path, text || \"Delete failed\");\n\t}\n\treturn create(DeleteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(DeleteSuccessSchema, {\n\t\t\t\tpath,\n\t\t\t\tdeletedFile: path,\n\t\t\t\tfileSize: BigInt(0),\n\t\t\t\tprevContent: \"\",\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildDeleteErrorResult(path: string, error: string) {\n\treturn create(DeleteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(DeleteErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildDeleteRejectedResult(path: string, reason: string) {\n\treturn create(DeleteResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(DeleteRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildShellResultFromToolResult(\n\targs: { command: string; workingDirectory: string },\n\ttoolResult: ToolResultMessage,\n) {\n\tconst output = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildShellFailureResult(args.command, args.workingDirectory, output || \"Shell failed\");\n\t}\n\treturn create(ShellResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(ShellSuccessSchema, {\n\t\t\t\tcommand: args.command,\n\t\t\t\tworkingDirectory: args.workingDirectory,\n\t\t\t\texitCode: 0,\n\t\t\t\tsignal: \"\",\n\t\t\t\tstdout: output,\n\t\t\t\tstderr: \"\",\n\t\t\t\texecutionTime: 0,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildShellFailureResult(command: string, workingDirectory: string, error: string) {\n\treturn create(ShellResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"failure\",\n\t\t\tvalue: create(ShellFailureSchema, {\n\t\t\t\tcommand,\n\t\t\t\tworkingDirectory,\n\t\t\t\texitCode: 1,\n\t\t\t\tsignal: \"\",\n\t\t\t\tstdout: \"\",\n\t\t\t\tstderr: error,\n\t\t\t\texecutionTime: 0,\n\t\t\t\taborted: false,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildShellRejectedResult(command: string, workingDirectory: string, reason: string) {\n\treturn create(ShellResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(ShellRejectedSchema, {\n\t\t\t\tcommand,\n\t\t\t\tworkingDirectory,\n\t\t\t\treason,\n\t\t\t\tisReadonly: false,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildLsResultFromToolResult(path: string, toolResult: ToolResultMessage) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildLsErrorResult(path, text || \"Ls failed\");\n\t}\n\tconst rootPath = path || \".\";\n\tconst entries = text\n\t\t.split(\"\\n\")\n\t\t.map((line) => line.trim())\n\t\t.filter((line) => line.length > 0 && !line.startsWith(\"[\"));\n\tconst childrenDirs: LsDirectoryTreeNode[] = [];\n\tconst childrenFiles: LsDirectoryTreeNode_File[] = [];\n\n\tfor (const entry of entries) {\n\t\tconst name = entry.split(\" (\")[0];\n\t\tif (name.endsWith(\"/\")) {\n\t\t\tconst dirName = name.slice(0, -1);\n\t\t\tchildrenDirs.push(\n\t\t\t\tcreate(LsDirectoryTreeNodeSchema, {\n\t\t\t\t\tabsPath: `${rootPath.replace(/\\/$/, \"\")}/${dirName}`,\n\t\t\t\t\tchildrenDirs: [],\n\t\t\t\t\tchildrenFiles: [],\n\t\t\t\t\tchildrenWereProcessed: false,\n\t\t\t\t\tfullSubtreeExtensionCounts: {},\n\t\t\t\t\tnumFiles: 0,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenFiles.push(create(LsDirectoryTreeNode_FileSchema, { name }));\n\t\t}\n\t}\n\n\tconst root = create(LsDirectoryTreeNodeSchema, {\n\t\tabsPath: rootPath,\n\t\tchildrenDirs,\n\t\tchildrenFiles,\n\t\tchildrenWereProcessed: true,\n\t\tfullSubtreeExtensionCounts: {},\n\t\tnumFiles: childrenFiles.length,\n\t});\n\n\treturn create(LsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(LsSuccessSchema, { directoryTreeRoot: root }),\n\t\t},\n\t});\n}\n\nfunction buildLsErrorResult(path: string, error: string) {\n\treturn create(LsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(LsErrorSchema, { path, error }),\n\t\t},\n\t});\n}\n\nfunction buildLsRejectedResult(path: string, reason: string) {\n\treturn create(LsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(LsRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction buildGrepResultFromToolResult(\n\targs: { pattern: string; path?: string; outputMode?: string; offset?: number },\n\ttoolResult: ToolResultMessage,\n) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildGrepErrorResult(text || \"Grep failed\");\n\t}\n\n\tconst outputMode = args.outputMode || \"content\";\n\tconst clientTruncated = toolResultDetailBoolean(toolResult, \"truncated\");\n\tconst lines = text\n\t\t.split(\"\\n\")\n\t\t.map((line) => line.trimEnd())\n\t\t.filter((line) => line.length > 0 && !line.startsWith(\"[\") && !line.toLowerCase().startsWith(\"no matches\"));\n\n\tconst workspaceKey = args.path || \".\";\n\tlet unionResult: GrepUnionResult;\n\n\tif (outputMode === \"files_with_matches\") {\n\t\tconst files = lines;\n\t\tunionResult = create(GrepUnionResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"files\",\n\t\t\t\tvalue: create(GrepFilesResultSchema, {\n\t\t\t\t\tfiles,\n\t\t\t\t\ttotalFiles: files.length,\n\t\t\t\t\tclientTruncated,\n\t\t\t\t\tripgrepTruncated: false,\n\t\t\t\t\toffsetApplied: args.offset,\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t} else if (outputMode === \"count\") {\n\t\tconst counts = lines\n\t\t\t.map((line) => {\n\t\t\t\tconst separatorIndex = line.lastIndexOf(\":\");\n\t\t\t\tif (separatorIndex === -1) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst file = line.slice(0, separatorIndex);\n\t\t\t\tconst count = Number.parseInt(line.slice(separatorIndex + 1), 10);\n\t\t\t\tif (!file || Number.isNaN(count)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn create(GrepFileCountSchema, { file, count });\n\t\t\t})\n\t\t\t.filter((entry): entry is GrepFileCount => entry !== null);\n\t\tconst totalMatches = counts.reduce((sum, entry) => sum + entry.count, 0);\n\t\tunionResult = create(GrepUnionResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"count\",\n\t\t\t\tvalue: create(GrepCountResultSchema, {\n\t\t\t\t\tcounts,\n\t\t\t\t\ttotalFiles: counts.length,\n\t\t\t\t\ttotalMatches,\n\t\t\t\t\tclientTruncated,\n\t\t\t\t\tripgrepTruncated: false,\n\t\t\t\t\toffsetApplied: args.offset,\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t} else {\n\t\tconst matchMap = new Map<string, Array<{ line: number; content: string; isContextLine: boolean }>>();\n\t\tlet totalMatchedLines = 0;\n\n\t\tfor (const line of lines) {\n\t\t\tconst matchLine = line.match(/^(.+?):(\\d+):\\s?(.*)$/);\n\t\t\tconst contextLine = line.match(/^(.+?)-(\\d+)-\\s?(.*)$/);\n\t\t\tconst match = matchLine ?? contextLine;\n\t\t\tif (!match) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst [, file, lineNumber, content] = match;\n\t\t\tconst isContextLine = Boolean(contextLine);\n\t\t\tconst list = matchMap.get(file) ?? [];\n\t\t\tlist.push({ line: Number(lineNumber), content, isContextLine });\n\t\t\tmatchMap.set(file, list);\n\t\t\tif (!isContextLine) {\n\t\t\t\ttotalMatchedLines += 1;\n\t\t\t}\n\t\t}\n\n\t\tconst matches = Array.from(matchMap.entries()).map(([file, fileMatches]) =>\n\t\t\tcreate(GrepFileMatchSchema, {\n\t\t\t\tfile,\n\t\t\t\tmatches: fileMatches.map((entry) =>\n\t\t\t\t\tcreate(GrepContentMatchSchema, {\n\t\t\t\t\t\tlineNumber: entry.line,\n\t\t\t\t\t\tcontent: entry.content,\n\t\t\t\t\t\tcontentTruncated: false,\n\t\t\t\t\t\tisContextLine: entry.isContextLine,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t}),\n\t\t);\n\t\tconst totalLines = matches.reduce((sum, entry) => sum + entry.matches.length, 0);\n\t\tunionResult = create(GrepUnionResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"content\",\n\t\t\t\tvalue: create(GrepContentResultSchema, {\n\t\t\t\t\tmatches,\n\t\t\t\t\ttotalLines,\n\t\t\t\t\ttotalMatchedLines,\n\t\t\t\t\tclientTruncated,\n\t\t\t\t\tripgrepTruncated: false,\n\t\t\t\t\toffsetApplied: args.offset,\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t}\n\n\treturn create(GrepResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(GrepSuccessSchema, {\n\t\t\t\tpattern: args.pattern,\n\t\t\t\tpath: args.path || \"\",\n\t\t\t\toutputMode,\n\t\t\t\tworkspaceResults: { [workspaceKey]: unionResult },\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildGrepErrorResult(error: string) {\n\treturn create(GrepResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(GrepErrorSchema, { error }),\n\t\t},\n\t});\n}\n\n/**\n * Reject a Cursor exec-channel `grepArgs` frame whose `pattern` is empty or\n * whitespace-only. Returns an actionable error message (with a `glob`-aware\n * hint when the model likely meant to list files) or `null` when the pattern\n * is valid and grep should run. Exported for tests.\n */\nexport function emptyGrepPatternRejection(pattern: string | undefined, glob: string | undefined): string | null {\n\tif (pattern && pattern.trim().length > 0) return null;\n\tif (glob && glob.length > 0) {\n\t\treturn (\n\t\t\t`grep pattern is required (received an empty pattern). To list files matching \"${glob}\", ` +\n\t\t\t`pass a non-empty regex (e.g. \".\") and set path to that glob, or use the ls/read tool instead.`\n\t\t);\n\t}\n\treturn \"grep pattern is required (received an empty pattern).\";\n}\n\nfunction buildDiagnosticsResultFromToolResult(path: string, toolResult: ToolResultMessage) {\n\tconst text = toolResultToText(toolResult);\n\tif (toolResult.isError) {\n\t\treturn buildDiagnosticsErrorResult(path, text || \"Diagnostics failed\");\n\t}\n\treturn create(DiagnosticsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(DiagnosticsSuccessSchema, {\n\t\t\t\tpath,\n\t\t\t\tdiagnostics: [],\n\t\t\t\ttotalDiagnostics: 0,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildDiagnosticsErrorResult(_path: string, error: string) {\n\treturn create(DiagnosticsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(DiagnosticsErrorSchema, { error }),\n\t\t},\n\t});\n}\n\nfunction buildDiagnosticsRejectedResult(path: string, reason: string) {\n\treturn create(DiagnosticsResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"rejected\",\n\t\t\tvalue: create(DiagnosticsRejectedSchema, { path, reason }),\n\t\t},\n\t});\n}\n\nfunction parseToolArgsJson(text: string): unknown {\n\tconst trimmed = text.trim();\n\tif (!trimmed) {\n\t\treturn text;\n\t}\n\ttry {\n\t\treturn parseJsonWithRepair<unknown>(trimmed);\n\t} catch {\n\t\treturn text;\n\t}\n}\n\nfunction decodeMcpArgValue(value: Uint8Array): unknown {\n\ttry {\n\t\tconst parsedValue = fromBinary(ValueSchema, value);\n\t\tconst jsonValue = toJson(ValueSchema, parsedValue) as PbJsonValue;\n\t\tif (typeof jsonValue === \"string\") {\n\t\t\treturn parseToolArgsJson(jsonValue);\n\t\t}\n\t\treturn jsonValue;\n\t} catch {}\n\tconst text = new TextDecoder().decode(value);\n\treturn parseToolArgsJson(text);\n}\n\nfunction decodeMcpArgsMap(args?: Record<string, Uint8Array>): Record<string, unknown> | undefined {\n\tif (!args) {\n\t\treturn undefined;\n\t}\n\tconst decoded: Record<string, unknown> = {};\n\tfor (const [key, value] of Object.entries(args)) {\n\t\tdecoded[key] = decodeMcpArgValue(value);\n\t}\n\treturn decoded;\n}\n\nfunction decodeMcpCall(args: {\n\tname: string;\n\targs: Record<string, Uint8Array>;\n\ttoolCallId: string;\n\tproviderIdentifier: string;\n\ttoolName: string;\n\tsmartModeApprovalOnly?: boolean;\n}): CursorMcpCall {\n\tconst decodedArgs: Record<string, unknown> = {};\n\tfor (const [key, value] of Object.entries(args.args ?? {})) {\n\t\tdecodedArgs[key] = decodeMcpArgValue(value);\n\t}\n\treturn {\n\t\tname: args.name,\n\t\tproviderIdentifier: args.providerIdentifier,\n\t\ttoolName: args.toolName || args.name,\n\t\ttoolCallId: args.toolCallId,\n\t\targs: decodedArgs,\n\t\trawArgs: args.args ?? {},\n\t\tapprovalOnly: args.smartModeApprovalOnly === true,\n\t};\n}\n\n/**\n * Map Cursor's `TodoStatus` enum onto display statuses. Cancelled (4) maps to\n * `abandoned` rather than collapsing to `pending`, which would resurrect a\n * task the model explicitly cancelled.\n */\nfunction mapTodoStatusValue(status?: number): \"pending\" | \"in_progress\" | \"completed\" | \"abandoned\" {\n\tswitch (status) {\n\t\tcase 2:\n\t\t\treturn \"in_progress\";\n\t\tcase 3:\n\t\t\treturn \"completed\";\n\t\tcase 4:\n\t\t\treturn \"abandoned\";\n\t\tdefault:\n\t\t\treturn \"pending\";\n\t}\n}\n\ninterface CursorTodoItem {\n\tid?: string;\n\tcontent?: string;\n\tstatus?: number;\n\tdependencies?: string[];\n}\n\ninterface CursorTodoResult {\n\tresult?: {\n\t\tcase?: \"success\" | \"error\";\n\t\tvalue?: { todos?: CursorTodoItem[]; totalCount?: number; wasMerge?: boolean; error?: string };\n\t};\n}\n\ninterface CursorUpdateTodosCall {\n\targs?: { todos?: CursorTodoItem[]; merge?: boolean };\n\tresult?: CursorTodoResult;\n}\n\ninterface CursorReadTodosCall {\n\targs?: { statusFilter?: number[]; idFilter?: string[] };\n\tresult?: CursorTodoResult;\n}\n\n/**\n * `ToolCall` is a protobuf oneof, so a decoded message exposes the selected\n * variant as `tool: { case, value }` — NOT as a named property. Hand-built\n * fixtures use the flattened form, so both are accepted here.\n */\ninterface CursorTodoToolCall {\n\ttool?: { case?: string; value?: unknown };\n\tupdateTodosToolCall?: CursorUpdateTodosCall;\n\treadTodosToolCall?: CursorReadTodosCall;\n}\n\nfunction selectTodoCalls(toolCall: CursorTodoToolCall): {\n\tupdate?: CursorUpdateTodosCall;\n\tread?: CursorReadTodosCall;\n} {\n\tconst oneof = toolCall.tool;\n\tif (oneof?.case === \"updateTodosToolCall\") return { update: oneof.value as CursorUpdateTodosCall };\n\tif (oneof?.case === \"readTodosToolCall\") return { read: oneof.value as CursorReadTodosCall };\n\treturn { update: toolCall.updateTodosToolCall, read: toolCall.readTodosToolCall };\n}\n\nfunction mapTodoSnapshot(todos: CursorTodoItem[]) {\n\treturn todos.map((todo) => ({\n\t\tcontent: typeof todo.content === \"string\" ? todo.content : \"\",\n\t\tstatus: mapTodoStatusValue(typeof todo.status === \"number\" ? todo.status : undefined),\n\t}));\n}\n\ninterface CursorMcpToolCall {\n\targs?: {\n\t\tname?: string;\n\t\ttoolName?: string;\n\t\ttoolCallId?: string;\n\t\targs?: Record<string, Uint8Array>;\n\t};\n}\n\ninterface CursorMcpToolCallCarrier {\n\ttool?: { case?: string; value?: unknown };\n\tmcpToolCall?: CursorMcpToolCall;\n}\n\n/**\n * `ToolCall.tool` is a protobuf oneof: a wire-decoded message exposes the\n * variant as `{ case, value }` and NEVER as a flattened property. The flat\n * fallback is kept for hand-shaped test fixtures.\n */\nfunction selectMcpCall(toolCall: CursorMcpToolCallCarrier | undefined): CursorMcpToolCall | undefined {\n\tconst oneof = toolCall?.tool;\n\tif (oneof?.case === \"mcpToolCall\") return oneof.value as CursorMcpToolCall;\n\treturn toolCall?.mcpToolCall;\n}\n\n/**\n * The streamed `ToolCall` variants whose block the exec channel owns.\n *\n * Each of these is announced on the interaction stream AND dispatched as its\n * own `ExecServerMessage` frame, so the block is synthesized once, by the\n * exec handler, which is the side that has the result.\n */\nconst EXEC_OWNED_TOOL_CALL_CASES: ReadonlySet<string> = new Set([\n\t\"piReadToolCall\",\n\t\"piBashToolCall\",\n\t\"piEditToolCall\",\n\t\"piWriteToolCall\",\n\t\"piGrepToolCall\",\n\t\"piFindToolCall\",\n\t\"piLsToolCall\",\n\t\"listMcpResourcesToolCall\",\n\t\"readMcpResourceToolCall\",\n]);\n\nfunction isExecOwnedToolCall(toolCall: { tool?: { case?: string } } | undefined): boolean {\n\tconst variant = toolCall?.tool?.case;\n\treturn variant !== undefined && EXEC_OWNED_TOOL_CALL_CASES.has(variant);\n}\n\n/**\n * Close every tool-call block still open when the stream ends.\n *\n * Not just the last one started: with interleaved calls several can be open\n * at once, and an unclosed block leaves its live card animating and its call\n * unpaired. Only blocks fed by a streamed argument buffer get reparsed.\n * Server-owned blocks (`connect-scm`, `todo`) are also paired here: they are\n * stamped resolved the moment they open, so only their completion frame pairs\n * a result — a transport that closes before that frame would leave the call\n * unpaired. MCP blocks are excluded even when resolved: the exec dispatch\n * that marked them owns their result.\n */\nexport function flushOpenToolCalls(\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n): void {\n\tconst openBlocks = new Set<ToolCallState>(state.openToolCalls.values());\n\tif (state.currentToolCall) openBlocks.add(state.currentToolCall);\n\tfor (const block of openBlocks) {\n\t\tconst idx = output.content.indexOf(block);\n\t\tconst partialJson = block[kStreamingPartialJson];\n\t\tif (partialJson !== undefined) {\n\t\t\tblock.arguments = parseStreamingJson(partialJson);\n\t\t\tclearStreamingPartialJson(block);\n\t\t}\n\t\tconst kind = block[kStreamingBlockKind];\n\t\tif (kind === \"connect-scm\" || kind === \"todo\") {\n\t\t\tvoid state.onToolResult?.({\n\t\t\t\trole: \"toolResult\",\n\t\t\t\ttoolCallId: block.id,\n\t\t\t\ttoolName: block.name,\n\t\t\t\tcontent: [{ type: \"text\", text: \"The connection to Cursor closed before this call completed.\" }],\n\t\t\t\tisError: true,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\t\tstream.push({ type: \"toolcall_end\", contentIndex: idx, toolCall: block, partial: output });\n\t}\n\tstate.openToolCalls.clear();\n\tstate.setToolCall(null);\n}\n\n/**\n * Retain a freshly opened streamed tool-call block, keyed by the interaction\n * envelope's `call_id`. `currentToolCall` is still set as the fallback for\n * frames that carry no `call_id`.\n */\nfunction retainStreamedCall(state: BlockState, block: ToolCallState, envelopeId: string | undefined): void {\n\tif (envelopeId) state.openToolCalls.set(envelopeId, block);\n\tstate.setToolCall(block);\n}\n\n/**\n * The open block a streamed update addresses, or `null` to ignore the update.\n *\n * Cursor interleaves calls: `start A, start B, complete A` is legal, so the\n * update must reach block A even though B opened last. An id naming no open\n * block is ignored rather than misapplied. A missing id falls back to the\n * current block.\n */\nfunction resolveStreamedCall(state: BlockState, envelopeId: string | undefined): ToolCallState | null {\n\tif (!envelopeId) return state.currentToolCall;\n\tconst keyed = state.openToolCalls.get(envelopeId);\n\tif (keyed) return keyed;\n\tconst current = state.currentToolCall;\n\treturn current && current[kStreamingEnvelopeId] === undefined ? current : null;\n}\n\n/** Release a settled block from both the keyed map and the current slot. */\nfunction releaseStreamedCall(state: BlockState, block: ToolCallState): void {\n\tconst envelopeId = block[kStreamingEnvelopeId];\n\tif (envelopeId) state.openToolCalls.delete(envelopeId);\n\tif (state.currentToolCall === block) state.setToolCall(null);\n}\n\ninterface CursorConnectScmRepository {\n\towner?: string;\n\trepo?: string;\n}\n\ninterface CursorConnectScmCall {\n\targs?: {\n\t\ttoolCallId?: string;\n\t\ttarget?: { case?: string; value?: { repository?: CursorConnectScmRepository } };\n\t\tgithub?: { repository?: CursorConnectScmRepository };\n\t};\n\tresult?: { result?: { case?: string; value?: { error?: string; reason?: string } } };\n}\n\ninterface CursorConnectScmCarrier {\n\ttool?: { case?: string; value?: unknown };\n\tconnectScmToolCall?: CursorConnectScmCall;\n}\n\nfunction selectConnectScmCall(toolCall: CursorConnectScmCarrier | undefined): CursorConnectScmCall | undefined {\n\tconst oneof = toolCall?.tool;\n\tif (oneof?.case === \"connectScmToolCall\") return oneof.value as CursorConnectScmCall;\n\treturn toolCall?.connectScmToolCall;\n}\n\nfunction selectConnectScmRepository(call: CursorConnectScmCall | undefined): CursorConnectScmRepository | undefined {\n\tconst target = call?.args?.target;\n\tif (target?.case === \"github\") return target.value?.repository;\n\treturn call?.args?.github?.repository;\n}\n\n/** Render a settled `ConnectScmResult` as the text of its paired tool result. */\nfunction describeConnectScmResult(call: CursorConnectScmCall | undefined): { text: string; isError: boolean } {\n\tconst result = call?.result?.result;\n\tswitch (result?.case) {\n\t\tcase \"success\":\n\t\t\treturn { text: \"SCM connected\", isError: false };\n\t\tcase \"error\":\n\t\t\treturn { text: result.value?.error || \"SCM connection failed\", isError: true };\n\t\tcase \"rejected\":\n\t\t\treturn { text: result.value?.reason || \"SCM connection rejected\", isError: true };\n\t\tdefault:\n\t\t\treturn { text: \"SCM connection reported no result\", isError: true };\n\t}\n}\n\n/**\n * Extract the authoritative full todo list from a completed native todo call.\n * Only `result.success.todos` is authoritative; filtered/partial/ambiguous\n * responses return `null`, which the caller MUST treat as \"nothing to mirror\".\n */\nfunction extractTodoSnapshot(\n\ttoolCall: CursorTodoToolCall,\n): { todos: ReturnType<typeof mapTodoSnapshot>; merged: boolean } | null {\n\tconst { update, read } = selectTodoCalls(toolCall);\n\tif (read && ((read.args?.statusFilter?.length ?? 0) > 0 || (read.args?.idFilter?.length ?? 0) > 0)) {\n\t\treturn null;\n\t}\n\tconst call = update ?? read;\n\tif (!call) return null;\n\tconst result = call.result?.result;\n\tif (result?.case !== \"success\") return null;\n\tconst todos = result.value?.todos;\n\tif (!todos) return null;\n\tconst totalCount = result.value?.totalCount;\n\tif (typeof totalCount === \"number\" && totalCount !== todos.length) {\n\t\treturn null;\n\t}\n\tif (read && todos.length === 0) {\n\t\treturn null;\n\t}\n\tconst mapped = mapTodoSnapshot(todos);\n\tif (mapped.some((todo) => todo.content.length === 0)) return null;\n\treturn {\n\t\ttodos: mapped,\n\t\tmerged: result.value?.wasMerge === true,\n\t};\n}\n\n/** Error text when the server itself rejected the call. */\nfunction extractTodoError(toolCall: CursorTodoToolCall): string | null {\n\tconst { update, read } = selectTodoCalls(toolCall);\n\tconst result = (update ?? read)?.result?.result;\n\tif (result?.case !== \"error\") return null;\n\tconst error = result.value?.error;\n\treturn typeof error === \"string\" && error.length > 0 ? error : \"Todo operation failed\";\n}\n\n/** Args echoed onto the synthesized display block, for rendering only. */\nfunction buildTodoDisplayArgs(toolCall: CursorTodoToolCall): {\n\ttodos: ReturnType<typeof mapTodoSnapshot>;\n\tmerge?: boolean;\n} {\n\tconst args = selectTodoCalls(toolCall).update?.args;\n\treturn {\n\t\ttodos: args?.todos ? mapTodoSnapshot(args.todos) : [],\n\t\tmerge: args?.merge === true ? true : undefined,\n\t};\n}\n\n/**\n * Paired result for a server-resolved native todo call. Nothing else would\n * produce a `toolResult` for the block — and transcript rebuilds strip any\n * `toolCall` left unpaired.\n */\nfunction buildTodoToolResult(\n\ttoolCallId: string,\n\tsnapshot: { todos: ReturnType<typeof mapTodoSnapshot> } | null,\n\terror: string | null,\n): ToolResultMessage {\n\tconst text = error ?? (snapshot ? formatTodoSnapshotSummary(snapshot.todos) : \"Todo snapshot not mirrored\");\n\treturn {\n\t\trole: \"toolResult\",\n\t\ttoolCallId,\n\t\ttoolName: \"todo\",\n\t\tcontent: [{ type: \"text\", text }],\n\t\tisError: error !== null,\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction formatTodoSnapshotSummary(todos: { status: string }[]): string {\n\tif (todos.length === 0) return \"No todos\";\n\tconst done = todos.filter((todo) => todo.status === \"completed\").length;\n\treturn `${done}/${todos.length} tasks completed`;\n}\n\nfunction buildMcpResultFromToolResult(_mcpCall: CursorMcpCall, toolResult: ToolResultMessage) {\n\tif (toolResult.isError) {\n\t\treturn buildMcpErrorResult(toolResultToText(toolResult) || \"MCP tool failed\");\n\t}\n\tconst content = toolResult.content.map((item) => {\n\t\tif (item.type === \"image\") {\n\t\t\treturn create(McpToolResultContentItemSchema, {\n\t\t\t\tcontent: {\n\t\t\t\t\tcase: \"image\",\n\t\t\t\t\tvalue: create(McpImageContentSchema, {\n\t\t\t\t\t\tdata: Uint8Array.from(Buffer.from(item.data, \"base64\")),\n\t\t\t\t\t\tmimeType: item.mimeType,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t\treturn create(McpToolResultContentItemSchema, {\n\t\t\tcontent: {\n\t\t\t\tcase: \"text\",\n\t\t\t\tvalue: create(McpTextContentSchema, { text: item.text }),\n\t\t\t},\n\t\t});\n\t});\n\n\treturn create(McpResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(McpSuccessSchema, {\n\t\t\t\tcontent,\n\t\t\t\tisError: false,\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction buildMcpToolNotFoundResult(mcpCall: CursorMcpCall) {\n\treturn create(McpResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"toolNotFound\",\n\t\t\tvalue: create(McpToolNotFoundSchema, { name: mcpCall.toolName, availableTools: [] }),\n\t\t},\n\t});\n}\n\nfunction buildMcpErrorResult(error: string) {\n\treturn create(McpResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"error\",\n\t\t\tvalue: create(McpErrorSchema, { error }),\n\t\t},\n\t});\n}\n\n/**\n * Merge the decoded completion-frame `McpArgs` map into the args assembled\n * from streamed `args_text_delta` snapshots.\n *\n * The completion frame is authoritative for the scalars it carries — but it\n * can omit oversized parameters entirely and can downgrade a structured value\n * to its raw string fallback. Rules per key:\n * - completion key absent → keep the streamed value.\n * - completion is a string while the streamed value is structured → keep the\n * streamed value (the completion frame downgraded it).\n * - otherwise → completion wins.\n */\nexport function mergeCursorMcpToolCallArgs(\n\tstreamed: Record<string, unknown> | undefined,\n\tcompletion: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n\tconst merged: Record<string, unknown> = { ...(streamed ?? {}) };\n\tif (!completion) return merged;\n\tfor (const [key, completionValue] of Object.entries(completion)) {\n\t\tconst streamedValue = merged[key];\n\t\tif (typeof completionValue === \"string\" && streamedValue !== null && typeof streamedValue === \"object\") {\n\t\t\tcontinue;\n\t\t}\n\t\tmerged[key] = completionValue;\n\t}\n\treturn merged;\n}\n\nfunction endCurrentTextBlock(output: AssistantMessage, stream: AssistantMessageEventStream, state: BlockState): void {\n\tconst block = state.currentTextBlock;\n\tif (!block) return;\n\tconst idx = output.content.indexOf(block);\n\tstream.push({\n\t\ttype: \"text_end\",\n\t\tcontentIndex: idx,\n\t\tcontent: block.text,\n\t\tpartial: output,\n\t});\n\tstate.setTextBlock(null);\n}\n\nfunction endCurrentThinkingBlock(\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n): void {\n\tconst block = state.currentThinkingBlock;\n\tif (!block) return;\n\tconst idx = output.content.indexOf(block);\n\tstream.push({\n\t\ttype: \"thinking_end\",\n\t\tcontentIndex: idx,\n\t\tcontent: block.thinking,\n\t\tpartial: output,\n\t});\n\tstate.setThinkingBlock(null);\n}\n\n/**\n * Synthesize a completed `toolCall` content block for a Cursor exec-channel\n * native tool or for an MCP exec frame whose corresponding interaction block\n * is absent.\n *\n * Args arrive complete on the exec message, so the block opens and closes in\n * one step. Without this the persisted assistant message carries only\n * text/thinking blocks, and on replay the following `toolResult` messages\n * have no matching `toolCall.id`.\n *\n * The block is stamped with {@link kCursorExecResolved} so the agent loop's\n * execution pass skips it — Cursor's server-driven exec channel already ran\n * the tool via the bridge and buffered the result. Exported for tests.\n */\nexport function synthesizeCursorExecToolCall(\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n\ttoolCallId: string,\n\ttoolName: string,\n\targs: Record<string, unknown>,\n): void {\n\tendCurrentTextBlock(output, stream, state);\n\tendCurrentThinkingBlock(output, stream, state);\n\tconst block: ToolCallState = {\n\t\ttype: \"toolCall\",\n\t\tid: toolCallId,\n\t\tname: toolName,\n\t\targuments: omitUndefinedArgs(args),\n\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t[kStreamingBlockKind]: \"cursor-exec\",\n\t\t[kCursorExecResolved]: true,\n\t};\n\toutput.content.push(block);\n\tconst idx = output.content.length - 1;\n\tstream.push({ type: \"toolcall_start\", contentIndex: idx, partial: output });\n\tstream.push({ type: \"toolcall_end\", contentIndex: idx, toolCall: block, partial: output });\n}\n\n/**\n * Pair a `toolResult` for a synthesized block the client answered itself,\n * without ever consulting a handler. Frames answered from a fixed verdict —\n * no handler, no local execution — still need the pair: the block was stamped\n * {@link kCursorExecResolved}, so the agent loop emits no placeholder for it\n * and transcript rebuilds strip an unpaired call.\n */\nasync function pairSynthesizedExecResult(\n\tstate: BlockState,\n\tonToolResult: CursorToolResultHandler | undefined,\n\ttoolCallId: string,\n\ttoolName: string,\n\ttext: string,\n\tisError = true,\n): Promise<void> {\n\tconst synthesized: ToolResultMessage = {\n\t\trole: \"toolResult\",\n\t\ttoolCallId,\n\t\ttoolName,\n\t\tcontent: [{ type: \"text\", text }],\n\t\tisError,\n\t\ttimestamp: Date.now(),\n\t};\n\tconst sink = onToolResult ?? state.onToolResult;\n\tif (!sink) return;\n\tawait sink(synthesized);\n}\n\n/**\n * Throttle threshold for mid-stream argument JSON parses: reparse only when\n * the buffer grew by this much since the last successful parse, keeping total\n * parse work bounded while the authoritative full parse runs on completion.\n */\nconst STREAMING_ARGS_REPARSE_DELTA = 1024;\n\n/** Exported for tests: drives one Cursor interaction update through the streaming state machine. */\nexport function processInteractionUpdate(\n\tupdate: any,\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tstate: BlockState,\n\tusageState: UsageState,\n): void {\n\tconst updateCase = update.message?.case;\n\n\tlog(\"interactionUpdate\", updateCase);\n\n\tif (updateCase === \"textDelta\") {\n\t\tconst delta = update.message.value.text || \"\";\n\t\tif (!state.currentTextBlock) {\n\t\t\tconst block: TextContent & { [kStreamingBlockIndex]: number } = {\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: \"\",\n\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t};\n\t\t\toutput.content.push(block);\n\t\t\tstate.setTextBlock(block);\n\t\t\tstream.push({ type: \"text_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t}\n\t\tstate.currentTextBlock!.text += delta;\n\t\tconst idx = output.content.indexOf(state.currentTextBlock!);\n\t\tstream.push({ type: \"text_delta\", contentIndex: idx, delta, partial: output });\n\t} else if (updateCase === \"thinkingDelta\") {\n\t\tconst delta = update.message.value.text || \"\";\n\t\tif (!state.currentThinkingBlock) {\n\t\t\tconst block: ThinkingContent & { [kStreamingBlockIndex]: number } = {\n\t\t\t\ttype: \"thinking\",\n\t\t\t\tthinking: \"\",\n\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t};\n\t\t\toutput.content.push(block);\n\t\t\tstate.setThinkingBlock(block);\n\t\t\tstream.push({ type: \"thinking_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t}\n\t\tstate.currentThinkingBlock!.thinking += delta;\n\t\tconst idx = output.content.indexOf(state.currentThinkingBlock!);\n\t\tstream.push({ type: \"thinking_delta\", contentIndex: idx, delta, partial: output });\n\t} else if (updateCase === \"thinkingCompleted\") {\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t} else if (updateCase === \"toolCallStarted\" && selectConnectScmCall(update.message.value.toolCall)) {\n\t\t// `connect_scm` is resolved entirely server-side and has NO exec frame:\n\t\t// the streamed pair is the only signal this client sees. The\n\t\t// authoritative outcome rides on the COMPLETION's `result` oneof, so the\n\t\t// block is opened here and settled there.\n\t\tendCurrentTextBlock(output, stream, state);\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t\tconst scmCall = selectConnectScmCall(update.message.value.toolCall);\n\t\tconst repository = selectConnectScmRepository(scmCall);\n\t\tconst block: ToolCallState = {\n\t\t\ttype: \"toolCall\",\n\t\t\tid: scmCall?.args?.toolCallId || update.message.value.callId || randomUUID(),\n\t\t\tname: \"connect_scm\",\n\t\t\targuments: repository ? { owner: repository.owner, repo: repository.repo } : {},\n\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t[kStreamingBlockKind]: \"connect-scm\",\n\t\t\t[kStreamingEnvelopeId]: update.message.value.callId || undefined,\n\t\t\t[kCursorExecResolved]: true,\n\t\t};\n\t\toutput.content.push(block);\n\t\tretainStreamedCall(state, block, update.message.value.callId);\n\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t} else if (updateCase === \"toolCallStarted\" && isExecOwnedToolCall(update.message.value.toolCall)) {\n\t\t// The exec channel already synthesized this block (and marked it\n\t\t// resolved) when it ran the tool locally, so the streamed announcement\n\t\t// must not create a second one.\n\t\tendCurrentTextBlock(output, stream, state);\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t\tlog(\"exec\", \"streamedToolCallOwnedByExec\", { case: update.message.value.toolCall?.tool?.case });\n\t} else if (updateCase === \"toolCallStarted\") {\n\t\tendCurrentTextBlock(output, stream, state);\n\t\tendCurrentThinkingBlock(output, stream, state);\n\t\tconst toolCall = update.message.value.toolCall;\n\t\tif (toolCall) {\n\t\t\tconst mcpCall = selectMcpCall(toolCall);\n\t\t\tif (mcpCall) {\n\t\t\t\tconst args = mcpCall.args || {};\n\t\t\t\tconst id = args.toolCallId || randomUUID();\n\t\t\t\tconst resolvedByExec = state.resolvedMcpToolCallIds.delete(id);\n\t\t\t\tif (resolvedByExec && output.content.some((block) => block.type === \"toolCall\" && block.id === id)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst block: ToolCallState = {\n\t\t\t\t\ttype: \"toolCall\",\n\t\t\t\t\tid,\n\t\t\t\t\t// Same precedence as `decodeMcpCall` (`toolName || name`), which\n\t\t\t\t\t// is what the exec channel pairs its result under.\n\t\t\t\t\tname: args.toolName || args.name || \"\",\n\t\t\t\t\targuments: {},\n\t\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t\t\t[kStreamingPartialJson]: \"\",\n\t\t\t\t\t[kStreamingBlockKind]: \"mcp\",\n\t\t\t\t\t[kStreamingEnvelopeId]: update.message.value.callId || undefined,\n\t\t\t\t};\n\t\t\t\tif (resolvedByExec) {\n\t\t\t\t\tmarkCursorExecResolved(block);\n\t\t\t\t}\n\t\t\t\toutput.content.push(block);\n\t\t\t\tretainStreamedCall(state, block, update.message.value.callId);\n\t\t\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Cursor resolves `update_todos` / `read_todos` server-side and\n\t\t\t// settles them on the tool call's `result`. Both blocks are stamped\n\t\t\t// resolved so the agent loop never runs them locally.\n\t\t\tconst todoCalls = selectTodoCalls(toolCall);\n\t\t\tif (todoCalls.update || todoCalls.read) {\n\t\t\t\tconst callId = update.message.value.callId || randomUUID();\n\t\t\t\tconst block: ToolCallState = {\n\t\t\t\t\ttype: \"toolCall\",\n\t\t\t\t\tid: callId,\n\t\t\t\t\tname: \"todo\",\n\t\t\t\t\targuments: buildTodoDisplayArgs(toolCall),\n\t\t\t\t\t[kStreamingBlockIndex]: output.content.length,\n\t\t\t\t\t[kStreamingBlockKind]: \"todo\",\n\t\t\t\t\t[kStreamingEnvelopeId]: update.message.value.callId || undefined,\n\t\t\t\t\t[kCursorExecResolved]: true,\n\t\t\t\t};\n\t\t\t\toutput.content.push(block);\n\t\t\t\tretainStreamedCall(state, block, update.message.value.callId);\n\t\t\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t\t}\n\t\t}\n\t} else if (updateCase === \"toolCallDelta\" || updateCase === \"partialToolCall\") {\n\t\t// An argument delta belonging to a different call must not be appended\n\t\t// to this block's buffer, which would corrupt the JSON both parse.\n\t\tconst target = resolveStreamedCall(state, update.message.value.callId);\n\t\tif (target?.[kStreamingBlockKind] === \"mcp\") {\n\t\t\t// Cursor's `args_text_delta` is \"aggregated args text so far\": each\n\t\t\t// delta is a cumulative snapshot. Strip the prefix we already have to\n\t\t\t// recover the new suffix; fall back to treating the value as an\n\t\t\t// incremental fragment when it doesn't extend the buffer.\n\t\t\tconst snapshot: string = update.message.value.argsTextDelta || \"\";\n\t\t\tconst current = target[kStreamingPartialJson] ?? \"\";\n\t\t\tconst chunk = snapshot.startsWith(current) ? snapshot.slice(current.length) : snapshot;\n\t\t\tif (chunk.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextBuffer = current + chunk;\n\t\t\ttarget[kStreamingPartialJson] = nextBuffer;\n\t\t\t// Throttle mid-stream parses to keep total parse work bounded; the\n\t\t\t// authoritative full parse runs in `toolCallCompleted`.\n\t\t\tconst lastParseLen = target[kStreamingLastParseLen] ?? 0;\n\t\t\tif (nextBuffer.length - lastParseLen >= STREAMING_ARGS_REPARSE_DELTA) {\n\t\t\t\ttarget.arguments = parseStreamingJson(nextBuffer);\n\t\t\t\ttarget[kStreamingLastParseLen] = nextBuffer.length;\n\t\t\t}\n\t\t\tconst idx = output.content.indexOf(target);\n\t\t\tstream.push({ type: \"toolcall_delta\", contentIndex: idx, delta: chunk, partial: output });\n\t\t}\n\t} else if (updateCase === \"toolCallCompleted\") {\n\t\t// Correlate on the envelope's `call_id`, NOT the block id: MCP, Pi and\n\t\t// SCM blocks are filed under the id inside the call's `args`, and that\n\t\t// need not equal the envelope id.\n\t\tconst settled = resolveStreamedCall(state, update.message.value.callId);\n\t\tif (settled) {\n\t\t\tconst toolCall = update.message.value.toolCall;\n\t\t\tif (settled[kStreamingBlockKind] === \"mcp\") {\n\t\t\t\t// Authoritative full parse of the accumulated argument buffer.\n\t\t\t\tconst partial = settled[kStreamingPartialJson];\n\t\t\t\tif (partial !== undefined) {\n\t\t\t\t\tsettled.arguments = parseStreamingJson(partial);\n\t\t\t\t}\n\t\t\t\tconst decodedArgs = decodeMcpArgsMap(selectMcpCall(toolCall)?.args?.args);\n\t\t\t\tsettled.arguments = mergeCursorMcpToolCallArgs(\n\t\t\t\t\tsettled.arguments as Record<string, unknown> | undefined,\n\t\t\t\t\tdecodedArgs,\n\t\t\t\t);\n\t\t\t} else if (settled[kStreamingBlockKind] === \"connect-scm\") {\n\t\t\t\t// The authoritative outcome arrives only here. Late args are merged\n\t\t\t\t// too — a start frame may announce the call before the target\n\t\t\t\t// repository is known.\n\t\t\t\tconst scmCall = selectConnectScmCall(toolCall);\n\t\t\t\tconst repository = selectConnectScmRepository(scmCall);\n\t\t\t\tif (repository) {\n\t\t\t\t\tsettled.arguments = { owner: repository.owner, repo: repository.repo };\n\t\t\t\t}\n\t\t\t\tconst { text, isError } = describeConnectScmResult(scmCall);\n\t\t\t\tvoid state.onToolResult?.({\n\t\t\t\t\trole: \"toolResult\",\n\t\t\t\t\ttoolCallId: settled.id,\n\t\t\t\t\ttoolName: \"connect_scm\",\n\t\t\t\t\tcontent: [{ type: \"text\", text }],\n\t\t\t\t\tisError,\n\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t});\n\t\t\t} else if (settled[kStreamingBlockKind] === \"todo\") {\n\t\t\t\t// Only the server's success snapshot is authoritative. A completion\n\t\t\t\t// frame whose optional `toolCall` is absent still settles: the block\n\t\t\t\t// is already marked resolved, so nothing downstream pairs it.\n\t\t\t\tconst snapshot = toolCall ? extractTodoSnapshot(toolCall) : null;\n\t\t\t\tconst error = toolCall ? extractTodoError(toolCall) : null;\n\t\t\t\tif (snapshot) {\n\t\t\t\t\tsettled.arguments = { todos: snapshot.todos, merged: snapshot.merged };\n\t\t\t\t}\n\t\t\t\tvoid state.onToolResult?.(buildTodoToolResult(settled.id, snapshot, error));\n\t\t\t}\n\t\t\tconst idx = output.content.indexOf(settled);\n\t\t\tclearStreamingPartialJson(settled);\n\t\t\tstream.push({ type: \"toolcall_end\", contentIndex: idx, toolCall: settled, partial: output });\n\t\t\treleaseStreamedCall(state, settled);\n\t\t}\n\t} else if (updateCase === \"turnEnded\") {\n\t\toutput.stopReason = \"stop\";\n\t\tapplyBilledTurnEndedUsage(update.message.value, output, usageState);\n\t} else if (updateCase === \"tokenDelta\") {\n\t\tconst tokenDelta = update.message.value;\n\t\tusageState.sawTokenDelta = true;\n\t\toutput.usage.output += tokenDelta.tokens || 0;\n\t\toutput.usage.totalTokens =\n\t\t\toutput.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;\n\t}\n}\n\n/**\n * Cursor's production schema (cursor-agent 2026.08.11) carries the billed\n * token split on `turnEnded`: 1 input, 2 output, 3 cache read, 4 cache write,\n * 5 reasoning (optional int64). Live probes against api2.cursor.sh show\n * input_tokens is cache-INCLUSIVE (turn 1: input 21357 ≈ cacheWrite 21354;\n * turn 2: input 17989 ≈ cacheRead 17575 + cacheWrite 411), so the uncached\n * remainder is backed out for senpi's exclusive `usage.input`. The billed\n * split is authoritative for context accounting; the tokenDelta-accumulated\n * output is kept only when the server omits the billed output field.\n * Reasoning tokens are deliberately not folded into output: no other field of\n * `Usage` represents them and double counting against the billed output must\n * be avoided.\n */\nfunction applyBilledTurnEndedUsage(update: TurnEndedUpdate, output: AssistantMessage, usageState: UsageState): void {\n\tconst { inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens } = update;\n\tif (\n\t\tinputTokens === undefined &&\n\t\toutputTokens === undefined &&\n\t\tcacheReadTokens === undefined &&\n\t\tcacheWriteTokens === undefined\n\t) {\n\t\treturn;\n\t}\n\tusageState.sawTurnEndedUsage = true;\n\tconst usage = output.usage;\n\tusage.cacheRead = Number(cacheReadTokens ?? 0n);\n\tusage.cacheWrite = Number(cacheWriteTokens ?? 0n);\n\tusage.input = Math.max(0, Number(inputTokens ?? 0n) - usage.cacheRead - usage.cacheWrite);\n\tif (outputTokens !== undefined) {\n\t\tusage.output = Number(outputTokens);\n\t}\n\tusage.totalTokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;\n}\n\n/**\n * A checkpoint's `tokenDetails.usedTokens` is the server's live conversation\n * size, sent mid-turn. It feeds context accounting while the turn streams,\n * but never overrides the billed turnEnded split once that arrived.\n */\nfunction applyCheckpointTokenDetails(\n\tcheckpoint: ConversationStateStructure,\n\toutput: AssistantMessage,\n\tusageState: UsageState,\n): void {\n\tif (usageState.sawTurnEndedUsage) return;\n\tconst usedTokens = checkpoint.tokenDetails?.usedTokens ?? 0;\n\tif (usedTokens <= 0) return;\n\tconst usage = output.usage;\n\tusage.input = Math.max(0, usedTokens - usage.output - usage.cacheRead - usage.cacheWrite);\n\tusage.totalTokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;\n}\n\nfunction createBlobId(data: Uint8Array): Uint8Array {\n\treturn new Uint8Array(createHash(\"sha256\").update(data).digest());\n}\n\nfunction storeCursorBlob(blobStore: Map<string, Uint8Array>, data: Uint8Array): Uint8Array {\n\tconst blobId = createBlobId(data);\n\tblobStore.set(Buffer.from(blobId).toString(\"hex\"), data);\n\treturn blobId;\n}\n\nfunction readCursorBlob(blobStore: Map<string, Uint8Array>, blobId: Uint8Array): Uint8Array {\n\tconst data = blobStore.get(Buffer.from(blobId).toString(\"hex\"));\n\tif (!data) {\n\t\tthrow new Error(\"Cursor blob not found\");\n\t}\n\treturn data;\n}\n\n/**\n * Local tools Cursor already drives natively over the exec channel, so\n * advertising them again as MCP tools would give the model two ways to call\n * the same thing.\n */\nconst CURSOR_NATIVE_TOOL_NAMES = new Set([\"bash\", \"read\", \"write\", \"delete\", \"ls\", \"grep\", \"todo\"]);\n\n/** Strip TypeBox symbol metadata down to a plain JSON Schema document. */\nfunction toolParametersToJsonSchema(tool: Tool): unknown {\n\ttry {\n\t\treturn JSON.parse(JSON.stringify(tool.parameters));\n\t} catch {\n\t\treturn { type: \"object\", properties: {}, required: [] };\n\t}\n}\n\n/**\n * JSON-Schema composition keywords Cursor's gateway cannot carry: an\n * advertised tool whose inputSchema contains `oneOf`, `anyOf`, or `allOf` is\n * rejected upstream with a wrapped provider 400 for the WHOLE request\n * (zero tokens, `resource_exhausted` end-stream). MCP tools imported from\n * external servers routinely ship such schemas (e.g. ast-grep's `scan`).\n * `not` is tolerated upstream and kept. Returns a new structure; the input is\n * never mutated.\n */\nconst CURSOR_UNSUPPORTED_SCHEMA_KEYS = new Set([\"oneOf\", \"anyOf\", \"allOf\"]);\n\nexport function sanitizeCursorToolSchema(schema: unknown): unknown {\n\tif (Array.isArray(schema)) return schema.map(sanitizeCursorToolSchema);\n\tif (schema === null || typeof schema !== \"object\") return schema;\n\tconst sanitized: Record<string, unknown> = {};\n\tfor (const [key, value] of Object.entries(schema)) {\n\t\tif (CURSOR_UNSUPPORTED_SCHEMA_KEYS.has(key)) continue;\n\t\tsanitized[key] = sanitizeCursorToolSchema(value);\n\t}\n\treturn sanitized;\n}\n\nexport function buildMcpToolDefinitions(tools: Tool[] | undefined): McpToolDefinition[] {\n\tif (!tools || tools.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst advertisedTools = tools.filter((tool) => !CURSOR_NATIVE_TOOL_NAMES.has(tool.name));\n\tif (advertisedTools.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn advertisedTools.map((tool) => {\n\t\tconst jsonSchema = sanitizeCursorToolSchema(toolParametersToJsonSchema(tool));\n\t\tconst schemaValue: PbJsonValue =\n\t\t\tjsonSchema && typeof jsonSchema === \"object\"\n\t\t\t\t? (jsonSchema as PbJsonValue)\n\t\t\t\t: { type: \"object\", properties: {}, required: [] };\n\t\tconst inputSchema = toBinary(ValueSchema, fromJson(ValueSchema, schemaValue));\n\t\treturn create(McpToolDefinitionSchema, {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description || \"\",\n\t\t\tproviderIdentifier: \"pi-agent\",\n\t\t\ttoolName: tool.name,\n\t\t\tinputSchema,\n\t\t});\n\t});\n}\n\n/** Extract text content from a user message. */\nfunction extractUserMessageText(msg: Message): string {\n\tif (msg.role !== \"user\") return \"\";\n\tconst content = msg.content;\n\tif (typeof content === \"string\") return content.trim();\n\tconst text = content\n\t\t.filter((c): c is TextContent => c.type === \"text\")\n\t\t.map((c) => c.text)\n\t\t.join(\"\\n\");\n\treturn text.trim();\n}\n\nfunction hasUserMessageImages(msg: Message): boolean {\n\treturn msg.role === \"user\" && Array.isArray(msg.content) && msg.content.some((item) => item.type === \"image\");\n}\n\ntype CursorRootPromptContentPart = { type: \"text\"; text: string } | { type: \"image\"; image: string; mediaType: string };\n\nfunction buildCursorRootPromptContent(content: string | (TextContent | ImageContent)[]): CursorRootPromptContentPart[] {\n\tif (typeof content === \"string\") {\n\t\tconst text = content.trim();\n\t\treturn text ? [{ type: \"text\", text }] : [];\n\t}\n\tconst parts: CursorRootPromptContentPart[] = [];\n\tfor (const item of content) {\n\t\tif (item.type === \"text\") {\n\t\t\tconst text = item.text.trim();\n\t\t\tif (text) {\n\t\t\t\tparts.push({ type: \"text\", text });\n\t\t\t}\n\t\t} else {\n\t\t\tparts.push({ type: \"image\", image: `data:${item.mimeType};base64,${item.data}`, mediaType: item.mimeType });\n\t\t}\n\t}\n\treturn parts;\n}\n\nfunction cursorUserContentKey(content: string | (TextContent | ImageContent)[]): string {\n\tif (typeof content === \"string\") {\n\t\treturn content.trim();\n\t}\n\tconst hash = createHash(\"sha256\");\n\tfor (const item of content) {\n\t\thash.update(item.type);\n\t\tif (item.type === \"text\") {\n\t\t\thash.update(item.text);\n\t\t} else {\n\t\t\thash.update(item.mimeType);\n\t\t\thash.update(item.data);\n\t\t}\n\t}\n\treturn hash.digest(\"hex\");\n}\n\ntype CursorRootPromptAssistantContentPart =\n\t| { type: \"text\"; text: string }\n\t| { type: \"tool-call\"; toolCallId: string; toolName: string; args: Record<string, unknown> };\n\nfunction buildCursorAssistantContent(msg: AssistantMessage): CursorRootPromptAssistantContentPart[] {\n\tconst content: CursorRootPromptAssistantContentPart[] = [];\n\tfor (const item of msg.content) {\n\t\tif (item.type === \"text\") {\n\t\t\tif (item.text) content.push({ type: \"text\", text: item.text });\n\t\t} else if (item.type === \"toolCall\") {\n\t\t\tcontent.push({\n\t\t\t\ttype: \"tool-call\",\n\t\t\t\ttoolCallId: item.id,\n\t\t\t\ttoolName: item.name,\n\t\t\t\targs: item.arguments,\n\t\t\t});\n\t\t}\n\t\t// Thinking is never replayed: Cursor manages reasoning server-side and\n\t\t// foreign/hidden reasoning must not leak into history as native thinking.\n\t}\n\treturn content;\n}\n\n/**\n * Index of the last user message in `messages`, or -1 if none. Used to\n * exclude the current user turn from history builders — it goes in the\n * `userMessageAction`, not in history structures.\n */\nfunction findLastUserMessageIndex(messages: Message[]): number {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tif (messages[i].role === \"user\") {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * Build one Cursor system-message JSON blob per system prompt. When no system\n * prompt is provided, returns a single default greeting so we never emit an\n * empty `rootPromptMessagesJson` head.\n */\nexport function buildCursorSystemPromptJsons(systemPrompt: string | undefined): string[] {\n\tconst trimmed = systemPrompt?.trim();\n\tif (!trimmed) {\n\t\treturn [JSON.stringify({ role: \"system\", content: \"You are a helpful assistant.\" })];\n\t}\n\treturn [JSON.stringify({ role: \"system\", content: trimmed })];\n}\n\n/**\n * Build `ConversationStateStructure.rootPromptMessagesJson` blob IDs for the\n * system prompt plus prior conversation history, as JSON blobs matching\n * Cursor's internal Vercel-AI-SDK-shaped message format.\n *\n * Cursor's server uses `rootPromptMessagesJson` (not `turns[]`) to build the\n * actual model prompt; `turns[]` is UI/display metadata. The active user\n * message is excluded because it is sent in the action.\n */\nfunction buildRootPromptMessagesJson(\n\tmessages: Message[],\n\tsystemPromptIds: Uint8Array[],\n\tblobStore: Map<string, Uint8Array>,\n\tactiveUserMessageIndex = findLastUserMessageIndex(messages),\n): Uint8Array[] {\n\tconst entries: Uint8Array[] = [...systemPromptIds];\n\tconst pushJson = (obj: unknown) => {\n\t\tconst bytes = new TextEncoder().encode(JSON.stringify(obj));\n\t\tentries.push(storeCursorBlob(blobStore, bytes));\n\t};\n\n\tfor (let i = 0; i < messages.length; i++) {\n\t\tif (i === activeUserMessageIndex) break;\n\t\tconst msg = messages[i];\n\t\tif (msg.role === \"user\") {\n\t\t\tconst content = buildCursorRootPromptContent(msg.content);\n\t\t\tif (content.length === 0) continue;\n\t\t\tpushJson({ role: \"user\", content });\n\t\t} else if (msg.role === \"assistant\") {\n\t\t\tconst content = buildCursorAssistantContent(msg);\n\t\t\tif (content.length === 0) continue;\n\t\t\tpushJson({ role: \"assistant\", content });\n\t\t} else if (msg.role === \"toolResult\") {\n\t\t\t// Emit even when the result text is empty: the assistant `tool-call`\n\t\t\t// is already in history, so dropping the pair would replay an\n\t\t\t// orphaned call.\n\t\t\tpushJson({\n\t\t\t\trole: \"tool\",\n\t\t\t\tid: msg.toolCallId,\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\t\ttoolName: msg.toolName,\n\t\t\t\t\t\ttoolCallId: msg.toolCallId,\n\t\t\t\t\t\tresult: toolResultToText(msg),\n\t\t\t\t\t\t...(msg.isError ? { isError: true } : {}),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t});\n\t\t}\n\t}\n\n\treturn entries;\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\n\nfunction isJsonValue(value: unknown): value is PbJsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) return value.every(isJsonValue);\n\tif (!isPlainRecord(value)) return false;\n\tfor (const key in value) {\n\t\tif (!isJsonValue(value[key])) return false;\n\t}\n\treturn true;\n}\n\nfunction encodeCursorMcpArguments(toolCall: ToolCall): Record<string, Uint8Array> {\n\tconst encoded: Record<string, Uint8Array> = {};\n\tfor (const name in toolCall.arguments) {\n\t\tconst value = toolCall.arguments[name];\n\t\tif (value === undefined) continue;\n\t\tif (!isJsonValue(value)) {\n\t\t\tthrow new Error(`Cursor tool argument ${toolCall.name}.${name} is not JSON-serializable`);\n\t\t}\n\t\tencoded[name] = toBinary(ValueSchema, fromJson(ValueSchema, value));\n\t}\n\treturn encoded;\n}\n\nfunction createCursorMcpResult(result: ToolResultMessage) {\n\tif (result.isError) {\n\t\treturn create(McpToolResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"error\",\n\t\t\t\tvalue: create(McpToolErrorSchema, { error: toolResultToText(result) }),\n\t\t\t},\n\t\t});\n\t}\n\treturn create(McpToolResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(McpSuccessSchema, {\n\t\t\t\tcontent: result.content.map((item) =>\n\t\t\t\t\titem.type === \"text\"\n\t\t\t\t\t\t? create(McpToolResultContentItemSchema, {\n\t\t\t\t\t\t\t\tcontent: { case: \"text\", value: create(McpTextContentSchema, { text: item.text }) },\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: create(McpToolResultContentItemSchema, {\n\t\t\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t\t\tcase: \"image\",\n\t\t\t\t\t\t\t\t\tvalue: create(McpImageContentSchema, {\n\t\t\t\t\t\t\t\t\t\tdata: Uint8Array.from(Buffer.from(item.data, \"base64\")),\n\t\t\t\t\t\t\t\t\t\tmimeType: item.mimeType,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t}),\n\t\t},\n\t});\n}\n\nfunction createCursorToolCallStep(toolCall: ToolCall, result: ToolResultMessage | undefined) {\n\tconst mcpCall = create(McpToolCallSchema, {\n\t\targs: create(McpArgsSchema, {\n\t\t\tname: toolCall.name,\n\t\t\targs: encodeCursorMcpArguments(toolCall),\n\t\t\ttoolCallId: toolCall.id,\n\t\t\tproviderIdentifier: \"pi-agent\",\n\t\t\ttoolName: toolCall.name,\n\t\t}),\n\t\t...(result ? { result: createCursorMcpResult(result) } : {}),\n\t});\n\treturn create(ConversationStepSchema, {\n\t\tmessage: {\n\t\t\tcase: \"toolCall\",\n\t\t\tvalue: create(ToolCallSchema, {\n\t\t\t\ttool: { case: \"mcpToolCall\", value: mcpCall },\n\t\t\t\ttoolCallId: toolCall.id,\n\t\t\t}),\n\t\t},\n\t});\n}\n\n/**\n * Convert context.messages to Cursor's ConversationTurnStructure blob IDs.\n * Groups messages into turns: each turn is a user message followed by the\n * assistant's response. Excludes the active user message (which goes in the\n * action).\n */\nfunction buildConversationTurns(\n\tmessages: Message[],\n\tblobStore: Map<string, Uint8Array>,\n\tactiveUserMessageIndex = findLastUserMessageIndex(messages),\n): Uint8Array[] {\n\tconst turns: Uint8Array[] = [];\n\tconst historyEnd = activeUserMessageIndex >= 0 ? activeUserMessageIndex : messages.length;\n\tconst toolResults = new Map<string, ToolResultMessage>();\n\tconst pairedToolCallIds = new Set<string>();\n\tfor (let index = 0; index < historyEnd; index++) {\n\t\tconst message = messages[index];\n\t\tif (message.role === \"toolResult\") {\n\t\t\ttoolResults.set(message.toolCallId, message);\n\t\t} else if (message.role === \"assistant\") {\n\t\t\tfor (const item of message.content) {\n\t\t\t\tif (item.type === \"toolCall\") pairedToolCallIds.add(item.id);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet i = 0;\n\twhile (i < messages.length) {\n\t\tconst msg = messages[i];\n\t\tif (msg.role !== \"user\") {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (i === activeUserMessageIndex) break;\n\n\t\tconst userText = extractUserMessageText(msg);\n\t\tif (userText.length === 0 && !hasUserMessageImages(msg)) {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst userMessage = createCursorUserMessage(\n\t\t\tmsg.content,\n\t\t\tuserText,\n\t\t\tdeterministicUuid(`u:${turns.length}:${cursorUserContentKey(msg.content)}`),\n\t\t);\n\t\tconst userMessageBlobId = storeCursorBlob(blobStore, toBinary(UserMessageSchema, userMessage));\n\t\tconst stepBlobIds: Uint8Array[] = [];\n\t\ti++;\n\n\t\twhile (i < messages.length && messages[i].role !== \"user\") {\n\t\t\tconst stepMsg = messages[i];\n\t\t\tif (stepMsg.role === \"assistant\") {\n\t\t\t\tfor (const item of stepMsg.content) {\n\t\t\t\t\tlet step: ConversationStep;\n\t\t\t\t\tif (item.type === \"text\") {\n\t\t\t\t\t\tif (!item.text) continue;\n\t\t\t\t\t\tstep = create(ConversationStepSchema, {\n\t\t\t\t\t\t\tmessage: {\n\t\t\t\t\t\t\t\tcase: \"assistantMessage\",\n\t\t\t\t\t\t\t\tvalue: create(AssistantMessageSchema, { text: item.text }),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (item.type === \"thinking\") {\n\t\t\t\t\t\t// Foreign/hidden reasoning never leaks into Cursor's turn\n\t\t\t\t\t\t// history as native thinking.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (item.type === \"toolCall\") {\n\t\t\t\t\t\tstep = createCursorToolCallStep(item, toolResults.get(item.id));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstepBlobIds.push(storeCursorBlob(blobStore, toBinary(ConversationStepSchema, step)));\n\t\t\t\t}\n\t\t\t} else if (stepMsg.role === \"toolResult\" && !pairedToolCallIds.has(stepMsg.toolCallId)) {\n\t\t\t\tconst text = toolResultToText(stepMsg);\n\t\t\t\tif (text) {\n\t\t\t\t\tconst prefix = stepMsg.isError ? \"[Tool Error]\" : \"[Tool Result]\";\n\t\t\t\t\tconst step = create(ConversationStepSchema, {\n\t\t\t\t\t\tmessage: {\n\t\t\t\t\t\t\tcase: \"assistantMessage\",\n\t\t\t\t\t\t\tvalue: create(AssistantMessageSchema, { text: `${prefix}\\n${text}` }),\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tstepBlobIds.push(storeCursorBlob(blobStore, toBinary(ConversationStepSchema, step)));\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\tconst agentTurn = create(AgentConversationTurnStructureSchema, {\n\t\t\tuserMessage: userMessageBlobId,\n\t\t\tsteps: stepBlobIds,\n\t\t});\n\t\tconst turn = create(ConversationTurnStructureSchema, {\n\t\t\tturn: {\n\t\t\t\tcase: \"agentConversationTurn\",\n\t\t\t\tvalue: agentTurn,\n\t\t\t},\n\t\t});\n\t\tturns.push(storeCursorBlob(blobStore, toBinary(ConversationTurnStructureSchema, turn)));\n\t}\n\n\treturn turns;\n}\n\n/** Exported for tests: decodes Cursor history blobs built from conversation messages. */\nexport function buildCursorHistoryForTest(\n\tmessages: Message[],\n\tactiveUserMessageIndex = findLastUserMessageIndex(messages),\n): {\n\trootPromptMessagesJson: unknown[];\n\tturnUserMessagesJson: unknown[];\n\tturnStepMessagesJson: unknown[][];\n} {\n\tconst blobStore = new Map<string, Uint8Array>();\n\tconst rootPromptMessagesJson = buildRootPromptMessagesJson(messages, [], blobStore, activeUserMessageIndex).map(\n\t\t(blobId) => JSON.parse(new TextDecoder().decode(readCursorBlob(blobStore, blobId))),\n\t);\n\tconst turnUserMessagesJson: unknown[] = [];\n\tconst turnStepMessagesJson: unknown[][] = [];\n\tfor (const turnBlobId of buildConversationTurns(messages, blobStore, activeUserMessageIndex)) {\n\t\tconst turn = fromBinary(ConversationTurnStructureSchema, readCursorBlob(blobStore, turnBlobId));\n\t\tif (turn.turn.case !== \"agentConversationTurn\") {\n\t\t\tcontinue;\n\t\t}\n\t\tconst userMessage = fromBinary(UserMessageSchema, readCursorBlob(blobStore, turn.turn.value.userMessage));\n\t\tturnUserMessagesJson.push(toJson(UserMessageSchema, userMessage));\n\t\tturnStepMessagesJson.push(\n\t\t\tturn.turn.value.steps.map((stepBlobId) => {\n\t\t\t\tconst step = fromBinary(ConversationStepSchema, readCursorBlob(blobStore, stepBlobId));\n\t\t\t\treturn toJson(ConversationStepSchema, step);\n\t\t\t}),\n\t\t);\n\t}\n\treturn { rootPromptMessagesJson, turnUserMessagesJson, turnStepMessagesJson };\n}\n\nfunction createCursorUserMessage(\n\tcontent: string | (TextContent | ImageContent)[],\n\ttext: string,\n\tmessageId = randomUUID() as string,\n) {\n\tconst images = typeof content === \"string\" ? [] : extractImages(content);\n\treturn create(UserMessageSchema, {\n\t\ttext,\n\t\tmessageId,\n\t\t...(images.length > 0\n\t\t\t? {\n\t\t\t\t\tselectedContext: create(SelectedContextSchema, {\n\t\t\t\t\t\tselectedImages: images,\n\t\t\t\t\t}),\n\t\t\t\t}\n\t\t\t: {}),\n\t});\n}\n\nfunction extractImages(content: (TextContent | ImageContent)[]) {\n\treturn content\n\t\t.filter((item): item is ImageContent => item.type === \"image\")\n\t\t.map((image) =>\n\t\t\tcreate(SelectedImageSchema, {\n\t\t\t\tuuid: randomUUID(),\n\t\t\t\tmimeType: image.mimeType,\n\t\t\t\tdataOrBlobId: {\n\t\t\t\t\tcase: \"data\",\n\t\t\t\t\tvalue: Uint8Array.from(Buffer.from(image.data, \"base64\")),\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n}\n\nasync function buildGrpcRequest(\n\tmodel: Model<\"cursor-agent\">,\n\tcontext: Context,\n\toptions: CursorAgentOptions | undefined,\n\tstate: {\n\t\tconversationId: string;\n\t\tblobStore: Map<string, Uint8Array>;\n\t\tconversationState?: ConversationStateStructure;\n\t},\n): Promise<{\n\trequestBytes: Uint8Array;\n\tblobStore: Map<string, Uint8Array>;\n\tconversationState: ConversationStateStructure;\n}> {\n\tconst blobStore = state.blobStore;\n\n\tconst systemPromptIds = buildCursorSystemPromptJsons(context.systemPrompt).map((json) =>\n\t\tstoreCursorBlob(blobStore, new TextEncoder().encode(json)),\n\t);\n\n\tconst activeUserMessageIndex = context.messages.length - 1;\n\tconst activeMessage = context.messages[activeUserMessageIndex];\n\tconst activeUserMessage = activeMessage?.role === \"user\" ? activeMessage : undefined;\n\tlet userContent: string | (TextContent | ImageContent)[] | undefined;\n\tlet userText = \"\";\n\tlet hasUserImages = false;\n\tif (activeUserMessage) {\n\t\tuserContent = activeUserMessage.content;\n\t\tif (typeof userContent === \"string\") {\n\t\t\tuserText = userContent.trim();\n\t\t} else {\n\t\t\tuserText = extractText(userContent);\n\t\t\thasUserImages = hasImages(userContent);\n\t\t}\n\t}\n\n\tconst action = create(ConversationActionSchema, {\n\t\taction:\n\t\t\tuserContent && (userText.trim().length > 0 || hasUserImages)\n\t\t\t\t? {\n\t\t\t\t\t\tcase: \"userMessageAction\",\n\t\t\t\t\t\tvalue: create(UserMessageActionSchema, {\n\t\t\t\t\t\t\tuserMessage: createCursorUserMessage(userContent, userText),\n\t\t\t\t\t\t}),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tcase: \"resumeAction\",\n\t\t\t\t\t\tvalue: create(ResumeActionSchema, {}),\n\t\t\t\t\t},\n\t});\n\n\t// Build conversation turns from prior messages, excluding only the active\n\t// user message when the request is sending one. Resume actions must\n\t// preserve trailing tool results.\n\tconst turns = buildConversationTurns(context.messages, blobStore, activeUserMessage ? activeUserMessageIndex : -1);\n\n\t// Cursor's server uses `rootPromptMessagesJson` (not `turns[]`) to build\n\t// the actual model prompt; without it multi-turn conversations lose prior\n\t// context.\n\tconst rootPromptMessagesJson = buildRootPromptMessagesJson(\n\t\tcontext.messages,\n\t\tsystemPromptIds,\n\t\tblobStore,\n\t\tactiveUserMessage ? activeUserMessageIndex : -1,\n\t);\n\n\t// Preserve cached non-history state fields (todos, file states, summaries)\n\t// when the system prompt is unchanged; otherwise start fresh.\n\tconst cachedPromptHead = state.conversationState?.rootPromptMessagesJson?.slice(0, systemPromptIds.length) ?? [];\n\tconst hasMatchingPrompt =\n\t\tcachedPromptHead.length === systemPromptIds.length &&\n\t\tsystemPromptIds.every((id, idx) => Buffer.from(cachedPromptHead[idx]).equals(id));\n\tconst baseState =\n\t\tstate.conversationState && hasMatchingPrompt\n\t\t\t? state.conversationState\n\t\t\t: create(ConversationStateStructureSchema, {\n\t\t\t\t\trootPromptMessagesJson: systemPromptIds,\n\t\t\t\t\tturns: [],\n\t\t\t\t\ttodos: [],\n\t\t\t\t\tpendingToolCalls: [],\n\t\t\t\t\tpreviousWorkspaceUris: [],\n\t\t\t\t\tfileStates: {},\n\t\t\t\t\tfileStatesV2: {},\n\t\t\t\t\tsummaryArchives: [],\n\t\t\t\t\tturnTimings: [],\n\t\t\t\t\tsubagentStates: {},\n\t\t\t\t\tselfSummaryCount: 0,\n\t\t\t\t\treadPaths: [],\n\t\t\t\t});\n\n\t// Always override `rootPromptMessagesJson` and `turns` with content freshly\n\t// built from `context.messages`: the server-echoed checkpoint replaces\n\t// historical user entries with empty placeholders.\n\tconst conversationState = create(ConversationStateStructureSchema, {\n\t\t...baseState,\n\t\trootPromptMessagesJson,\n\t\tturns,\n\t});\n\n\tconst requestedModel = buildRequestedModel(model, options?.thinkingSelection);\n\tconst wireModelId = requestedModel.modelId;\n\tconst cursorMaxMode = model.compat?.cursorMaxMode === true;\n\tconst modelDetails = create(ModelDetailsSchema, {\n\t\tmodelId: wireModelId,\n\t\tdisplayModelId: model.id,\n\t\tdisplayName: model.name,\n\t\t...(cursorMaxMode ? { maxMode: true } : undefined),\n\t});\n\n\tconst runRequest = create(AgentRunRequestSchema, {\n\t\tconversationState,\n\t\taction,\n\t\tmodelDetails,\n\t\trequestedModel,\n\t\tconversationId: state.conversationId,\n\t});\n\n\tif (options?.customSystemPrompt) {\n\t\trunRequest.customSystemPrompt = options.customSystemPrompt;\n\t}\n\n\tawait options?.onPayload?.(runRequest, model as Model<Api>);\n\n\tconst clientMessage = create(AgentClientMessageSchema, {\n\t\tmessage: { case: \"runRequest\", value: runRequest },\n\t});\n\n\tconst requestBytes = toBinary(AgentClientMessageSchema, clientMessage);\n\n\tlog(\"info\", \"builtRunRequest\", {\n\t\tbytes: requestBytes.length,\n\t\ttools: context.tools?.length ?? 0,\n\t});\n\n\treturn { requestBytes, blobStore, conversationState };\n}\n\nfunction hasImages(content: (TextContent | ImageContent)[]): boolean {\n\treturn content.some((item) => item.type === \"image\");\n}\n\nfunction extractText(content: (TextContent | ImageContent)[]): string {\n\treturn content\n\t\t.filter((c): c is TextContent => c.type === \"text\")\n\t\t.map((c) => c.text)\n\t\t.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Model discovery (GetUsableModels)\n// ---------------------------------------------------------------------------\n\nconst CURSOR_GET_USABLE_MODELS_PATH = \"/agent.v1.AgentService/GetUsableModels\";\nconst CURSOR_DEFAULT_CONTEXT_WINDOW = 200_000;\nconst CURSOR_DEFAULT_MAX_TOKENS = 64_000;\n/**\n * `GetUsableModels` carries no context-window field, so the 1M ceiling is\n * recovered from the signals Cursor does send: display-name \"1M\" labels and\n * the max-mode flag on Claude/Gemini families.\n */\nconst CURSOR_1M_CONTEXT_WINDOW = 1_000_000;\nconst CURSOR_1M_NAME_PATTERN = /\\b1m\\b/i;\nconst CURSOR_MAX_MODE_1M_ID_PATTERN = /claude|gemini/;\n/**\n * Model-id families whose native catalogs are multimodal. Cursor-only or\n * text-only families (`composer-*`, `grok-code-*`) stay outside this pattern.\n */\nconst CURSOR_MULTIMODAL_ID_PATTERN = /claude|gemini|gpt-|codex/;\n\nexport interface CursorDiscoveredModel {\n\tid: string;\n\tname: string;\n\treasoning: boolean;\n\tinput: (\"text\" | \"image\")[];\n\tcontextWindow: number;\n\tmaxTokens: number;\n\tcursorMaxMode: boolean;\n}\n\n/**\n * Fetches Cursor models through `GetUsableModels` (unary protobuf over\n * HTTP/2; the ALB rejects HTTP/1.1 with 464) and normalizes them.\n *\n * Returns `null` on request/decode failures; `[]` only when the endpoint\n * responds successfully with no usable models.\n */\nexport async function fetchCursorUsableModels(options: {\n\tapiKey: string;\n\tbaseUrl?: string;\n\ttimeoutMs?: number;\n\tsignal?: AbortSignal;\n}): Promise<CursorDiscoveredModel[] | null> {\n\tconst timeoutMs = options.timeoutMs ?? 10_000;\n\ttry {\n\t\tconst requestPayload = create(GetUsableModelsRequestSchema, { customModelIds: [] });\n\t\tconst body = toBinary(GetUsableModelsRequestSchema, requestPayload);\n\t\tconst baseUrl = (options.baseUrl ?? CURSOR_API_URL).replace(/\\/+$/, \"\");\n\n\t\tconst responseBuffer = await new Promise<Uint8Array | null>((resolve) => {\n\t\t\tconst client = http2.connect(baseUrl);\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tclient.destroy();\n\t\t\t\tresolve(null);\n\t\t\t}, timeoutMs);\n\t\t\tconst abort = () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tclient.destroy();\n\t\t\t\tresolve(null);\n\t\t\t};\n\t\t\toptions.signal?.addEventListener(\"abort\", abort, { once: true });\n\n\t\t\tclient.on(\"error\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(null);\n\t\t\t});\n\n\t\t\tconst req = client.request({\n\t\t\t\t\":method\": \"POST\",\n\t\t\t\t\":path\": CURSOR_GET_USABLE_MODELS_PATH,\n\t\t\t\t\"content-type\": \"application/proto\",\n\t\t\t\tte: \"trailers\",\n\t\t\t\tauthorization: `Bearer ${options.apiKey}`,\n\t\t\t\t\"x-ghost-mode\": \"true\",\n\t\t\t\t\"x-cursor-client-version\": CURSOR_CLIENT_VERSION,\n\t\t\t\t\"x-cursor-client-type\": \"cli\",\n\t\t\t});\n\n\t\t\tconst chunks: Buffer[] = [];\n\t\t\treq.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n\t\t\treq.on(\"end\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tclient.close();\n\t\t\t\tresolve(new Uint8Array(Buffer.concat(chunks)));\n\t\t\t});\n\t\t\treq.on(\"error\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tclient.close();\n\t\t\t\tresolve(null);\n\t\t\t});\n\t\t\treq.on(\"response\", (headers) => {\n\t\t\t\tconst status = Number(headers[\":status\"] ?? 0);\n\t\t\t\tif (status < 200 || status >= 300) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tclient.close();\n\t\t\t\t\tresolve(null);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (body.length > 0) {\n\t\t\t\treq.end(Buffer.from(body));\n\t\t\t} else {\n\t\t\t\treq.end();\n\t\t\t}\n\t\t});\n\n\t\tif (!responseBuffer || responseBuffer.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst decoded = decodeGetUsableModelsResponse(responseBuffer);\n\t\tif (!decoded) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst byId = new Map<string, CursorDiscoveredModel>();\n\t\tfor (const model of decoded.models ?? []) {\n\t\t\tconst id = model.modelId?.trim();\n\t\t\tif (!id) continue;\n\t\t\tconst name = pickModelDisplayName(model, id);\n\t\t\tconst labeled1M =\n\t\t\t\tCURSOR_1M_NAME_PATTERN.test(id) ||\n\t\t\t\t[model.displayName, model.displayNameShort, model.displayModelId, ...(model.aliases ?? [])].some(\n\t\t\t\t\t(candidate) => typeof candidate === \"string\" && CURSOR_1M_NAME_PATTERN.test(candidate),\n\t\t\t\t);\n\t\t\tconst maxMode = model.maxMode === true;\n\t\t\tconst contextWindow =\n\t\t\t\tlabeled1M || (maxMode && CURSOR_MAX_MODE_1M_ID_PATTERN.test(id))\n\t\t\t\t\t? CURSOR_1M_CONTEXT_WINDOW\n\t\t\t\t\t: CURSOR_DEFAULT_CONTEXT_WINDOW;\n\t\t\tbyId.set(id, {\n\t\t\t\tid,\n\t\t\t\tname,\n\t\t\t\treasoning: Boolean(model.thinkingDetails),\n\t\t\t\tinput: CURSOR_MULTIMODAL_ID_PATTERN.test(id.toLowerCase()) ? [\"text\", \"image\"] : [\"text\"],\n\t\t\t\tcontextWindow,\n\t\t\t\tmaxTokens: CURSOR_DEFAULT_MAX_TOKENS,\n\t\t\t\tcursorMaxMode: maxMode,\n\t\t\t});\n\t\t}\n\t\treturn [...byId.values()].sort((a, b) => a.id.localeCompare(b.id));\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction decodeGetUsableModelsResponse(payload: Uint8Array) {\n\tconst framedBody = decodeConnectUnaryBody(payload);\n\tif (framedBody) {\n\t\ttry {\n\t\t\treturn fromBinary(GetUsableModelsResponseSchema, framedBody);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\ttry {\n\t\treturn fromBinary(GetUsableModelsResponseSchema, payload);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction decodeConnectUnaryBody(payload: Uint8Array): Uint8Array | null {\n\tif (payload.length < 5) {\n\t\treturn null;\n\t}\n\n\tlet offset = 0;\n\twhile (offset + 5 <= payload.length) {\n\t\tconst flags = payload[offset];\n\t\tconst view = new DataView(payload.buffer, payload.byteOffset + offset, payload.byteLength - offset);\n\t\tconst messageLength = view.getUint32(1, false);\n\t\tconst frameEnd = offset + 5 + messageLength;\n\t\tif (frameEnd > payload.length) {\n\t\t\treturn null;\n\t\t}\n\t\tconst compressionFlagSet = (flags & 0b0000_0001) !== 0;\n\t\tif (compressionFlagSet) {\n\t\t\treturn null;\n\t\t}\n\t\tconst endStreamFlagSet = (flags & 0b0000_0010) !== 0;\n\t\tif (!endStreamFlagSet) {\n\t\t\treturn payload.subarray(offset + 5, frameEnd);\n\t\t}\n\n\t\toffset = frameEnd;\n\t}\n\n\treturn null;\n}\n\nfunction pickModelDisplayName(\n\tmodel: { displayName?: string; displayNameShort?: string; displayModelId?: string; aliases?: string[] },\n\tfallbackId: string,\n): string {\n\tconst candidates = [model.displayName, model.displayNameShort, model.displayModelId, ...(model.aliases ?? [])];\n\tfor (const candidate of candidates) {\n\t\tif (typeof candidate !== \"string\") {\n\t\t\tcontinue;\n\t\t}\n\t\tconst trimmed = candidate.trim();\n\t\tif (trimmed) {\n\t\t\treturn trimmed;\n\t\t}\n\t}\n\treturn fallbackId;\n}\n"]}