@code-yeongyu/senpi 2026.8.16 → 2026.8.17

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 (625) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/bun/cli.js +1 -0
  3. package/dist/bun/cli.js.map +1 -1
  4. package/dist/bun/register-cursor-agent.d.ts +2 -0
  5. package/dist/bun/register-cursor-agent.d.ts.map +1 -0
  6. package/dist/bun/register-cursor-agent.js +4 -0
  7. package/dist/bun/register-cursor-agent.js.map +1 -0
  8. package/dist/core/agent-session-services.js +2 -2
  9. package/dist/core/agent-session-services.js.map +1 -1
  10. package/dist/core/agent-session.d.ts +48 -5
  11. package/dist/core/agent-session.d.ts.map +1 -1
  12. package/dist/core/agent-session.js +239 -61
  13. package/dist/core/agent-session.js.map +1 -1
  14. package/dist/core/cursor-exec-bridge-session.d.ts +11 -0
  15. package/dist/core/cursor-exec-bridge-session.d.ts.map +1 -0
  16. package/dist/core/cursor-exec-bridge-session.js +17 -0
  17. package/dist/core/cursor-exec-bridge-session.js.map +1 -0
  18. package/dist/core/cursor-exec-bridge.d.ts +52 -0
  19. package/dist/core/cursor-exec-bridge.d.ts.map +1 -0
  20. package/dist/core/cursor-exec-bridge.js +196 -0
  21. package/dist/core/cursor-exec-bridge.js.map +1 -0
  22. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts +28 -0
  23. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts.map +1 -0
  24. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +278 -0
  25. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -0
  26. package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts +38 -0
  27. package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -0
  28. package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js +75 -0
  29. package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js.map +1 -0
  30. package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts +24 -0
  31. package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts.map +1 -0
  32. package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js +64 -0
  33. package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js.map +1 -0
  34. package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts +139 -0
  35. package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts.map +1 -0
  36. package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js +362 -0
  37. package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js.map +1 -0
  38. package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts +19 -0
  39. package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts.map +1 -0
  40. package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js +122 -0
  41. package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js.map +1 -0
  42. package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts +30 -0
  43. package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts.map +1 -0
  44. package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js +117 -0
  45. package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js.map +1 -0
  46. package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts +39 -0
  47. package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts.map +1 -0
  48. package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js +155 -0
  49. package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js.map +1 -0
  50. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts +89 -0
  51. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -0
  52. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js +147 -0
  53. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -0
  54. package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts +20 -0
  55. package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts.map +1 -0
  56. package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js +99 -0
  57. package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js.map +1 -0
  58. package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts +25 -0
  59. package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts.map +1 -0
  60. package/dist/core/extensions/builtin/cursor-cli-oauth/index.js +67 -0
  61. package/dist/core/extensions/builtin/cursor-cli-oauth/index.js.map +1 -0
  62. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts +27 -0
  63. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -0
  64. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +242 -0
  65. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -0
  66. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts +73 -0
  67. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts.map +1 -0
  68. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js +330 -0
  69. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -0
  70. package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts +94 -0
  71. package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts.map +1 -0
  72. package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js +248 -0
  73. package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js.map +1 -0
  74. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts +35 -0
  75. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -0
  76. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +186 -0
  77. package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -0
  78. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts +11 -0
  79. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts.map +1 -0
  80. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js +17 -0
  81. package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js.map +1 -0
  82. package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts +104 -0
  83. package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts.map +1 -0
  84. package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js +301 -0
  85. package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js.map +1 -0
  86. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts +26 -0
  87. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts.map +1 -0
  88. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js +587 -0
  89. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -0
  90. package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts +43 -0
  91. package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts.map +1 -0
  92. package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js +196 -0
  93. package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js.map +1 -0
  94. package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts +9 -0
  95. package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts.map +1 -0
  96. package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js +18 -0
  97. package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js.map +1 -0
  98. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  99. package/dist/core/extensions/builtin/goal/monitor-continuation.js +10 -9
  100. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  101. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  102. package/dist/core/extensions/builtin/index.js +5 -2
  103. package/dist/core/extensions/builtin/index.js.map +1 -1
  104. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
  105. package/dist/core/extensions/builtin/loop-guard/detectors.js +21 -3
  106. package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -1
  107. package/dist/core/extensions/builtin/loop-guard/escalation.d.ts +24 -0
  108. package/dist/core/extensions/builtin/loop-guard/escalation.d.ts.map +1 -0
  109. package/dist/core/extensions/builtin/loop-guard/escalation.js +77 -0
  110. package/dist/core/extensions/builtin/loop-guard/escalation.js.map +1 -0
  111. package/dist/core/extensions/builtin/loop-guard/index.d.ts.map +1 -1
  112. package/dist/core/extensions/builtin/loop-guard/index.js +98 -3
  113. package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -1
  114. package/dist/core/extensions/builtin/loop-guard/notice.d.ts +9 -0
  115. package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -1
  116. package/dist/core/extensions/builtin/loop-guard/notice.js +17 -0
  117. package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
  118. package/dist/core/extensions/builtin/loop-guard/policy.d.ts +4 -0
  119. package/dist/core/extensions/builtin/loop-guard/policy.d.ts.map +1 -1
  120. package/dist/core/extensions/builtin/loop-guard/policy.js +4 -0
  121. package/dist/core/extensions/builtin/loop-guard/policy.js.map +1 -1
  122. package/dist/core/extensions/builtin/loop-guard/renderer.d.ts +2 -0
  123. package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/loop-guard/renderer.js +11 -0
  125. package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -1
  126. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts +1 -1
  127. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -1
  128. package/dist/core/extensions/builtin/loop-guard/tracker.js +3 -1
  129. package/dist/core/extensions/builtin/loop-guard/tracker.js.map +1 -1
  130. package/dist/core/extensions/builtin/monitor-state-event.d.ts +6 -0
  131. package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
  132. package/dist/core/extensions/builtin/monitor-state-event.js +10 -0
  133. package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
  134. package/dist/core/model-resolver.js +1 -1
  135. package/dist/core/model-resolver.js.map +1 -1
  136. package/dist/core/model-runtime.d.ts +7 -2
  137. package/dist/core/model-runtime.d.ts.map +1 -1
  138. package/dist/core/model-runtime.js +14 -2
  139. package/dist/core/model-runtime.js.map +1 -1
  140. package/dist/core/prompt-templates.d.ts +5 -0
  141. package/dist/core/prompt-templates.d.ts.map +1 -1
  142. package/dist/core/prompt-templates.js +8 -9
  143. package/dist/core/prompt-templates.js.map +1 -1
  144. package/dist/core/provider-display-names.d.ts.map +1 -1
  145. package/dist/core/provider-display-names.js +1 -0
  146. package/dist/core/provider-display-names.js.map +1 -1
  147. package/dist/core/sdk.d.ts.map +1 -1
  148. package/dist/core/sdk.js +6 -0
  149. package/dist/core/sdk.js.map +1 -1
  150. package/dist/modes/interactive/editor-paste-transfer.d.ts +10 -0
  151. package/dist/modes/interactive/editor-paste-transfer.d.ts.map +1 -1
  152. package/dist/modes/interactive/editor-paste-transfer.js +16 -0
  153. package/dist/modes/interactive/editor-paste-transfer.js.map +1 -1
  154. package/dist/modes/interactive/interactive-mode.js +2 -2
  155. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  156. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  157. package/dist/modes/rpc/connection-handler.js +32 -27
  158. package/dist/modes/rpc/connection-handler.js.map +1 -1
  159. package/dist/modes/rpc/jsonl.d.ts +6 -1
  160. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  161. package/dist/modes/rpc/jsonl.js +47 -14
  162. package/dist/modes/rpc/jsonl.js.map +1 -1
  163. package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
  164. package/dist/modes/rpc/multi-session-host.js +26 -4
  165. package/dist/modes/rpc/multi-session-host.js.map +1 -1
  166. package/dist/modes/rpc/rpc-command-invocation.d.ts +5 -0
  167. package/dist/modes/rpc/rpc-command-invocation.d.ts.map +1 -0
  168. package/dist/modes/rpc/rpc-command-invocation.js +2 -0
  169. package/dist/modes/rpc/rpc-command-invocation.js.map +1 -0
  170. package/dist/modes/rpc/rpc-command-surface.d.ts +49 -0
  171. package/dist/modes/rpc/rpc-command-surface.d.ts.map +1 -0
  172. package/dist/modes/rpc/rpc-command-surface.js +40 -0
  173. package/dist/modes/rpc/rpc-command-surface.js.map +1 -0
  174. package/dist/modes/rpc/rpc-input-validation.d.ts +4 -0
  175. package/dist/modes/rpc/rpc-input-validation.d.ts.map +1 -0
  176. package/dist/modes/rpc/rpc-input-validation.js +20 -0
  177. package/dist/modes/rpc/rpc-input-validation.js.map +1 -0
  178. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  179. package/dist/modes/rpc/rpc-mode.js +12 -1
  180. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  181. package/dist/modes/rpc/rpc-types.d.ts +12 -12
  182. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  183. package/dist/modes/rpc/rpc-types.js.map +1 -1
  184. package/docs/providers.md +50 -1
  185. package/docs/rpc.md +78 -6
  186. package/docs/skills.md +14 -3
  187. package/node_modules/@bufbuild/protobuf/README.md +44 -0
  188. package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.d.ts +6 -0
  189. package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.js +66 -0
  190. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.d.ts +1 -0
  191. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.js +18 -0
  192. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.d.ts +10 -0
  193. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.js +31 -0
  194. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.d.ts +9 -0
  195. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.js +28 -0
  196. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.d.ts +1 -0
  197. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.js +18 -0
  198. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.d.ts +10 -0
  199. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js +39 -0
  200. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.d.ts +10 -0
  201. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.js +24 -0
  202. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.d.ts +8 -0
  203. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.js +27 -0
  204. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.d.ts +140 -0
  205. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +43 -0
  206. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.d.ts +79 -0
  207. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.js +15 -0
  208. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.d.ts +63 -0
  209. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.js +105 -0
  210. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.d.ts +43 -0
  211. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +244 -0
  212. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.d.ts +29 -0
  213. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.js +58 -0
  214. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.d.ts +9 -0
  215. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.js +28 -0
  216. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.d.ts +7 -0
  217. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +35 -0
  218. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.d.ts +10 -0
  219. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js +39 -0
  220. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.d.ts +15 -0
  221. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.js +24 -0
  222. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.d.ts +5 -0
  223. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.js +29 -0
  224. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.d.ts +9 -0
  225. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.js +67 -0
  226. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.d.ts +8 -0
  227. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.js +27 -0
  228. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.d.ts +145 -0
  229. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +74 -0
  230. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.d.ts +85 -0
  231. package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.js +15 -0
  232. package/node_modules/@bufbuild/protobuf/dist/commonjs/create.d.ts +9 -0
  233. package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +259 -0
  234. package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.d.ts +634 -0
  235. package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.js +53 -0
  236. package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.d.ts +46 -0
  237. package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.js +209 -0
  238. package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.d.ts +60 -0
  239. package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.js +168 -0
  240. package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.d.ts +23 -0
  241. package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.js +45 -0
  242. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.d.ts +48 -0
  243. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +247 -0
  244. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.d.ts +73 -0
  245. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +739 -0
  246. package/node_modules/@bufbuild/protobuf/dist/commonjs/index.d.ts +19 -0
  247. package/node_modules/@bufbuild/protobuf/dist/commonjs/index.js +55 -0
  248. package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.d.ts +7 -0
  249. package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.js +33 -0
  250. package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.d.ts +16 -0
  251. package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.js +15 -0
  252. package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.d.ts +13 -0
  253. package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.js +70 -0
  254. package/node_modules/@bufbuild/protobuf/dist/commonjs/package.json +4 -0
  255. package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.d.ts +98 -0
  256. package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.js +131 -0
  257. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.d.ts +9 -0
  258. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.js +36 -0
  259. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.d.ts +20 -0
  260. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.js +78 -0
  261. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.d.ts +8 -0
  262. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js +41 -0
  263. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.d.ts +30 -0
  264. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.js +115 -0
  265. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.d.ts +35 -0
  266. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.js +110 -0
  267. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.d.ts +107 -0
  268. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.js +376 -0
  269. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.d.ts +19 -0
  270. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +268 -0
  271. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.d.ts +217 -0
  272. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.js +16 -0
  273. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.d.ts +43 -0
  274. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +546 -0
  275. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.d.ts +43 -0
  276. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.js +129 -0
  277. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.d.ts +39 -0
  278. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +149 -0
  279. package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.d.ts +98 -0
  280. package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +945 -0
  281. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.d.ts +24 -0
  282. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +199 -0
  283. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.d.ts +67 -0
  284. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +391 -0
  285. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.d.ts +35 -0
  286. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.js +684 -0
  287. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.d.ts +4 -0
  288. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.js +21 -0
  289. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.d.ts +19 -0
  290. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.js +47 -0
  291. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.d.ts +91 -0
  292. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.js +481 -0
  293. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.d.ts +34 -0
  294. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.js +358 -0
  295. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.d.ts +76 -0
  296. package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.js +220 -0
  297. package/node_modules/@bufbuild/protobuf/dist/commonjs/types.d.ts +135 -0
  298. package/node_modules/@bufbuild/protobuf/dist/commonjs/types.js +15 -0
  299. package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.d.ts +10 -0
  300. package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.js +26 -0
  301. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts +23 -0
  302. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +156 -0
  303. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.d.ts +268 -0
  304. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +530 -0
  305. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.d.ts +5 -0
  306. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +34 -0
  307. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.d.ts +69 -0
  308. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.js +191 -0
  309. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.d.ts +28 -0
  310. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +61 -0
  311. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.d.ts +13 -0
  312. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.js +199 -0
  313. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts +70 -0
  314. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +322 -0
  315. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.d.ts +38 -0
  316. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +75 -0
  317. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.d.ts +9 -0
  318. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +39 -0
  319. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
  320. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.js +27 -0
  321. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
  322. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.js +39 -0
  323. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
  324. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
  325. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
  326. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.js +60 -0
  327. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
  328. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.js +892 -0
  329. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
  330. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
  331. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
  332. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
  333. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
  334. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
  335. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
  336. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.js +126 -0
  337. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
  338. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.js +106 -0
  339. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
  340. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
  341. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
  342. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
  343. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
  344. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
  345. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
  346. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.js +242 -0
  347. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
  348. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
  349. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.d.ts +19 -0
  350. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +48 -0
  351. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.d.ts +21 -0
  352. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +57 -0
  353. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.d.ts +25 -0
  354. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +66 -0
  355. package/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts +6 -0
  356. package/node_modules/@bufbuild/protobuf/dist/esm/clone.js +63 -0
  357. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.d.ts +1 -0
  358. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.js +14 -0
  359. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts +10 -0
  360. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js +26 -0
  361. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts +9 -0
  362. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js +25 -0
  363. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts +1 -0
  364. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js +14 -0
  365. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts +10 -0
  366. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js +23 -0
  367. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts +10 -0
  368. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js +21 -0
  369. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts +8 -0
  370. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js +24 -0
  371. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts +140 -0
  372. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +40 -0
  373. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts +79 -0
  374. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js +14 -0
  375. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts +63 -0
  376. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js +101 -0
  377. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts +43 -0
  378. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +239 -0
  379. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts +29 -0
  380. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js +53 -0
  381. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts +9 -0
  382. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js +25 -0
  383. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts +7 -0
  384. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +32 -0
  385. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts +10 -0
  386. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js +23 -0
  387. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts +15 -0
  388. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js +21 -0
  389. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts +5 -0
  390. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js +26 -0
  391. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts +9 -0
  392. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js +63 -0
  393. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts +8 -0
  394. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js +24 -0
  395. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts +145 -0
  396. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +71 -0
  397. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts +85 -0
  398. package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js +14 -0
  399. package/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts +9 -0
  400. package/node_modules/@bufbuild/protobuf/dist/esm/create.js +256 -0
  401. package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts +634 -0
  402. package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js +50 -0
  403. package/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts +46 -0
  404. package/node_modules/@bufbuild/protobuf/dist/esm/equals.js +206 -0
  405. package/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts +60 -0
  406. package/node_modules/@bufbuild/protobuf/dist/esm/extensions.js +159 -0
  407. package/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts +23 -0
  408. package/node_modules/@bufbuild/protobuf/dist/esm/fields.js +41 -0
  409. package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts +48 -0
  410. package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +241 -0
  411. package/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts +73 -0
  412. package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +731 -0
  413. package/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts +19 -0
  414. package/node_modules/@bufbuild/protobuf/dist/esm/index.js +29 -0
  415. package/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts +7 -0
  416. package/node_modules/@bufbuild/protobuf/dist/esm/is-message.js +30 -0
  417. package/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts +16 -0
  418. package/node_modules/@bufbuild/protobuf/dist/esm/json-value.js +14 -0
  419. package/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts +13 -0
  420. package/node_modules/@bufbuild/protobuf/dist/esm/merge.js +67 -0
  421. package/node_modules/@bufbuild/protobuf/dist/esm/package.json +4 -0
  422. package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts +98 -0
  423. package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +128 -0
  424. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts +9 -0
  425. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +31 -0
  426. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts +20 -0
  427. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +71 -0
  428. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts +8 -0
  429. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js +21 -0
  430. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts +30 -0
  431. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +109 -0
  432. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts +35 -0
  433. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +105 -0
  434. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts +107 -0
  435. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js +369 -0
  436. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts +19 -0
  437. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +262 -0
  438. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts +217 -0
  439. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js +14 -0
  440. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts +43 -0
  441. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +541 -0
  442. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts +43 -0
  443. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +124 -0
  444. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts +39 -0
  445. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +140 -0
  446. package/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts +98 -0
  447. package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +939 -0
  448. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts +24 -0
  449. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +195 -0
  450. package/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts +67 -0
  451. package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +386 -0
  452. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.d.ts +35 -0
  453. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.js +680 -0
  454. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.d.ts +4 -0
  455. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.js +15 -0
  456. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.d.ts +19 -0
  457. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.js +44 -0
  458. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.d.ts +91 -0
  459. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.js +477 -0
  460. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.d.ts +34 -0
  461. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.js +355 -0
  462. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.d.ts +76 -0
  463. package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.js +214 -0
  464. package/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts +135 -0
  465. package/node_modules/@bufbuild/protobuf/dist/esm/types.js +14 -0
  466. package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.d.ts +10 -0
  467. package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.js +23 -0
  468. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts +23 -0
  469. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +152 -0
  470. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +268 -0
  471. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +525 -0
  472. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts +5 -0
  473. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +18 -0
  474. package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts +69 -0
  475. package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js +186 -0
  476. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +28 -0
  477. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +57 -0
  478. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts +13 -0
  479. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js +195 -0
  480. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts +70 -0
  481. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +313 -0
  482. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts +38 -0
  483. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +69 -0
  484. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts +9 -0
  485. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +35 -0
  486. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
  487. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
  488. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
  489. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
  490. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
  491. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
  492. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
  493. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +57 -0
  494. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
  495. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +888 -0
  496. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
  497. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
  498. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
  499. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
  500. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
  501. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
  502. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
  503. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +123 -0
  504. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
  505. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +103 -0
  506. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
  507. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
  508. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
  509. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
  510. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
  511. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
  512. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
  513. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
  514. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
  515. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
  516. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts +19 -0
  517. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +32 -0
  518. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts +21 -0
  519. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +50 -0
  520. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts +25 -0
  521. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +61 -0
  522. package/node_modules/@bufbuild/protobuf/package.json +147 -0
  523. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +14 -0
  524. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  525. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +2 -0
  526. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +43 -6
  527. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +4 -0
  528. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  529. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +59 -17
  530. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  531. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +14 -0
  532. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  533. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +14 -0
  534. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  535. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +12 -1
  536. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  537. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  538. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  539. package/node_modules/@earendil-works/pi-ai/README.md +3 -2
  540. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.d.ts +17 -0
  541. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.d.ts.map +1 -0
  542. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.js +14 -0
  543. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.js.map +1 -0
  544. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.d.ts +13 -0
  545. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.d.ts.map +1 -0
  546. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.js +33 -0
  547. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.js.map +1 -0
  548. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.d.ts +79 -0
  549. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.d.ts.map +1 -0
  550. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.js +360 -0
  551. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.js.map +1 -0
  552. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts +16797 -0
  553. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts.map +1 -0
  554. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js +3828 -0
  555. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js.map +1 -0
  556. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.d.ts +55 -0
  557. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.d.ts.map +1 -0
  558. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.js +76 -0
  559. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.js.map +1 -0
  560. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts +116 -0
  561. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts.map +1 -0
  562. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js +16 -0
  563. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js.map +1 -0
  564. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +191 -0
  565. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -0
  566. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +3316 -0
  567. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -0
  568. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.d.ts +29 -0
  569. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.d.ts.map +1 -0
  570. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js +33 -0
  571. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js.map +1 -0
  572. package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
  573. package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
  574. package/node_modules/@earendil-works/pi-ai/dist/compat.js +3 -0
  575. package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
  576. package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.d.ts +11 -0
  577. package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.d.ts.map +1 -0
  578. package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.js +11 -0
  579. package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.js.map +1 -0
  580. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +3 -0
  581. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  582. package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -0
  583. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  584. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +6 -1
  585. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
  586. package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
  587. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts +6 -9
  588. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
  589. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +42 -9
  590. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
  591. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  592. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  593. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
  594. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  595. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  596. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  597. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  598. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  599. package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  600. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  601. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +3 -1
  602. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  603. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  604. package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.d.ts +57 -0
  605. package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.d.ts.map +1 -0
  606. package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.js +57 -0
  607. package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.js.map +1 -0
  608. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -0
  609. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  610. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +22 -0
  611. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  612. package/node_modules/@earendil-works/pi-ai/package.json +3 -2
  613. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  614. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  615. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  616. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +21 -0
  617. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  618. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1 -1
  619. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  620. package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts +9 -0
  621. package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts.map +1 -0
  622. package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js +82 -0
  623. package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js.map +1 -0
  624. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  625. package/package.json +11 -8
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Proto builders for the modern Cursor CLI exec frames (`ExecServerMessage`
3
+ * 27-31, 36-38, 40-55).
4
+ *
5
+ * Split out of `cursor-agent.ts` because these are pure `create(...)` shapes
6
+ * with no transport, stream, or block-state coupling: the dispatcher decides
7
+ * *which* answer a frame gets, this module knows *what* that answer looks
8
+ * like on the wire. Every builder returns a result whose oneof case is set —
9
+ * an `ExecClientMessage` carrying a result with an unset oneof is a fake
10
+ * success the server reads as "the tool ran and produced nothing".
11
+ */
12
+ import type { ToolResultMessage } from "../../types.ts";
13
+ import { type ExecuteHookRequest, type ExecuteHookResult, type McpStateExecResult, type McpToolDefinition, type PiBashExecResult, type PiEditExecResult, type PiFindExecResult, type PiGrepExecResult, type PiLsExecResult, type PiReadExecResult, type PiTruncation, type PiWriteExecResult } from "./gen/agent_pb.ts";
14
+ /** Flatten a tool result's content into the single `output` string the Pi frames carry. */
15
+ export declare function piOutputText(toolResult: ToolResultMessage): string;
16
+ /**
17
+ * Translate a local tool's truncation summary into `PiTruncation`.
18
+ *
19
+ * Two shapes reach here: `details.truncation` (carries an explicit
20
+ * `truncated` boolean) and `details.meta.truncation` (whose presence *is* the
21
+ * signal). Returns `undefined` when nothing was truncated: the field is
22
+ * `optional` on every Pi success message, and emitting a zeroed
23
+ * `PiTruncation` would tell the server the output was trimmed to nothing.
24
+ */
25
+ export declare function piTruncation(toolResult: ToolResultMessage): PiTruncation | undefined;
26
+ export declare function buildPiReadResult(toolResult: ToolResultMessage): PiReadExecResult;
27
+ export declare function buildPiReadError(error: string): PiReadExecResult;
28
+ export declare function buildPiBashResult(toolResult: ToolResultMessage): PiBashExecResult;
29
+ export declare function buildPiBashError(error: string): PiBashExecResult;
30
+ /**
31
+ * `PiEditExecSuccess` requires `diff` and `patch` alongside `output`. The
32
+ * local `edit` tool reports them under `details`; when it does not, the
33
+ * strings stay empty rather than being faked from the output text.
34
+ */
35
+ export declare function buildPiEditResult(toolResult: ToolResultMessage): PiEditExecResult;
36
+ export declare function buildPiEditError(error: string): PiEditExecResult;
37
+ /**
38
+ * A refusal is not an execution failure: `PiEditExecResult` models them as
39
+ * separate variants, and answering a denied call with `error` reads as "the
40
+ * edit ran and broke", which invites a retry of an operation that was never
41
+ * permitted.
42
+ */
43
+ export declare function buildPiEditRejected(reason: string): PiEditExecResult;
44
+ export declare function buildPiWriteResult(toolResult: ToolResultMessage): PiWriteExecResult;
45
+ export declare function buildPiWriteError(error: string): PiWriteExecResult;
46
+ /** Same variant split as {@link buildPiEditRejected}. */
47
+ export declare function buildPiWriteRejected(reason: string): PiWriteExecResult;
48
+ export declare function buildPiGrepResult(toolResult: ToolResultMessage): PiGrepExecResult;
49
+ export declare function buildPiGrepError(error: string): PiGrepExecResult;
50
+ export declare function buildPiFindResult(toolResult: ToolResultMessage): PiFindExecResult;
51
+ export declare function buildPiFindError(error: string): PiFindExecResult;
52
+ export declare function buildPiLsResult(toolResult: ToolResultMessage): PiLsExecResult;
53
+ export declare function buildPiLsError(error: string): PiLsExecResult;
54
+ /**
55
+ * Answer `mcpStateExecArgs` (frame 36) from the catalog already advertised in
56
+ * `RequestContext.tools`.
57
+ *
58
+ * This client hosts no MCP servers of its own: every forwarded tool is a
59
+ * local tool published under a synthetic `providerIdentifier`. Regrouping the
60
+ * same list keeps the server's view of "which servers exist and what do they
61
+ * expose" consistent with what it was told at context time.
62
+ *
63
+ * `serverIdentifiers` filters the answer when the server asks about specific
64
+ * servers. A restart request is answered with the same state rather than an
65
+ * error — there is nothing to restart.
66
+ */
67
+ export declare function buildMcpStateResult(tools: McpToolDefinition[], serverIdentifiers: readonly string[]): McpStateExecResult;
68
+ /**
69
+ * Build the neutral response for a hook query: the matching response case
70
+ * with every field unset.
71
+ *
72
+ * This client runs no Cursor hooks, and every field of every response variant
73
+ * is `optional` — so an empty response of the right case means "no hook had
74
+ * anything to say", which is exactly true. Returns `null` for a request case
75
+ * this build does not model, which the dispatcher answers with
76
+ * `ExecClientThrow` rather than guessing a case.
77
+ */
78
+ export declare function buildNeutralHookResult(request: ExecuteHookRequest | undefined): ExecuteHookResult | null;
79
+ //# sourceMappingURL=exec-modern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec-modern.d.ts","sourceRoot":"","sources":["../../../src/api/cursor-agent/exec-modern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAIN,KAAK,kBAAkB,EAGvB,KAAK,iBAAiB,EAEtB,KAAK,kBAAkB,EAIvB,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EAKrB,KAAK,gBAAgB,EAIrB,KAAK,gBAAgB,EAIrB,KAAK,gBAAgB,EAIrB,KAAK,cAAc,EAInB,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAIjB,KAAK,iBAAiB,EAUtB,MAAM,mBAAmB,CAAC;AAE3B,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAElE;AA6BD;;;;;;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;;GAYG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,iBAAiB,EAAE,EAC1B,iBAAiB,EAAE,SAAS,MAAM,EAAE,GAClC,kBAAkB,CA0BpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,iBAAiB,GAAG,IAAI,CAyDxG"}
@@ -0,0 +1,360 @@
1
+ /**
2
+ * Proto builders for the modern Cursor CLI exec frames (`ExecServerMessage`
3
+ * 27-31, 36-38, 40-55).
4
+ *
5
+ * Split out of `cursor-agent.ts` because these are pure `create(...)` shapes
6
+ * with no transport, stream, or block-state coupling: the dispatcher decides
7
+ * *which* answer a frame gets, this module knows *what* that answer looks
8
+ * like on the wire. Every builder returns a result whose oneof case is set —
9
+ * an `ExecClientMessage` carrying a result with an unset oneof is a fake
10
+ * success the server reads as "the tool ran and produced nothing".
11
+ */
12
+ import { create } from "@bufbuild/protobuf";
13
+ import { AfterAgentResponseRequestResponseSchema, AfterAgentThoughtRequestResponseSchema, BeforeSubmitPromptRequestResponseSchema, ExecuteHookResponseSchema, ExecuteHookResultSchema, McpStateExecResultSchema, McpStateServerSchema, McpStateSuccessSchema, PiBashExecErrorSchema, PiBashExecResultSchema, PiBashExecSuccessSchema, PiEditExecErrorSchema, PiEditExecRejectedSchema, PiEditExecResultSchema, PiEditExecSuccessSchema, PiFindExecErrorSchema, PiFindExecResultSchema, PiFindExecSuccessSchema, PiGrepExecErrorSchema, PiGrepExecResultSchema, PiGrepExecSuccessSchema, PiLsExecErrorSchema, PiLsExecResultSchema, PiLsExecSuccessSchema, PiReadExecErrorSchema, PiReadExecResultSchema, PiReadExecSuccessSchema, PiTruncationSchema, PiWriteExecErrorSchema, PiWriteExecRejectedSchema, PiWriteExecResultSchema, PiWriteExecSuccessSchema, PostToolUseFailureRequestResponseSchema, PostToolUseRequestResponseSchema, PreCompactRequestResponseSchema, PreToolUseRequestResponseSchema, StopRequestResponseSchema, SubagentStartRequestResponseSchema, SubagentStopRequestResponseSchema, } from "./gen/agent_pb.js";
14
+ /** Flatten a tool result's content into the single `output` string the Pi frames carry. */
15
+ export function piOutputText(toolResult) {
16
+ return toolResult.content.map((item) => (item.type === "text" ? item.text : `[${item.mimeType} image]`)).join("\n");
17
+ }
18
+ /**
19
+ * Read one field off a tool result's `details` bag, or off a nested object
20
+ * inside it. `details` is `unknown` by design — every tool ships its own
21
+ * shape — so each read is narrowed rather than asserted.
22
+ */
23
+ function bagValue(bag, key) {
24
+ if (!bag || typeof bag !== "object" || !(key in bag))
25
+ return undefined;
26
+ return Reflect.get(bag, key);
27
+ }
28
+ function detailCount(toolResult, key) {
29
+ const value = bagValue(toolResult.details, key);
30
+ return positiveCount(value);
31
+ }
32
+ function positiveCount(value) {
33
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : undefined;
34
+ }
35
+ /** The entry cap a listing hit, from either shape a local tool records it in. */
36
+ function resultLimitReached(toolResult) {
37
+ const flat = detailCount(toolResult, "resultLimitReached");
38
+ if (flat !== undefined)
39
+ return flat;
40
+ const limits = bagValue(bagValue(toolResult.details, "meta"), "limits");
41
+ return positiveCount(bagValue(bagValue(limits, "resultLimit"), "reached"));
42
+ }
43
+ /**
44
+ * Translate a local tool's truncation summary into `PiTruncation`.
45
+ *
46
+ * Two shapes reach here: `details.truncation` (carries an explicit
47
+ * `truncated` boolean) and `details.meta.truncation` (whose presence *is* the
48
+ * signal). Returns `undefined` when nothing was truncated: the field is
49
+ * `optional` on every Pi success message, and emitting a zeroed
50
+ * `PiTruncation` would tell the server the output was trimmed to nothing.
51
+ */
52
+ export function piTruncation(toolResult) {
53
+ const direct = bagValue(toolResult.details, "truncation");
54
+ const truncation = direct !== undefined ? direct : bagValue(bagValue(toolResult.details, "meta"), "truncation");
55
+ if (truncation === undefined || truncation === null)
56
+ return undefined;
57
+ const flag = bagValue(truncation, "truncated");
58
+ if (flag !== undefined && flag !== true)
59
+ return undefined;
60
+ const truncatedBy = bagValue(truncation, "truncatedBy");
61
+ const totalLines = bagValue(truncation, "totalLines");
62
+ const outputLines = bagValue(truncation, "outputLines");
63
+ const outputBytes = bagValue(truncation, "outputBytes");
64
+ return create(PiTruncationSchema, {
65
+ truncated: true,
66
+ truncatedBy: typeof truncatedBy === "string" ? truncatedBy : "",
67
+ totalLines: typeof totalLines === "number" ? totalLines : 0,
68
+ outputLines: typeof outputLines === "number" ? outputLines : 0,
69
+ outputBytes: typeof outputBytes === "number" ? outputBytes : 0,
70
+ firstLineExceedsLimit: bagValue(truncation, "firstLineExceedsLimit") === true,
71
+ lastLinePartial: bagValue(truncation, "lastLinePartial") === true,
72
+ });
73
+ }
74
+ export function buildPiReadResult(toolResult) {
75
+ const text = piOutputText(toolResult);
76
+ if (toolResult.isError)
77
+ return buildPiReadError(text || "Read failed");
78
+ return create(PiReadExecResultSchema, {
79
+ result: {
80
+ case: "success",
81
+ value: create(PiReadExecSuccessSchema, { output: text, truncation: piTruncation(toolResult) }),
82
+ },
83
+ });
84
+ }
85
+ export function buildPiReadError(error) {
86
+ return create(PiReadExecResultSchema, {
87
+ result: { case: "error", value: create(PiReadExecErrorSchema, { error }) },
88
+ });
89
+ }
90
+ export function buildPiBashResult(toolResult) {
91
+ const text = piOutputText(toolResult);
92
+ const truncation = piTruncation(toolResult);
93
+ if (toolResult.isError) {
94
+ return create(PiBashExecResultSchema, {
95
+ result: {
96
+ case: "error",
97
+ value: create(PiBashExecErrorSchema, { error: text || "Command failed", truncation }),
98
+ },
99
+ });
100
+ }
101
+ return create(PiBashExecResultSchema, {
102
+ result: {
103
+ case: "success",
104
+ value: create(PiBashExecSuccessSchema, { output: text, truncation }),
105
+ },
106
+ });
107
+ }
108
+ export function buildPiBashError(error) {
109
+ return create(PiBashExecResultSchema, {
110
+ result: { case: "error", value: create(PiBashExecErrorSchema, { error }) },
111
+ });
112
+ }
113
+ /**
114
+ * `PiEditExecSuccess` requires `diff` and `patch` alongside `output`. The
115
+ * local `edit` tool reports them under `details`; when it does not, the
116
+ * strings stay empty rather than being faked from the output text.
117
+ */
118
+ export function buildPiEditResult(toolResult) {
119
+ const text = piOutputText(toolResult);
120
+ if (toolResult.isError)
121
+ return buildPiEditError(text || "Edit failed");
122
+ const diff = bagValue(toolResult.details, "diff");
123
+ const patch = bagValue(toolResult.details, "patch");
124
+ return create(PiEditExecResultSchema, {
125
+ result: {
126
+ case: "success",
127
+ value: create(PiEditExecSuccessSchema, {
128
+ output: text,
129
+ diff: typeof diff === "string" ? diff : "",
130
+ patch: typeof patch === "string" ? patch : "",
131
+ firstChangedLine: detailCount(toolResult, "firstChangedLine"),
132
+ }),
133
+ },
134
+ });
135
+ }
136
+ export function buildPiEditError(error) {
137
+ return create(PiEditExecResultSchema, {
138
+ result: { case: "error", value: create(PiEditExecErrorSchema, { error }) },
139
+ });
140
+ }
141
+ /**
142
+ * A refusal is not an execution failure: `PiEditExecResult` models them as
143
+ * separate variants, and answering a denied call with `error` reads as "the
144
+ * edit ran and broke", which invites a retry of an operation that was never
145
+ * permitted.
146
+ */
147
+ export function buildPiEditRejected(reason) {
148
+ return create(PiEditExecResultSchema, {
149
+ result: { case: "rejected", value: create(PiEditExecRejectedSchema, { reason }) },
150
+ });
151
+ }
152
+ export function buildPiWriteResult(toolResult) {
153
+ const text = piOutputText(toolResult);
154
+ if (toolResult.isError)
155
+ return buildPiWriteError(text || "Write failed");
156
+ return create(PiWriteExecResultSchema, {
157
+ result: { case: "success", value: create(PiWriteExecSuccessSchema, { output: text }) },
158
+ });
159
+ }
160
+ export function buildPiWriteError(error) {
161
+ return create(PiWriteExecResultSchema, {
162
+ result: { case: "error", value: create(PiWriteExecErrorSchema, { error }) },
163
+ });
164
+ }
165
+ /** Same variant split as {@link buildPiEditRejected}. */
166
+ export function buildPiWriteRejected(reason) {
167
+ return create(PiWriteExecResultSchema, {
168
+ result: { case: "rejected", value: create(PiWriteExecRejectedSchema, { reason }) },
169
+ });
170
+ }
171
+ export function buildPiGrepResult(toolResult) {
172
+ const text = piOutputText(toolResult);
173
+ if (toolResult.isError)
174
+ return buildPiGrepError(text || "Grep failed");
175
+ const matchLimitReached = detailCount(toolResult, "perFileLimitReached");
176
+ return create(PiGrepExecResultSchema, {
177
+ result: {
178
+ case: "success",
179
+ value: create(PiGrepExecSuccessSchema, {
180
+ output: text,
181
+ truncation: piTruncation(toolResult) ?? grepInternalCapTruncation(toolResult, text, matchLimitReached),
182
+ matchLimitReached,
183
+ linesTruncated: bagValue(toolResult.details, "linesTruncated") === true,
184
+ }),
185
+ },
186
+ });
187
+ }
188
+ /**
189
+ * The one grep cap that reaches Cursor through no other field: a search that
190
+ * hit the tool's own total cap sets only the flat `details.truncated` flag,
191
+ * answering as an unqualified success over incomplete results otherwise.
192
+ */
193
+ function grepInternalCapTruncation(toolResult, text, matchLimitReached) {
194
+ if (matchLimitReached !== undefined)
195
+ return undefined;
196
+ if (bagValue(toolResult.details, "truncated") !== true)
197
+ return undefined;
198
+ return create(PiTruncationSchema, {
199
+ truncated: true,
200
+ truncatedBy: "matches",
201
+ totalLines: 0,
202
+ outputLines: text ? text.split("\n").length : 0,
203
+ outputBytes: Buffer.byteLength(text, "utf-8"),
204
+ firstLineExceedsLimit: false,
205
+ lastLinePartial: false,
206
+ });
207
+ }
208
+ export function buildPiGrepError(error) {
209
+ return create(PiGrepExecResultSchema, {
210
+ result: { case: "error", value: create(PiGrepExecErrorSchema, { error }) },
211
+ });
212
+ }
213
+ export function buildPiFindResult(toolResult) {
214
+ const text = piOutputText(toolResult);
215
+ if (toolResult.isError)
216
+ return buildPiFindError(text || "Find failed");
217
+ return create(PiFindExecResultSchema, {
218
+ result: {
219
+ case: "success",
220
+ value: create(PiFindExecSuccessSchema, {
221
+ output: text,
222
+ truncation: piTruncation(toolResult),
223
+ resultLimitReached: resultLimitReached(toolResult),
224
+ }),
225
+ },
226
+ });
227
+ }
228
+ export function buildPiFindError(error) {
229
+ return create(PiFindExecResultSchema, {
230
+ result: { case: "error", value: create(PiFindExecErrorSchema, { error }) },
231
+ });
232
+ }
233
+ export function buildPiLsResult(toolResult) {
234
+ const text = piOutputText(toolResult);
235
+ if (toolResult.isError)
236
+ return buildPiLsError(text || "Ls failed");
237
+ return create(PiLsExecResultSchema, {
238
+ result: {
239
+ case: "success",
240
+ value: create(PiLsExecSuccessSchema, {
241
+ output: text,
242
+ truncation: piTruncation(toolResult),
243
+ entryLimitReached: resultLimitReached(toolResult),
244
+ }),
245
+ },
246
+ });
247
+ }
248
+ export function buildPiLsError(error) {
249
+ return create(PiLsExecResultSchema, {
250
+ result: { case: "error", value: create(PiLsExecErrorSchema, { error }) },
251
+ });
252
+ }
253
+ /**
254
+ * Answer `mcpStateExecArgs` (frame 36) from the catalog already advertised in
255
+ * `RequestContext.tools`.
256
+ *
257
+ * This client hosts no MCP servers of its own: every forwarded tool is a
258
+ * local tool published under a synthetic `providerIdentifier`. Regrouping the
259
+ * same list keeps the server's view of "which servers exist and what do they
260
+ * expose" consistent with what it was told at context time.
261
+ *
262
+ * `serverIdentifiers` filters the answer when the server asks about specific
263
+ * servers. A restart request is answered with the same state rather than an
264
+ * error — there is nothing to restart.
265
+ */
266
+ export function buildMcpStateResult(tools, serverIdentifiers) {
267
+ const byProvider = new Map();
268
+ for (const tool of tools) {
269
+ const identifier = tool.providerIdentifier;
270
+ const existing = byProvider.get(identifier);
271
+ if (existing)
272
+ existing.push(tool);
273
+ else
274
+ byProvider.set(identifier, [tool]);
275
+ }
276
+ const wanted = serverIdentifiers.length > 0 ? new Set(serverIdentifiers) : undefined;
277
+ const servers = [];
278
+ for (const [identifier, serverTools] of byProvider) {
279
+ if (wanted && !wanted.has(identifier))
280
+ continue;
281
+ servers.push(create(McpStateServerSchema, {
282
+ serverName: identifier,
283
+ serverIdentifier: identifier,
284
+ tools: serverTools,
285
+ status: "connected",
286
+ }));
287
+ }
288
+ return create(McpStateExecResultSchema, {
289
+ result: { case: "success", value: create(McpStateSuccessSchema, { servers }) },
290
+ });
291
+ }
292
+ /**
293
+ * Build the neutral response for a hook query: the matching response case
294
+ * with every field unset.
295
+ *
296
+ * This client runs no Cursor hooks, and every field of every response variant
297
+ * is `optional` — so an empty response of the right case means "no hook had
298
+ * anything to say", which is exactly true. Returns `null` for a request case
299
+ * this build does not model, which the dispatcher answers with
300
+ * `ExecClientThrow` rather than guessing a case.
301
+ */
302
+ export function buildNeutralHookResult(request) {
303
+ let response;
304
+ switch (request?.request.case) {
305
+ case "preCompact":
306
+ response = create(ExecuteHookResponseSchema, {
307
+ response: { case: "preCompact", value: create(PreCompactRequestResponseSchema, {}) },
308
+ });
309
+ break;
310
+ case "subagentStart":
311
+ response = create(ExecuteHookResponseSchema, {
312
+ response: { case: "subagentStart", value: create(SubagentStartRequestResponseSchema, {}) },
313
+ });
314
+ break;
315
+ case "subagentStop":
316
+ response = create(ExecuteHookResponseSchema, {
317
+ response: { case: "subagentStop", value: create(SubagentStopRequestResponseSchema, {}) },
318
+ });
319
+ break;
320
+ case "preToolUse":
321
+ response = create(ExecuteHookResponseSchema, {
322
+ response: { case: "preToolUse", value: create(PreToolUseRequestResponseSchema, {}) },
323
+ });
324
+ break;
325
+ case "postToolUse":
326
+ response = create(ExecuteHookResponseSchema, {
327
+ response: { case: "postToolUse", value: create(PostToolUseRequestResponseSchema, {}) },
328
+ });
329
+ break;
330
+ case "postToolUseFailure":
331
+ response = create(ExecuteHookResponseSchema, {
332
+ response: { case: "postToolUseFailure", value: create(PostToolUseFailureRequestResponseSchema, {}) },
333
+ });
334
+ break;
335
+ case "beforeSubmitPrompt":
336
+ response = create(ExecuteHookResponseSchema, {
337
+ response: { case: "beforeSubmitPrompt", value: create(BeforeSubmitPromptRequestResponseSchema, {}) },
338
+ });
339
+ break;
340
+ case "afterAgentResponse":
341
+ response = create(ExecuteHookResponseSchema, {
342
+ response: { case: "afterAgentResponse", value: create(AfterAgentResponseRequestResponseSchema, {}) },
343
+ });
344
+ break;
345
+ case "afterAgentThought":
346
+ response = create(ExecuteHookResponseSchema, {
347
+ response: { case: "afterAgentThought", value: create(AfterAgentThoughtRequestResponseSchema, {}) },
348
+ });
349
+ break;
350
+ case "stop":
351
+ response = create(ExecuteHookResponseSchema, {
352
+ response: { case: "stop", value: create(StopRequestResponseSchema, {}) },
353
+ });
354
+ break;
355
+ default:
356
+ return null;
357
+ }
358
+ return create(ExecuteHookResultSchema, { response });
359
+ }
360
+ //# sourceMappingURL=exec-modern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec-modern.js","sourceRoot":"","sources":["../../../src/api/cursor-agent/exec-modern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EACN,uCAAuC,EACvC,sCAAsC,EACtC,uCAAuC,EAGvC,yBAAyB,EAEzB,uBAAuB,EAEvB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EAErB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EAExB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EAEvB,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EAEzB,uBAAuB,EACvB,wBAAwB,EACxB,uCAAuC,EACvC,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAC/B,yBAAyB,EACzB,kCAAkC,EAClC,iCAAiC,GACjC,MAAM,mBAAmB,CAAC;AAE3B,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,UAA6B;IACzD,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IA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AAC,CAAC;YACH,MAAM;QACP;YACC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtD,CAAC","sourcesContent":["/**\n * Proto builders for the modern Cursor CLI exec frames (`ExecServerMessage`\n * 27-31, 36-38, 40-55).\n *\n * Split out of `cursor-agent.ts` because these are pure `create(...)` shapes\n * with no transport, stream, or block-state coupling: the dispatcher decides\n * *which* answer a frame gets, this module knows *what* that answer looks\n * like on the wire. Every builder returns a result whose oneof case is set —\n * an `ExecClientMessage` carrying a result with an unset oneof is a fake\n * success the server reads as \"the tool ran and produced nothing\".\n */\n\nimport { create } from \"@bufbuild/protobuf\";\nimport type { ToolResultMessage } from \"../../types.ts\";\nimport {\n\tAfterAgentResponseRequestResponseSchema,\n\tAfterAgentThoughtRequestResponseSchema,\n\tBeforeSubmitPromptRequestResponseSchema,\n\ttype ExecuteHookRequest,\n\ttype ExecuteHookResponse,\n\tExecuteHookResponseSchema,\n\ttype ExecuteHookResult,\n\tExecuteHookResultSchema,\n\ttype McpStateExecResult,\n\tMcpStateExecResultSchema,\n\tMcpStateServerSchema,\n\tMcpStateSuccessSchema,\n\ttype McpToolDefinition,\n\tPiBashExecErrorSchema,\n\ttype PiBashExecResult,\n\tPiBashExecResultSchema,\n\tPiBashExecSuccessSchema,\n\tPiEditExecErrorSchema,\n\tPiEditExecRejectedSchema,\n\ttype PiEditExecResult,\n\tPiEditExecResultSchema,\n\tPiEditExecSuccessSchema,\n\tPiFindExecErrorSchema,\n\ttype PiFindExecResult,\n\tPiFindExecResultSchema,\n\tPiFindExecSuccessSchema,\n\tPiGrepExecErrorSchema,\n\ttype PiGrepExecResult,\n\tPiGrepExecResultSchema,\n\tPiGrepExecSuccessSchema,\n\tPiLsExecErrorSchema,\n\ttype PiLsExecResult,\n\tPiLsExecResultSchema,\n\tPiLsExecSuccessSchema,\n\tPiReadExecErrorSchema,\n\ttype PiReadExecResult,\n\tPiReadExecResultSchema,\n\tPiReadExecSuccessSchema,\n\ttype PiTruncation,\n\tPiTruncationSchema,\n\tPiWriteExecErrorSchema,\n\tPiWriteExecRejectedSchema,\n\ttype PiWriteExecResult,\n\tPiWriteExecResultSchema,\n\tPiWriteExecSuccessSchema,\n\tPostToolUseFailureRequestResponseSchema,\n\tPostToolUseRequestResponseSchema,\n\tPreCompactRequestResponseSchema,\n\tPreToolUseRequestResponseSchema,\n\tStopRequestResponseSchema,\n\tSubagentStartRequestResponseSchema,\n\tSubagentStopRequestResponseSchema,\n} from \"./gen/agent_pb.ts\";\n\n/** Flatten a tool result's content into the single `output` string the Pi frames carry. */\nexport function piOutputText(toolResult: ToolResultMessage): string {\n\treturn toolResult.content.map((item) => (item.type === \"text\" ? item.text : `[${item.mimeType} image]`)).join(\"\\n\");\n}\n\n/**\n * Read one field off a tool result's `details` bag, or off a nested object\n * inside it. `details` is `unknown` by design — every tool ships its own\n * shape — so each read is narrowed rather than asserted.\n */\nfunction bagValue(bag: unknown, key: string): unknown {\n\tif (!bag || typeof bag !== \"object\" || !(key in bag)) return undefined;\n\treturn Reflect.get(bag, key);\n}\n\nfunction detailCount(toolResult: ToolResultMessage, key: string): number | undefined {\n\tconst value = bagValue(toolResult.details, key);\n\treturn positiveCount(value);\n}\n\nfunction positiveCount(value: unknown): number | undefined {\n\treturn typeof value === \"number\" && Number.isFinite(value) && value > 0 ? Math.floor(value) : undefined;\n}\n\n/** The entry cap a listing hit, from either shape a local tool records it in. */\nfunction resultLimitReached(toolResult: ToolResultMessage): number | undefined {\n\tconst flat = detailCount(toolResult, \"resultLimitReached\");\n\tif (flat !== undefined) return flat;\n\tconst limits = bagValue(bagValue(toolResult.details, \"meta\"), \"limits\");\n\treturn positiveCount(bagValue(bagValue(limits, \"resultLimit\"), \"reached\"));\n}\n\n/**\n * Translate a local tool's truncation summary into `PiTruncation`.\n *\n * Two shapes reach here: `details.truncation` (carries an explicit\n * `truncated` boolean) and `details.meta.truncation` (whose presence *is* the\n * signal). Returns `undefined` when nothing was truncated: the field is\n * `optional` on every Pi success message, and emitting a zeroed\n * `PiTruncation` would tell the server the output was trimmed to nothing.\n */\nexport function piTruncation(toolResult: ToolResultMessage): PiTruncation | undefined {\n\tconst direct = bagValue(toolResult.details, \"truncation\");\n\tconst truncation = direct !== undefined ? direct : bagValue(bagValue(toolResult.details, \"meta\"), \"truncation\");\n\tif (truncation === undefined || truncation === null) return undefined;\n\tconst flag = bagValue(truncation, \"truncated\");\n\tif (flag !== undefined && flag !== true) return undefined;\n\tconst truncatedBy = bagValue(truncation, \"truncatedBy\");\n\tconst totalLines = bagValue(truncation, \"totalLines\");\n\tconst outputLines = bagValue(truncation, \"outputLines\");\n\tconst outputBytes = bagValue(truncation, \"outputBytes\");\n\treturn create(PiTruncationSchema, {\n\t\ttruncated: true,\n\t\ttruncatedBy: typeof truncatedBy === \"string\" ? truncatedBy : \"\",\n\t\ttotalLines: typeof totalLines === \"number\" ? totalLines : 0,\n\t\toutputLines: typeof outputLines === \"number\" ? outputLines : 0,\n\t\toutputBytes: typeof outputBytes === \"number\" ? outputBytes : 0,\n\t\tfirstLineExceedsLimit: bagValue(truncation, \"firstLineExceedsLimit\") === true,\n\t\tlastLinePartial: bagValue(truncation, \"lastLinePartial\") === true,\n\t});\n}\n\nexport function buildPiReadResult(toolResult: ToolResultMessage): PiReadExecResult {\n\tconst text = piOutputText(toolResult);\n\tif (toolResult.isError) return buildPiReadError(text || \"Read failed\");\n\treturn create(PiReadExecResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(PiReadExecSuccessSchema, { output: text, truncation: piTruncation(toolResult) }),\n\t\t},\n\t});\n}\n\nexport function buildPiReadError(error: string): PiReadExecResult {\n\treturn create(PiReadExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiReadExecErrorSchema, { error }) },\n\t});\n}\n\nexport function buildPiBashResult(toolResult: ToolResultMessage): PiBashExecResult {\n\tconst text = piOutputText(toolResult);\n\tconst truncation = piTruncation(toolResult);\n\tif (toolResult.isError) {\n\t\treturn create(PiBashExecResultSchema, {\n\t\t\tresult: {\n\t\t\t\tcase: \"error\",\n\t\t\t\tvalue: create(PiBashExecErrorSchema, { error: text || \"Command failed\", truncation }),\n\t\t\t},\n\t\t});\n\t}\n\treturn create(PiBashExecResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(PiBashExecSuccessSchema, { output: text, truncation }),\n\t\t},\n\t});\n}\n\nexport function buildPiBashError(error: string): PiBashExecResult {\n\treturn create(PiBashExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiBashExecErrorSchema, { error }) },\n\t});\n}\n\n/**\n * `PiEditExecSuccess` requires `diff` and `patch` alongside `output`. The\n * local `edit` tool reports them under `details`; when it does not, the\n * strings stay empty rather than being faked from the output text.\n */\nexport function buildPiEditResult(toolResult: ToolResultMessage): PiEditExecResult {\n\tconst text = piOutputText(toolResult);\n\tif (toolResult.isError) return buildPiEditError(text || \"Edit failed\");\n\tconst diff = bagValue(toolResult.details, \"diff\");\n\tconst patch = bagValue(toolResult.details, \"patch\");\n\treturn create(PiEditExecResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(PiEditExecSuccessSchema, {\n\t\t\t\toutput: text,\n\t\t\t\tdiff: typeof diff === \"string\" ? diff : \"\",\n\t\t\t\tpatch: typeof patch === \"string\" ? patch : \"\",\n\t\t\t\tfirstChangedLine: detailCount(toolResult, \"firstChangedLine\"),\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport function buildPiEditError(error: string): PiEditExecResult {\n\treturn create(PiEditExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiEditExecErrorSchema, { error }) },\n\t});\n}\n\n/**\n * A refusal is not an execution failure: `PiEditExecResult` models them as\n * separate variants, and answering a denied call with `error` reads as \"the\n * edit ran and broke\", which invites a retry of an operation that was never\n * permitted.\n */\nexport function buildPiEditRejected(reason: string): PiEditExecResult {\n\treturn create(PiEditExecResultSchema, {\n\t\tresult: { case: \"rejected\", value: create(PiEditExecRejectedSchema, { reason }) },\n\t});\n}\n\nexport function buildPiWriteResult(toolResult: ToolResultMessage): PiWriteExecResult {\n\tconst text = piOutputText(toolResult);\n\tif (toolResult.isError) return buildPiWriteError(text || \"Write failed\");\n\treturn create(PiWriteExecResultSchema, {\n\t\tresult: { case: \"success\", value: create(PiWriteExecSuccessSchema, { output: text }) },\n\t});\n}\n\nexport function buildPiWriteError(error: string): PiWriteExecResult {\n\treturn create(PiWriteExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiWriteExecErrorSchema, { error }) },\n\t});\n}\n\n/** Same variant split as {@link buildPiEditRejected}. */\nexport function buildPiWriteRejected(reason: string): PiWriteExecResult {\n\treturn create(PiWriteExecResultSchema, {\n\t\tresult: { case: \"rejected\", value: create(PiWriteExecRejectedSchema, { reason }) },\n\t});\n}\n\nexport function buildPiGrepResult(toolResult: ToolResultMessage): PiGrepExecResult {\n\tconst text = piOutputText(toolResult);\n\tif (toolResult.isError) return buildPiGrepError(text || \"Grep failed\");\n\tconst matchLimitReached = detailCount(toolResult, \"perFileLimitReached\");\n\treturn create(PiGrepExecResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(PiGrepExecSuccessSchema, {\n\t\t\t\toutput: text,\n\t\t\t\ttruncation: piTruncation(toolResult) ?? grepInternalCapTruncation(toolResult, text, matchLimitReached),\n\t\t\t\tmatchLimitReached,\n\t\t\t\tlinesTruncated: bagValue(toolResult.details, \"linesTruncated\") === true,\n\t\t\t}),\n\t\t},\n\t});\n}\n\n/**\n * The one grep cap that reaches Cursor through no other field: a search that\n * hit the tool's own total cap sets only the flat `details.truncated` flag,\n * answering as an unqualified success over incomplete results otherwise.\n */\nfunction grepInternalCapTruncation(\n\ttoolResult: ToolResultMessage,\n\ttext: string,\n\tmatchLimitReached: number | undefined,\n): PiTruncation | undefined {\n\tif (matchLimitReached !== undefined) return undefined;\n\tif (bagValue(toolResult.details, \"truncated\") !== true) return undefined;\n\treturn create(PiTruncationSchema, {\n\t\ttruncated: true,\n\t\ttruncatedBy: \"matches\",\n\t\ttotalLines: 0,\n\t\toutputLines: text ? text.split(\"\\n\").length : 0,\n\t\toutputBytes: Buffer.byteLength(text, \"utf-8\"),\n\t\tfirstLineExceedsLimit: false,\n\t\tlastLinePartial: false,\n\t});\n}\n\nexport function buildPiGrepError(error: string): PiGrepExecResult {\n\treturn create(PiGrepExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiGrepExecErrorSchema, { error }) },\n\t});\n}\n\nexport function buildPiFindResult(toolResult: ToolResultMessage): PiFindExecResult {\n\tconst text = piOutputText(toolResult);\n\tif (toolResult.isError) return buildPiFindError(text || \"Find failed\");\n\treturn create(PiFindExecResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(PiFindExecSuccessSchema, {\n\t\t\t\toutput: text,\n\t\t\t\ttruncation: piTruncation(toolResult),\n\t\t\t\tresultLimitReached: resultLimitReached(toolResult),\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport function buildPiFindError(error: string): PiFindExecResult {\n\treturn create(PiFindExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiFindExecErrorSchema, { error }) },\n\t});\n}\n\nexport function buildPiLsResult(toolResult: ToolResultMessage): PiLsExecResult {\n\tconst text = piOutputText(toolResult);\n\tif (toolResult.isError) return buildPiLsError(text || \"Ls failed\");\n\treturn create(PiLsExecResultSchema, {\n\t\tresult: {\n\t\t\tcase: \"success\",\n\t\t\tvalue: create(PiLsExecSuccessSchema, {\n\t\t\t\toutput: text,\n\t\t\t\ttruncation: piTruncation(toolResult),\n\t\t\t\tentryLimitReached: resultLimitReached(toolResult),\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport function buildPiLsError(error: string): PiLsExecResult {\n\treturn create(PiLsExecResultSchema, {\n\t\tresult: { case: \"error\", value: create(PiLsExecErrorSchema, { error }) },\n\t});\n}\n\n/**\n * Answer `mcpStateExecArgs` (frame 36) from the catalog already advertised in\n * `RequestContext.tools`.\n *\n * This client hosts no MCP servers of its own: every forwarded tool is a\n * local tool published under a synthetic `providerIdentifier`. Regrouping the\n * same list keeps the server's view of \"which servers exist and what do they\n * expose\" consistent with what it was told at context time.\n *\n * `serverIdentifiers` filters the answer when the server asks about specific\n * servers. A restart request is answered with the same state rather than an\n * error — there is nothing to restart.\n */\nexport function buildMcpStateResult(\n\ttools: McpToolDefinition[],\n\tserverIdentifiers: readonly string[],\n): McpStateExecResult {\n\tconst byProvider = new Map<string, McpToolDefinition[]>();\n\tfor (const tool of tools) {\n\t\tconst identifier = tool.providerIdentifier;\n\t\tconst existing = byProvider.get(identifier);\n\t\tif (existing) existing.push(tool);\n\t\telse byProvider.set(identifier, [tool]);\n\t}\n\n\tconst wanted = serverIdentifiers.length > 0 ? new Set(serverIdentifiers) : undefined;\n\tconst servers = [];\n\tfor (const [identifier, serverTools] of byProvider) {\n\t\tif (wanted && !wanted.has(identifier)) continue;\n\t\tservers.push(\n\t\t\tcreate(McpStateServerSchema, {\n\t\t\t\tserverName: identifier,\n\t\t\t\tserverIdentifier: identifier,\n\t\t\t\ttools: serverTools,\n\t\t\t\tstatus: \"connected\",\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn create(McpStateExecResultSchema, {\n\t\tresult: { case: \"success\", value: create(McpStateSuccessSchema, { servers }) },\n\t});\n}\n\n/**\n * Build the neutral response for a hook query: the matching response case\n * with every field unset.\n *\n * This client runs no Cursor hooks, and every field of every response variant\n * is `optional` — so an empty response of the right case means \"no hook had\n * anything to say\", which is exactly true. Returns `null` for a request case\n * this build does not model, which the dispatcher answers with\n * `ExecClientThrow` rather than guessing a case.\n */\nexport function buildNeutralHookResult(request: ExecuteHookRequest | undefined): ExecuteHookResult | null {\n\tlet response: ExecuteHookResponse;\n\tswitch (request?.request.case) {\n\t\tcase \"preCompact\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"preCompact\", value: create(PreCompactRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"subagentStart\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"subagentStart\", value: create(SubagentStartRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"subagentStop\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"subagentStop\", value: create(SubagentStopRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"preToolUse\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"preToolUse\", value: create(PreToolUseRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"postToolUse\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"postToolUse\", value: create(PostToolUseRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"postToolUseFailure\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"postToolUseFailure\", value: create(PostToolUseFailureRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"beforeSubmitPrompt\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"beforeSubmitPrompt\", value: create(BeforeSubmitPromptRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"afterAgentResponse\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"afterAgentResponse\", value: create(AfterAgentResponseRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"afterAgentThought\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"afterAgentThought\", value: create(AfterAgentThoughtRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"stop\":\n\t\t\tresponse = create(ExecuteHookResponseSchema, {\n\t\t\t\tresponse: { case: \"stop\", value: create(StopRequestResponseSchema, {}) },\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n\treturn create(ExecuteHookResultSchema, { response });\n}\n"]}