@code-yeongyu/senpi 2026.9.12-3 → 2026.9.12

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 (1525) hide show
  1. package/CHANGELOG.md +0 -60
  2. package/README.md +1 -1
  3. package/dist/bun/cli.d.ts +1 -2
  4. package/dist/bun/cli.d.ts.map +1 -1
  5. package/dist/bun/cli.js +8 -5
  6. package/dist/bun/cli.js.map +1 -1
  7. package/dist/bun/register-bedrock.d.ts +2 -0
  8. package/dist/bun/register-bedrock.d.ts.map +1 -0
  9. package/dist/bun/register-bedrock.js +4 -0
  10. package/dist/bun/register-bedrock.js.map +1 -0
  11. package/dist/cli/config-selector.d.ts.map +1 -1
  12. package/dist/cli/config-selector.js +1 -2
  13. package/dist/cli/config-selector.js.map +1 -1
  14. package/dist/cli/experimental/auth.d.ts +16 -0
  15. package/dist/cli/experimental/auth.d.ts.map +1 -0
  16. package/dist/cli/experimental/auth.js +13 -0
  17. package/dist/cli/experimental/auth.js.map +1 -0
  18. package/dist/cli/experimental/cli.d.ts +6 -0
  19. package/dist/cli/experimental/cli.d.ts.map +1 -0
  20. package/dist/cli/experimental/cli.js +5 -0
  21. package/dist/cli/experimental/cli.js.map +1 -0
  22. package/dist/cli/experimental/command-options.d.ts +17 -0
  23. package/dist/cli/experimental/command-options.d.ts.map +1 -0
  24. package/dist/cli/experimental/command-options.js +35 -0
  25. package/dist/cli/experimental/command-options.js.map +1 -0
  26. package/dist/cli/experimental/command.d.ts +63 -0
  27. package/dist/cli/experimental/command.d.ts.map +1 -0
  28. package/dist/cli/experimental/command.js +127 -0
  29. package/dist/cli/experimental/command.js.map +1 -0
  30. package/dist/cli/experimental/commands/client.d.ts +13 -0
  31. package/dist/cli/experimental/commands/client.d.ts.map +1 -0
  32. package/dist/cli/experimental/commands/client.js +25 -0
  33. package/dist/cli/experimental/commands/client.js.map +1 -0
  34. package/dist/cli/experimental/commands/pi.d.ts +15 -0
  35. package/dist/cli/experimental/commands/pi.d.ts.map +1 -0
  36. package/dist/cli/experimental/commands/pi.js +28 -0
  37. package/dist/cli/experimental/commands/pi.js.map +1 -0
  38. package/dist/cli/experimental/commands/server.d.ts +13 -0
  39. package/dist/cli/experimental/commands/server.d.ts.map +1 -0
  40. package/dist/cli/experimental/commands/server.js +25 -0
  41. package/dist/cli/experimental/commands/server.js.map +1 -0
  42. package/dist/cli/experimental/transport-address.d.ts +10 -0
  43. package/dist/cli/experimental/transport-address.d.ts.map +1 -0
  44. package/dist/cli/experimental/transport-address.js +38 -0
  45. package/dist/cli/experimental/transport-address.js.map +1 -0
  46. package/dist/cli.js +0 -3
  47. package/dist/cli.js.map +1 -1
  48. package/dist/client/index.d.ts +2 -1
  49. package/dist/client/index.d.ts.map +1 -1
  50. package/dist/client/index.js +2 -1
  51. package/dist/client/index.js.map +1 -1
  52. package/dist/client/remote-session.d.ts +53 -0
  53. package/dist/client/remote-session.d.ts.map +1 -0
  54. package/dist/client/remote-session.js +340 -0
  55. package/dist/client/remote-session.js.map +1 -0
  56. package/dist/client/transcript.d.ts +12 -0
  57. package/dist/client/transcript.d.ts.map +1 -0
  58. package/dist/client/transcript.js +98 -0
  59. package/dist/client/transcript.js.map +1 -0
  60. package/dist/config.d.ts +0 -1
  61. package/dist/config.d.ts.map +1 -1
  62. package/dist/config.js +0 -1
  63. package/dist/config.js.map +1 -1
  64. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  65. package/dist/core/agent-session-runtime.js +6 -18
  66. package/dist/core/agent-session-runtime.js.map +1 -1
  67. package/dist/core/agent-session.d.ts +17 -54
  68. package/dist/core/agent-session.d.ts.map +1 -1
  69. package/dist/core/agent-session.js +157 -153
  70. package/dist/core/agent-session.js.map +1 -1
  71. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  72. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  73. package/dist/core/compaction/branch-summarization.js +4 -6
  74. package/dist/core/compaction/branch-summarization.js.map +1 -1
  75. package/dist/core/compaction-settings-access.d.ts +2 -18
  76. package/dist/core/compaction-settings-access.d.ts.map +1 -1
  77. package/dist/core/compaction-settings-access.js +4 -35
  78. package/dist/core/compaction-settings-access.js.map +1 -1
  79. package/dist/core/compaction-settings-resolver.d.ts +2 -2
  80. package/dist/core/compaction-settings-resolver.d.ts.map +1 -1
  81. package/dist/core/compaction-settings-resolver.js +3 -6
  82. package/dist/core/compaction-settings-resolver.js.map +1 -1
  83. package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -1
  84. package/dist/core/extensions/builtin/ask-user/extension.js +0 -11
  85. package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -1
  86. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
  87. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +1 -2
  88. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
  89. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  90. package/dist/core/extensions/builtin/prompt-preset/presets.js +1 -7
  91. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  92. package/dist/core/extensions/loader.d.ts.map +1 -1
  93. package/dist/core/extensions/loader.js +2 -4
  94. package/dist/core/extensions/loader.js.map +1 -1
  95. package/dist/core/keybindings.d.ts +0 -10
  96. package/dist/core/keybindings.d.ts.map +1 -1
  97. package/dist/core/keybindings.js +0 -8
  98. package/dist/core/keybindings.js.map +1 -1
  99. package/dist/core/messages.d.ts +1 -1
  100. package/dist/core/messages.d.ts.map +1 -1
  101. package/dist/core/messages.js.map +1 -1
  102. package/dist/core/model-registry.d.ts +1 -5
  103. package/dist/core/model-registry.d.ts.map +1 -1
  104. package/dist/core/model-registry.js +0 -8
  105. package/dist/core/model-registry.js.map +1 -1
  106. package/dist/core/model-resolver.d.ts.map +1 -1
  107. package/dist/core/model-resolver.js +0 -2
  108. package/dist/core/model-resolver.js.map +1 -1
  109. package/dist/core/model-runtime.d.ts +0 -1
  110. package/dist/core/model-runtime.d.ts.map +1 -1
  111. package/dist/core/model-runtime.js +2 -5
  112. package/dist/core/model-runtime.js.map +1 -1
  113. package/dist/core/retry-fallback/settings.d.ts +0 -2
  114. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  115. package/dist/core/retry-fallback/settings.js.map +1 -1
  116. package/dist/core/session-manager.d.ts +2 -5
  117. package/dist/core/session-manager.d.ts.map +1 -1
  118. package/dist/core/session-manager.js +19 -68
  119. package/dist/core/session-manager.js.map +1 -1
  120. package/dist/core/session-write-reservation.d.ts +0 -9
  121. package/dist/core/session-write-reservation.d.ts.map +1 -1
  122. package/dist/core/session-write-reservation.js +0 -33
  123. package/dist/core/session-write-reservation.js.map +1 -1
  124. package/dist/core/settings-manager.d.ts +5 -12
  125. package/dist/core/settings-manager.d.ts.map +1 -1
  126. package/dist/core/settings-manager.js +6 -18
  127. package/dist/core/settings-manager.js.map +1 -1
  128. package/dist/core/settings-public-types.d.ts +1 -1
  129. package/dist/core/settings-public-types.d.ts.map +1 -1
  130. package/dist/core/settings-public-types.js.map +1 -1
  131. package/dist/core/skills.d.ts +1 -1
  132. package/dist/core/skills.d.ts.map +1 -1
  133. package/dist/core/skills.js +2 -6
  134. package/dist/core/skills.js.map +1 -1
  135. package/dist/core/system-prompt.d.ts.map +1 -1
  136. package/dist/core/system-prompt.js +9 -8
  137. package/dist/core/system-prompt.js.map +1 -1
  138. package/dist/core/tools/bash.d.ts.map +1 -1
  139. package/dist/core/tools/bash.js +142 -3
  140. package/dist/core/tools/bash.js.map +1 -1
  141. package/dist/core/tools/edit.d.ts +12 -1
  142. package/dist/core/tools/edit.d.ts.map +1 -1
  143. package/dist/core/tools/edit.js +168 -4
  144. package/dist/core/tools/edit.js.map +1 -1
  145. package/dist/core/tools/find.d.ts.map +1 -1
  146. package/dist/core/tools/find.js +53 -2
  147. package/dist/core/tools/find.js.map +1 -1
  148. package/dist/core/tools/grep.d.ts.map +1 -1
  149. package/dist/core/tools/grep.js +58 -2
  150. package/dist/core/tools/grep.js.map +1 -1
  151. package/dist/core/tools/ls.d.ts.map +1 -1
  152. package/dist/core/tools/ls.js +47 -2
  153. package/dist/core/tools/ls.js.map +1 -1
  154. package/dist/core/tools/read.d.ts +4 -1
  155. package/dist/core/tools/read.d.ts.map +1 -1
  156. package/dist/core/tools/read.js +141 -4
  157. package/dist/core/tools/read.js.map +1 -1
  158. package/dist/core/tools/write.d.ts.map +1 -1
  159. package/dist/core/tools/write.js +153 -4
  160. package/dist/core/tools/write.js.map +1 -1
  161. package/dist/index.d.ts +2 -2
  162. package/dist/index.d.ts.map +1 -1
  163. package/dist/index.js.map +1 -1
  164. package/dist/migrations.d.ts.map +1 -1
  165. package/dist/migrations.js +2 -2
  166. package/dist/migrations.js.map +1 -1
  167. package/dist/modes/app-server/threads/turn-runtime.d.ts +1 -3
  168. package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
  169. package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
  170. package/dist/modes/app-server/threads/turns.js +1 -1
  171. package/dist/modes/app-server/threads/turns.js.map +1 -1
  172. package/dist/modes/app-server/turn-adapter.js +2 -4
  173. package/dist/modes/app-server/turn-adapter.js.map +1 -1
  174. package/dist/modes/interactive/components/ask-user-async-widget.d.ts +12 -17
  175. package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
  176. package/dist/modes/interactive/components/ask-user-async-widget.js +23 -47
  177. package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
  178. package/dist/modes/interactive/components/assistant-message.d.ts +0 -7
  179. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  180. package/dist/modes/interactive/components/assistant-message.js +2 -26
  181. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  182. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts +0 -4
  183. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
  184. package/dist/modes/interactive/components/assistant-render-descriptors.js +5 -8
  185. package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
  186. package/dist/modes/interactive/components/custom-editor.d.ts +1 -10
  187. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  188. package/dist/modes/interactive/components/custom-editor.js +1 -37
  189. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  190. package/dist/modes/interactive/components/index.d.ts +1 -1
  191. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  192. package/dist/modes/interactive/components/index.js.map +1 -1
  193. package/dist/modes/interactive/components/scoped-models-selector.js +8 -8
  194. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  195. package/dist/modes/interactive/components/status-indicator.d.ts +1 -4
  196. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  197. package/dist/modes/interactive/components/status-indicator.js +2 -14
  198. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  199. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  200. package/dist/modes/interactive/components/thinking-selector.js +4 -4
  201. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  202. package/dist/modes/interactive/components/tool-execution-renderer.d.ts +1 -4
  203. package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
  204. package/dist/modes/interactive/components/tool-execution-renderer.js +10 -23
  205. package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -1
  206. package/dist/modes/interactive/components/tool-execution-types.d.ts +2 -18
  207. package/dist/modes/interactive/components/tool-execution-types.d.ts.map +1 -1
  208. package/dist/modes/interactive/components/tool-execution-types.js.map +1 -1
  209. package/dist/modes/interactive/components/tool-execution.d.ts +3 -3
  210. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  211. package/dist/modes/interactive/components/tool-execution.js +0 -5
  212. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  213. package/dist/modes/interactive/interactive-mode.d.ts +15 -10
  214. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  215. package/dist/modes/interactive/interactive-mode.js +138 -178
  216. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  217. package/dist/modes/interactive/theme/dark.json +1 -2
  218. package/dist/modes/interactive/theme/grok-day.json +1 -2
  219. package/dist/modes/interactive/theme/grok-night.json +1 -2
  220. package/dist/modes/interactive/theme/light.json +1 -2
  221. package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
  222. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  223. package/dist/modes/interactive/theme/theme-controller.js +0 -5
  224. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  225. package/dist/modes/interactive/theme/theme-schema.json +2 -6
  226. package/dist/modes/interactive/theme/theme.d.ts +5 -10
  227. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  228. package/dist/modes/interactive/theme/theme.js +117 -14
  229. package/dist/modes/interactive/theme/theme.js.map +1 -1
  230. package/dist/modes/interactive/tips/catalog/input-tips.d.ts +0 -5
  231. package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
  232. package/dist/modes/interactive/tips/catalog/input-tips.js +0 -5
  233. package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
  234. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  235. package/dist/modes/rpc/connection-handler.js +2 -8
  236. package/dist/modes/rpc/connection-handler.js.map +1 -1
  237. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  238. package/dist/modes/rpc/rpc-client.js +1 -11
  239. package/dist/modes/rpc/rpc-client.js.map +1 -1
  240. package/dist/modes/rpc/rpc-types.d.ts +1 -2
  241. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  242. package/dist/modes/rpc/rpc-types.js +0 -1
  243. package/dist/modes/rpc/rpc-types.js.map +1 -1
  244. package/dist/modes/rpc/session-registry.d.ts +1 -3
  245. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  246. package/dist/modes/rpc/session-registry.js.map +1 -1
  247. package/dist/modes/rpc/session-worker-client.d.ts +8 -10
  248. package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
  249. package/dist/modes/rpc/session-worker-client.js +23 -14
  250. package/dist/modes/rpc/session-worker-client.js.map +1 -1
  251. package/dist/modes/rpc/session-worker-protocol.d.ts +0 -10
  252. package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
  253. package/dist/modes/rpc/session-worker-protocol.js +0 -2
  254. package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
  255. package/dist/modes/rpc/session-worker.js +16 -12
  256. package/dist/modes/rpc/session-worker.js.map +1 -1
  257. package/dist/modes/rpc/worker-session-registry.d.ts +0 -12
  258. package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
  259. package/dist/modes/rpc/worker-session-registry.js +24 -51
  260. package/dist/modes/rpc/worker-session-registry.js.map +1 -1
  261. package/dist/senpi +0 -3
  262. package/dist/server/create-harness.d.ts +26 -0
  263. package/dist/server/create-harness.d.ts.map +1 -0
  264. package/dist/server/create-harness.js +106 -0
  265. package/dist/server/create-harness.js.map +1 -0
  266. package/dist/utils/clipboard-image.d.ts.map +1 -1
  267. package/dist/utils/clipboard-image.js +69 -52
  268. package/dist/utils/clipboard-image.js.map +1 -1
  269. package/dist/utils/clipboard-native.d.ts +11 -0
  270. package/dist/utils/clipboard-native.d.ts.map +1 -0
  271. package/dist/utils/clipboard-native.js +20 -0
  272. package/dist/utils/clipboard-native.js.map +1 -0
  273. package/dist/utils/clipboard.d.ts.map +1 -1
  274. package/dist/utils/clipboard.js +126 -49
  275. package/dist/utils/clipboard.js.map +1 -1
  276. package/dist/utils/exif-orientation.d.ts.map +1 -1
  277. package/dist/utils/exif-orientation.js +3 -2
  278. package/dist/utils/exif-orientation.js.map +1 -1
  279. package/dist/utils/tools-manager.d.ts +0 -1
  280. package/dist/utils/tools-manager.d.ts.map +1 -1
  281. package/dist/utils/tools-manager.js +19 -41
  282. package/dist/utils/tools-manager.js.map +1 -1
  283. package/docs/AGENTS.md +67 -0
  284. package/docs/compaction.md +13 -39
  285. package/docs/containerization.md +0 -45
  286. package/docs/development.md +0 -19
  287. package/docs/docs.json +0 -4
  288. package/docs/environment-variables.md +0 -2
  289. package/docs/extensions.md +10 -21
  290. package/docs/keybindings.md +2 -7
  291. package/docs/models.md +1 -1
  292. package/docs/providers.md +1 -1
  293. package/docs/rpc.md +8 -16
  294. package/docs/sdk.md +0 -7
  295. package/docs/session-format.md +38 -52
  296. package/docs/settings.md +4 -40
  297. package/docs/skills.md +1 -1
  298. package/docs/termux.md +1 -0
  299. package/docs/themes.md +6 -8
  300. package/docs/tui.md +3 -22
  301. package/examples/README.md +0 -3
  302. package/examples/extensions/dynamic-resources/dynamic.json +0 -2
  303. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -1
  304. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +3 -3
  305. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +0 -5
  306. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +0 -1
  307. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +0 -1
  308. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +0 -1
  309. package/node_modules/@aws-sdk/core/package.json +1 -1
  310. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  311. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  312. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  313. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  314. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +0 -2
  315. package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +0 -2
  316. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  317. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  318. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  319. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  320. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  321. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  322. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  323. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  324. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  325. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  326. package/node_modules/@aws-sdk/token-providers/package.json +1 -1
  327. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -24
  328. package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
  329. package/node_modules/@earendil-works/pi-agent-core/README.md +0 -4
  330. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +384 -639
  331. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  332. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +250 -5
  333. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  334. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +6 -12
  335. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  336. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +27 -33
  337. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  338. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +8 -30
  339. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  340. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +64 -53
  341. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  342. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +28 -25
  343. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
  344. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +125 -368
  345. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
  346. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts +38 -20
  347. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
  348. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +55 -233
  349. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js.map +1 -1
  350. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +2 -2
  351. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
  352. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  353. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +2 -3
  354. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
  355. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +17 -17
  356. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
  357. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts +100 -0
  358. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +1 -0
  359. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +420 -0
  360. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +1 -0
  361. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts +0 -93
  362. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
  363. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +0 -39
  364. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js.map +1 -1
  365. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts +19 -6
  366. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts.map +1 -1
  367. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +53 -31
  368. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
  369. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts +5 -9
  370. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts.map +1 -1
  371. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +4 -7
  372. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js.map +1 -1
  373. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts +8 -19
  374. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map +1 -1
  375. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +219 -34
  376. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js.map +1 -1
  377. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts +9 -0
  378. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +1 -0
  379. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +18 -0
  380. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js.map +1 -0
  381. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +24 -27
  382. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
  383. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +151 -276
  384. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
  385. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts +41 -39
  386. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
  387. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +196 -175
  388. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
  389. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts +22 -23
  390. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts.map +1 -1
  391. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +1 -2
  392. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js.map +1 -1
  393. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts +3 -0
  394. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts.map +1 -0
  395. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +2 -0
  396. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js.map +1 -0
  397. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +40 -44
  398. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
  399. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +115 -333
  400. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
  401. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +51 -78
  402. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  403. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +207 -327
  404. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  405. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts +65 -0
  406. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +1 -0
  407. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +320 -0
  408. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +1 -0
  409. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts +4 -0
  410. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts.map +1 -0
  411. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +762 -0
  412. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +1 -0
  413. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts +2 -9
  414. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts.map +1 -1
  415. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +1 -8
  416. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js.map +1 -1
  417. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts +7 -5
  418. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts.map +1 -1
  419. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js.map +1 -1
  420. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +265 -425
  421. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
  422. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +7 -7
  423. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js.map +1 -1
  424. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +2 -3
  425. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  426. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +26 -29
  427. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  428. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +43 -64
  429. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
  430. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +26 -45
  431. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js.map +1 -1
  432. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts +4 -4
  433. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts.map +1 -1
  434. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +93 -66
  435. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js.map +1 -1
  436. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
  437. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +13 -17
  438. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
  439. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts +1 -2
  440. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts.map +1 -1
  441. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +5 -5
  442. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js.map +1 -1
  443. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts +2 -3
  444. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts.map +1 -1
  445. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +5 -5
  446. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js.map +1 -1
  447. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts +1 -2
  448. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts.map +1 -1
  449. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +6 -4
  450. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js.map +1 -1
  451. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.d.ts.map +1 -1
  452. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +8 -12
  453. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
  454. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +45 -128
  455. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  456. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  457. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +5 -19
  458. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
  459. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +192 -65
  460. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
  461. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +0 -1
  462. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
  463. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +1 -1
  464. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
  465. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -4
  466. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  467. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -3
  468. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  469. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +16 -24
  470. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts.map +1 -1
  471. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +1 -1
  472. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js.map +1 -1
  473. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts +29 -0
  474. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts.map +1 -0
  475. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +103 -0
  476. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +1 -0
  477. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +0 -2
  478. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  479. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  480. package/node_modules/@earendil-works/pi-agent-core/package.json +6 -27
  481. package/node_modules/@earendil-works/pi-ai/README.md +4 -39
  482. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  483. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +1 -8
  484. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  485. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts +69 -0
  486. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts.map +1 -0
  487. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +159 -0
  488. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js.map +1 -0
  489. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +0 -11
  490. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
  491. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +0 -18
  492. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
  493. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +1 -1
  494. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  495. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +1 -5
  496. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  497. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -4
  498. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  499. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  500. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -6
  501. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  502. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  503. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +1 -4
  504. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  505. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  506. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +3 -13
  507. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  508. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
  509. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +1 -2
  510. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
  511. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -2
  512. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  513. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -2
  514. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  515. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +0 -1
  516. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  517. package/node_modules/@earendil-works/pi-ai/dist/models.js +2 -5
  518. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  519. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +1 -1
  520. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
  521. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.js.map +1 -1
  522. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
  523. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +0 -4
  524. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
  525. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
  526. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +1 -2
  527. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
  528. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  529. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  530. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  531. package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -1
  532. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  533. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  534. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  535. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  536. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  537. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
  538. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  539. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  540. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
  541. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  542. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -1
  543. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +3 -4
  544. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  545. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts.map +1 -1
  546. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js +4 -5
  547. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js.map +1 -1
  548. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +6 -16
  549. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  550. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  551. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  552. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +5 -25
  553. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  554. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +1 -1
  555. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  556. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +1 -5
  557. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  558. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts +1 -10
  559. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -1
  560. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -1
  561. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +2 -13
  562. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  563. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +7 -18
  564. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  565. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts +2 -2
  566. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts.map +1 -1
  567. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +31 -36
  568. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js.map +1 -1
  569. package/node_modules/@earendil-works/pi-ai/package.json +6 -6
  570. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  571. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  572. package/node_modules/@earendil-works/pi-tui/README.md +4 -53
  573. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts +1 -21
  574. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
  575. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +42 -199
  576. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js.map +1 -1
  577. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -3
  578. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  579. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -28
  580. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  581. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +1 -6
  582. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  583. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +18 -98
  584. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  585. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +1 -12
  586. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  587. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +6 -40
  588. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  589. package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
  590. package/node_modules/@earendil-works/pi-tui/dist/components/latex.js +0 -7
  591. package/node_modules/@earendil-works/pi-tui/dist/components/latex.js.map +1 -1
  592. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -3
  593. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
  594. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +8 -20
  595. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
  596. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +3 -6
  597. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
  598. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +1 -6
  599. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
  600. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +1 -4
  601. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
  602. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +2 -48
  603. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
  604. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +1 -5
  605. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  606. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +5 -54
  607. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  608. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -3
  609. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  610. package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -3
  611. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  612. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +1 -3
  613. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -1
  614. package/node_modules/@earendil-works/pi-tui/dist/layout.js +9 -32
  615. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -1
  616. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +1 -2
  617. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  618. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +44 -3
  619. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  620. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  621. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +20 -2
  622. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  623. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +1 -31
  624. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  625. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +41 -335
  626. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  627. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +5 -83
  628. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  629. package/node_modules/@earendil-works/pi-tui/dist/tui.js +4 -118
  630. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  631. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -2
  632. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  633. package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -9
  634. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  635. package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +6 -8
  636. package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +5 -12
  637. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-platform.node → darwin-modifiers.node} +0 -0
  638. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-platform.node → darwin-modifiers.node} +0 -0
  639. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +70 -0
  640. package/node_modules/@earendil-works/pi-tui/native/win32/README.md +7 -18
  641. package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +4 -7
  642. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  643. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  644. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +119 -0
  645. package/node_modules/@earendil-works/pi-tui/package.json +3 -10
  646. package/node_modules/@google/genai/dist/genai.d.ts +278 -1788
  647. package/node_modules/@google/genai/dist/index.cjs +299 -319
  648. package/node_modules/@google/genai/dist/index.mjs +299 -319
  649. package/node_modules/@google/genai/dist/index.mjs.map +1 -1
  650. package/node_modules/@google/genai/dist/node/index.cjs +300 -320
  651. package/node_modules/@google/genai/dist/node/index.mjs +300 -320
  652. package/node_modules/@google/genai/dist/node/index.mjs.map +1 -1
  653. package/node_modules/@google/genai/dist/node/node.d.ts +278 -1788
  654. package/node_modules/@google/genai/dist/tokenizer/node.cjs +2 -49
  655. package/node_modules/@google/genai/dist/tokenizer/node.d.ts +3 -43
  656. package/node_modules/@google/genai/dist/tokenizer/node.mjs +2 -49
  657. package/node_modules/@google/genai/dist/tokenizer/node.mjs.map +1 -1
  658. package/node_modules/@google/genai/dist/vertex_internal/index.cjs +3 -39
  659. package/node_modules/@google/genai/dist/vertex_internal/index.cjs.map +1 -1
  660. package/node_modules/@google/genai/dist/vertex_internal/index.d.ts +9 -51
  661. package/node_modules/@google/genai/dist/vertex_internal/index.js +3 -39
  662. package/node_modules/@google/genai/dist/vertex_internal/index.js.map +1 -1
  663. package/node_modules/@google/genai/dist/web/index.mjs +299 -319
  664. package/node_modules/@google/genai/dist/web/index.mjs.map +1 -1
  665. package/node_modules/@google/genai/dist/web/web.d.ts +278 -1788
  666. package/node_modules/@google/genai/package.json +1 -1
  667. package/node_modules/@mariozechner/clipboard/.yarnrc.yml +1 -0
  668. package/node_modules/@mariozechner/clipboard/Cargo.toml +45 -0
  669. package/node_modules/@mariozechner/clipboard/README.md +60 -0
  670. package/node_modules/@mariozechner/clipboard/build.rs +5 -0
  671. package/node_modules/@mariozechner/clipboard/exp.ts +12 -0
  672. package/node_modules/@mariozechner/clipboard/index.d.ts +37 -0
  673. package/node_modules/@mariozechner/clipboard/index.js +606 -0
  674. package/node_modules/@mariozechner/clipboard/package.json +45 -0
  675. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +307 -0
  676. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +93 -0
  677. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +313 -0
  678. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +471 -0
  679. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +252 -0
  680. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +431 -0
  681. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +712 -0
  682. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +916 -0
  683. package/node_modules/@mariozechner/clipboard/src/lib.rs +194 -0
  684. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +4 -11
  685. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +0 -1
  686. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +3 -2
  687. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +1 -8
  688. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  689. package/node_modules/ignore/README.md +0 -52
  690. package/node_modules/ignore/index.js +129 -785
  691. package/node_modules/ignore/legacy.js +98 -660
  692. package/node_modules/ignore/package.json +4 -10
  693. package/node_modules/marked/README.md +0 -1
  694. package/node_modules/marked/lib/marked.d.ts +0 -7
  695. package/node_modules/marked/lib/marked.esm.js +30 -30
  696. package/node_modules/marked/lib/marked.esm.js.map +3 -3
  697. package/node_modules/marked/lib/marked.umd.js +30 -30
  698. package/node_modules/marked/lib/marked.umd.js.map +3 -3
  699. package/node_modules/marked/man/marked.1 +1 -1
  700. package/node_modules/marked/package.json +2 -2
  701. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  702. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  703. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +5 -7
  704. package/node_modules/typebox/build/format/iri.mjs +1 -5
  705. package/node_modules/typebox/build/guard/emit.mjs +4 -2
  706. package/node_modules/typebox/build/guard/guard.mjs +18 -6
  707. package/node_modules/typebox/build/guard/string.mjs +24 -16
  708. package/node_modules/typebox/build/schema/compile.d.mts +2 -3
  709. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  710. package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -1
  711. package/node_modules/typebox/build/schema/engine/_context.mjs +14 -9
  712. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  713. package/node_modules/typebox/build/schema/engine/_stack.d.mts +2 -6
  714. package/node_modules/typebox/build/schema/engine/_stack.mjs +32 -135
  715. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -16
  716. package/node_modules/typebox/build/schema/engine/allOf.mjs +2 -2
  717. package/node_modules/typebox/build/schema/engine/anyOf.mjs +2 -2
  718. package/node_modules/typebox/build/schema/engine/if.mjs +2 -2
  719. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  720. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +3 -1
  721. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  722. package/node_modules/typebox/build/schema/engine/schema.mjs +0 -6
  723. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  724. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  725. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  726. package/node_modules/typebox/build/schema/errors.mjs +13 -7
  727. package/node_modules/typebox/build/schema/parse.d.mts +0 -1
  728. package/node_modules/typebox/build/schema/parse.mjs +5 -10
  729. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +3 -34
  730. package/node_modules/typebox/build/schema/resolve/resolve.mjs +73 -198
  731. package/node_modules/typebox/build/schema/schema.d.mts +0 -1
  732. package/node_modules/typebox/build/schema/schema.mjs +0 -1
  733. package/node_modules/typebox/build/value/errors/errors.d.mts +12 -2
  734. package/node_modules/typebox/build/value/errors/errors.mjs +7 -2
  735. package/node_modules/typebox/package.json +1 -1
  736. package/node_modules/typebox/readme.md +5 -9
  737. package/node_modules/undici/docs/docs/api/Client.md +0 -4
  738. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +2 -3
  739. package/node_modules/undici/docs/docs/api/EventSource.md +0 -4
  740. package/node_modules/undici/docs/docs/api/Interceptors.md +3 -7
  741. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +1 -7
  742. package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  743. package/node_modules/undici/lib/core/symbols.js +0 -2
  744. package/node_modules/undici/lib/dispatcher/agent.js +2 -7
  745. package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -7
  746. package/node_modules/undici/lib/dispatcher/client-h1.js +4 -12
  747. package/node_modules/undici/lib/dispatcher/client-h2.js +3 -43
  748. package/node_modules/undici/lib/dispatcher/client.js +2 -3
  749. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -13
  750. package/node_modules/undici/lib/dispatcher/dispatcher.js +1 -15
  751. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -3
  752. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +3 -10
  753. package/node_modules/undici/lib/dispatcher/proxy-agent.js +1 -18
  754. package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -3
  755. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  756. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +21 -91
  757. package/node_modules/undici/lib/handler/cache-handler.js +5 -29
  758. package/node_modules/undici/lib/handler/decorator-handler.js +1 -7
  759. package/node_modules/undici/lib/handler/deduplication-handler.js +6 -12
  760. package/node_modules/undici/lib/handler/redirect-handler.js +4 -21
  761. package/node_modules/undici/lib/handler/retry-handler.js +30 -148
  762. package/node_modules/undici/lib/interceptor/cache.js +12 -65
  763. package/node_modules/undici/lib/interceptor/decompress.js +13 -115
  764. package/node_modules/undici/lib/interceptor/deduplicate.js +4 -5
  765. package/node_modules/undici/lib/interceptor/dns.js +0 -7
  766. package/node_modules/undici/lib/interceptor/dump.js +23 -10
  767. package/node_modules/undici/lib/mock/mock-agent.js +1 -13
  768. package/node_modules/undici/lib/mock/mock-utils.js +10 -11
  769. package/node_modules/undici/lib/util/cache.js +3 -45
  770. package/node_modules/undici/lib/web/cookies/parse.js +147 -150
  771. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +1 -28
  772. package/node_modules/undici/lib/web/eventsource/eventsource.js +3 -13
  773. package/node_modules/undici/lib/web/fetch/index.js +0 -6
  774. package/node_modules/undici/lib/web/fetch/request.js +3 -2
  775. package/node_modules/undici/lib/web/fetch/util.js +1 -6
  776. package/node_modules/undici/lib/web/webidl/index.js +3 -3
  777. package/node_modules/undici/lib/web/websocket/connection.js +1 -1
  778. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -5
  779. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +10 -8
  780. package/node_modules/undici/package.json +3 -3
  781. package/node_modules/undici/types/client.d.ts +0 -10
  782. package/node_modules/undici/types/interceptors.d.ts +0 -2
  783. package/node_modules/undici/types/mock-agent.d.ts +10 -11
  784. package/node_modules/undici/types/socks5-proxy-agent.d.ts +0 -2
  785. package/package.json +49 -70
  786. package/vendor/pi-client/client.d.ts +15 -20
  787. package/vendor/pi-client/client.d.ts.map +1 -1
  788. package/vendor/pi-client/client.js +245 -248
  789. package/vendor/pi-client/client.js.map +1 -1
  790. package/vendor/pi-client/connection.d.ts +3 -4
  791. package/vendor/pi-client/connection.d.ts.map +1 -1
  792. package/vendor/pi-client/connection.js +9 -13
  793. package/vendor/pi-client/connection.js.map +1 -1
  794. package/vendor/pi-client/errors.d.ts +15 -6
  795. package/vendor/pi-client/errors.d.ts.map +1 -1
  796. package/vendor/pi-client/errors.js +25 -10
  797. package/vendor/pi-client/errors.js.map +1 -1
  798. package/vendor/pi-client/index.d.ts +4 -3
  799. package/vendor/pi-client/index.d.ts.map +1 -1
  800. package/vendor/pi-client/index.js +2 -2
  801. package/vendor/pi-client/index.js.map +1 -1
  802. package/vendor/pi-client/session-handle.d.ts +54 -0
  803. package/vendor/pi-client/session-handle.d.ts.map +1 -0
  804. package/vendor/pi-client/session-handle.js +50 -0
  805. package/vendor/pi-client/session-handle.js.map +1 -0
  806. package/vendor/pi-client/state.d.ts +22 -0
  807. package/vendor/pi-client/state.d.ts.map +1 -0
  808. package/vendor/pi-client/state.js +145 -0
  809. package/vendor/pi-client/state.js.map +1 -0
  810. package/vendor/pi-client/types.d.ts +8 -14
  811. package/vendor/pi-client/types.d.ts.map +1 -1
  812. package/vendor/pi-client/types.js.map +1 -1
  813. package/vendor/pi-client/unix.d.ts +1 -14
  814. package/vendor/pi-client/unix.d.ts.map +1 -1
  815. package/vendor/pi-client/unix.js +8 -138
  816. package/vendor/pi-client/unix.js.map +1 -1
  817. package/vendor/pi-protocol/codec.d.ts +4 -2
  818. package/vendor/pi-protocol/codec.d.ts.map +1 -1
  819. package/vendor/pi-protocol/codec.js +34 -7
  820. package/vendor/pi-protocol/codec.js.map +1 -1
  821. package/vendor/pi-protocol/framing.d.ts +2 -0
  822. package/vendor/pi-protocol/framing.d.ts.map +1 -1
  823. package/vendor/pi-protocol/framing.js +15 -0
  824. package/vendor/pi-protocol/framing.js.map +1 -1
  825. package/vendor/pi-protocol/index.d.ts +1 -1
  826. package/vendor/pi-protocol/index.d.ts.map +1 -1
  827. package/vendor/pi-protocol/index.js +1 -1
  828. package/vendor/pi-protocol/index.js.map +1 -1
  829. package/vendor/pi-protocol/schemas.d.ts +13739 -0
  830. package/vendor/pi-protocol/schemas.d.ts.map +1 -0
  831. package/vendor/pi-protocol/schemas.js +386 -0
  832. package/vendor/pi-protocol/schemas.js.map +1 -0
  833. package/dist/bun/runtime-setup.d.ts +0 -2
  834. package/dist/bun/runtime-setup.d.ts.map +0 -1
  835. package/dist/bun/runtime-setup.js +0 -9
  836. package/dist/bun/runtime-setup.js.map +0 -1
  837. package/dist/bun/sandbox-env-setup.d.ts +0 -2
  838. package/dist/bun/sandbox-env-setup.d.ts.map +0 -1
  839. package/dist/bun/sandbox-env-setup.js +0 -4
  840. package/dist/bun/sandbox-env-setup.js.map +0 -1
  841. package/dist/cli/setup.d.ts +0 -2
  842. package/dist/cli/setup.d.ts.map +0 -1
  843. package/dist/cli/setup.js +0 -12
  844. package/dist/cli/setup.js.map +0 -1
  845. package/dist/core/cursor-history-admission.d.ts +0 -50
  846. package/dist/core/cursor-history-admission.d.ts.map +0 -1
  847. package/dist/core/cursor-history-admission.js +0 -130
  848. package/dist/core/cursor-history-admission.js.map +0 -1
  849. package/dist/core/tools/renderers/bash.d.ts +0 -12
  850. package/dist/core/tools/renderers/bash.d.ts.map +0 -1
  851. package/dist/core/tools/renderers/bash.js +0 -156
  852. package/dist/core/tools/renderers/bash.js.map +0 -1
  853. package/dist/core/tools/renderers/edit.d.ts +0 -23
  854. package/dist/core/tools/renderers/edit.d.ts.map +0 -1
  855. package/dist/core/tools/renderers/edit.js +0 -172
  856. package/dist/core/tools/renderers/edit.js.map +0 -1
  857. package/dist/core/tools/renderers/find.d.ts +0 -10
  858. package/dist/core/tools/renderers/find.d.ts.map +0 -1
  859. package/dist/core/tools/renderers/find.js +0 -64
  860. package/dist/core/tools/renderers/find.js.map +0 -1
  861. package/dist/core/tools/renderers/grep.d.ts +0 -10
  862. package/dist/core/tools/renderers/grep.d.ts.map +0 -1
  863. package/dist/core/tools/renderers/grep.js +0 -69
  864. package/dist/core/tools/renderers/grep.js.map +0 -1
  865. package/dist/core/tools/renderers/index.d.ts +0 -28
  866. package/dist/core/tools/renderers/index.d.ts.map +0 -1
  867. package/dist/core/tools/renderers/index.js +0 -47
  868. package/dist/core/tools/renderers/index.js.map +0 -1
  869. package/dist/core/tools/renderers/ls.d.ts +0 -10
  870. package/dist/core/tools/renderers/ls.d.ts.map +0 -1
  871. package/dist/core/tools/renderers/ls.js +0 -58
  872. package/dist/core/tools/renderers/ls.js.map +0 -1
  873. package/dist/core/tools/renderers/read.d.ts +0 -19
  874. package/dist/core/tools/renderers/read.d.ts.map +0 -1
  875. package/dist/core/tools/renderers/read.js +0 -149
  876. package/dist/core/tools/renderers/read.js.map +0 -1
  877. package/dist/core/tools/renderers/write.d.ts +0 -10
  878. package/dist/core/tools/renderers/write.d.ts.map +0 -1
  879. package/dist/core/tools/renderers/write.js +0 -162
  880. package/dist/core/tools/renderers/write.js.map +0 -1
  881. package/dist/modes/interactive/chat-viewport.d.ts +0 -22
  882. package/dist/modes/interactive/chat-viewport.d.ts.map +0 -1
  883. package/dist/modes/interactive/chat-viewport.js +0 -29
  884. package/dist/modes/interactive/chat-viewport.js.map +0 -1
  885. package/dist/modes/interactive/components/ask-user-answer-key.d.ts +0 -14
  886. package/dist/modes/interactive/components/ask-user-answer-key.d.ts.map +0 -1
  887. package/dist/modes/interactive/components/ask-user-answer-key.js +0 -65
  888. package/dist/modes/interactive/components/ask-user-answer-key.js.map +0 -1
  889. package/dist/modes/interactive/theme/theme-json.d.ts +0 -84
  890. package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  891. package/dist/modes/interactive/theme/theme-json.js +0 -130
  892. package/dist/modes/interactive/theme/theme-json.js.map +0 -1
  893. package/dist/modes/interactive/tui-renderer.d.ts +0 -21
  894. package/dist/modes/interactive/tui-renderer.d.ts.map +0 -1
  895. package/dist/modes/interactive/tui-renderer.js +0 -67
  896. package/dist/modes/interactive/tui-renderer.js.map +0 -1
  897. package/dist/modes/rpc/session-path-reservations.d.ts +0 -30
  898. package/dist/modes/rpc/session-path-reservations.d.ts.map +0 -1
  899. package/dist/modes/rpc/session-path-reservations.js +0 -58
  900. package/dist/modes/rpc/session-path-reservations.js.map +0 -1
  901. package/dist/modes/rpc/session-worker-credit.d.ts +0 -17
  902. package/dist/modes/rpc/session-worker-credit.d.ts.map +0 -1
  903. package/dist/modes/rpc/session-worker-credit.js +0 -39
  904. package/dist/modes/rpc/session-worker-credit.js.map +0 -1
  905. package/dist/modes/rpc/session-worker-signals.d.ts +0 -7
  906. package/dist/modes/rpc/session-worker-signals.d.ts.map +0 -1
  907. package/dist/modes/rpc/session-worker-signals.js +0 -19
  908. package/dist/modes/rpc/session-worker-signals.js.map +0 -1
  909. package/dist/utils/clipboard-command.d.ts +0 -7
  910. package/dist/utils/clipboard-command.d.ts.map +0 -1
  911. package/dist/utils/clipboard-command.js +0 -45
  912. package/dist/utils/clipboard-command.js.map +0 -1
  913. package/examples/plugins/pi-example-plugin/README.md +0 -38
  914. package/examples/plugins/pi-example-plugin/package.json +0 -10
  915. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  916. package/examples/plugins/pi-example-plugin/src/session.ts +0 -23
  917. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
  918. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +0 -3
  919. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +0 -4
  920. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +0 -1
  921. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +0 -201
  922. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +0 -62
  923. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +0 -158
  924. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +0 -2
  925. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +0 -16
  926. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +0 -84
  927. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +0 -8
  928. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +0 -11
  929. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +0 -10
  930. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +0 -4
  931. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +0 -5
  932. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +0 -7
  933. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +0 -7
  934. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +0 -8
  935. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +0 -8
  936. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +0 -18
  937. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +0 -12
  938. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +0 -9
  939. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +0 -8
  940. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +0 -7
  941. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +0 -7
  942. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +0 -18
  943. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +0 -3
  944. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +0 -8
  945. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +0 -10
  946. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +0 -5
  947. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +0 -9
  948. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +0 -7
  949. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +0 -7
  950. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +0 -3
  951. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +0 -2
  952. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +0 -1
  953. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +0 -2
  954. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +0 -5
  955. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +0 -4
  956. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +0 -5
  957. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +0 -69
  958. package/node_modules/@earendil-works/chord/README.md +0 -205
  959. package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -15
  960. package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
  961. package/node_modules/@earendil-works/chord/dist/api.js +0 -72
  962. package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
  963. package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
  964. package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
  965. package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
  966. package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
  967. package/node_modules/@earendil-works/chord/dist/context/index.d.ts +0 -24
  968. package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +0 -1
  969. package/node_modules/@earendil-works/chord/dist/context/index.js +0 -97
  970. package/node_modules/@earendil-works/chord/dist/context/index.js.map +0 -1
  971. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +0 -119
  972. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +0 -1
  973. package/node_modules/@earendil-works/chord/dist/delta/index.js +0 -1209
  974. package/node_modules/@earendil-works/chord/dist/delta/index.js.map +0 -1
  975. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
  976. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
  977. package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -762
  978. package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
  979. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
  980. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
  981. package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
  982. package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
  983. package/node_modules/@earendil-works/chord/dist/index.d.ts +0 -11
  984. package/node_modules/@earendil-works/chord/dist/index.d.ts.map +0 -1
  985. package/node_modules/@earendil-works/chord/dist/index.js +0 -10
  986. package/node_modules/@earendil-works/chord/dist/index.js.map +0 -1
  987. package/node_modules/@earendil-works/chord/dist/json.d.ts +0 -4
  988. package/node_modules/@earendil-works/chord/dist/json.d.ts.map +0 -1
  989. package/node_modules/@earendil-works/chord/dist/json.js +0 -57
  990. package/node_modules/@earendil-works/chord/dist/json.js.map +0 -1
  991. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
  992. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
  993. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
  994. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
  995. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
  996. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
  997. package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
  998. package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
  999. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
  1000. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
  1001. package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
  1002. package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
  1003. package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
  1004. package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
  1005. package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
  1006. package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
  1007. package/node_modules/@earendil-works/chord/dist/node.d.ts +0 -5
  1008. package/node_modules/@earendil-works/chord/dist/node.d.ts.map +0 -1
  1009. package/node_modules/@earendil-works/chord/dist/node.js +0 -3
  1010. package/node_modules/@earendil-works/chord/dist/node.js.map +0 -1
  1011. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
  1012. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
  1013. package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -535
  1014. package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
  1015. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
  1016. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
  1017. package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -21
  1018. package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
  1019. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
  1020. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
  1021. package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -99
  1022. package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
  1023. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -25
  1024. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
  1025. package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -137
  1026. package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
  1027. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
  1028. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
  1029. package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
  1030. package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
  1031. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
  1032. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
  1033. package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -472
  1034. package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
  1035. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
  1036. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
  1037. package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -115
  1038. package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
  1039. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -11
  1040. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
  1041. package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
  1042. package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
  1043. package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -23
  1044. package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
  1045. package/node_modules/@earendil-works/chord/dist/services/state.js +0 -124
  1046. package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
  1047. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -60
  1048. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
  1049. package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -173
  1050. package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
  1051. package/node_modules/@earendil-works/chord/dist/types.d.ts +0 -203
  1052. package/node_modules/@earendil-works/chord/dist/types.d.ts.map +0 -1
  1053. package/node_modules/@earendil-works/chord/dist/types.js +0 -2
  1054. package/node_modules/@earendil-works/chord/dist/types.js.map +0 -1
  1055. package/node_modules/@earendil-works/chord/package.json +0 -73
  1056. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts +0 -9
  1057. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts.map +0 -1
  1058. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +0 -35
  1059. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js.map +0 -1
  1060. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts +0 -9
  1061. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts.map +0 -1
  1062. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +0 -13
  1063. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js.map +0 -1
  1064. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts +0 -42
  1065. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts.map +0 -1
  1066. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +0 -82
  1067. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js.map +0 -1
  1068. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts +0 -22
  1069. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts.map +0 -1
  1070. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +0 -48
  1071. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js.map +0 -1
  1072. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts +0 -67
  1073. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts.map +0 -1
  1074. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +0 -121
  1075. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js.map +0 -1
  1076. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts +0 -38
  1077. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts.map +0 -1
  1078. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +0 -404
  1079. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js.map +0 -1
  1080. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts +0 -28
  1081. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts.map +0 -1
  1082. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +0 -173
  1083. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js.map +0 -1
  1084. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts +0 -8
  1085. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts.map +0 -1
  1086. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +0 -133
  1087. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js.map +0 -1
  1088. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts +0 -15
  1089. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts.map +0 -1
  1090. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +0 -179
  1091. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js.map +0 -1
  1092. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts +0 -8
  1093. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts.map +0 -1
  1094. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +0 -205
  1095. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js.map +0 -1
  1096. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts +0 -5
  1097. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts.map +0 -1
  1098. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +0 -140
  1099. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js.map +0 -1
  1100. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts +0 -8
  1101. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts.map +0 -1
  1102. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +0 -85
  1103. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js.map +0 -1
  1104. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts +0 -23
  1105. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts.map +0 -1
  1106. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +0 -394
  1107. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js.map +0 -1
  1108. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts +0 -4
  1109. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts.map +0 -1
  1110. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +0 -34
  1111. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js.map +0 -1
  1112. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts +0 -32
  1113. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts.map +0 -1
  1114. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +0 -929
  1115. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js.map +0 -1
  1116. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts +0 -7
  1117. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts.map +0 -1
  1118. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +0 -49
  1119. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js.map +0 -1
  1120. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts +0 -14
  1121. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts.map +0 -1
  1122. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +0 -244
  1123. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js.map +0 -1
  1124. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts +0 -6
  1125. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts.map +0 -1
  1126. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +0 -449
  1127. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js.map +0 -1
  1128. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts +0 -6
  1129. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts.map +0 -1
  1130. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +0 -93
  1131. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js.map +0 -1
  1132. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts +0 -59
  1133. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts.map +0 -1
  1134. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +0 -302
  1135. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js.map +0 -1
  1136. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts +0 -2
  1137. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts.map +0 -1
  1138. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +0 -2
  1139. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js.map +0 -1
  1140. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts +0 -118
  1141. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts.map +0 -1
  1142. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +0 -1559
  1143. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js.map +0 -1
  1144. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts +0 -15
  1145. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts.map +0 -1
  1146. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +0 -66
  1147. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js.map +0 -1
  1148. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts +0 -5
  1149. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts.map +0 -1
  1150. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +0 -240
  1151. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js.map +0 -1
  1152. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts +0 -24
  1153. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts.map +0 -1
  1154. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +0 -117
  1155. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js.map +0 -1
  1156. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts +0 -21
  1157. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts.map +0 -1
  1158. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +0 -72
  1159. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js.map +0 -1
  1160. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts +0 -105
  1161. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts.map +0 -1
  1162. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +0 -50
  1163. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js.map +0 -1
  1164. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts +0 -53
  1165. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts.map +0 -1
  1166. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +0 -57
  1167. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js.map +0 -1
  1168. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts +0 -21
  1169. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts.map +0 -1
  1170. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +0 -55
  1171. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js.map +0 -1
  1172. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +0 -16
  1173. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +0 -1
  1174. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +0 -79
  1175. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +0 -1
  1176. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts +0 -39
  1177. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts.map +0 -1
  1178. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +0 -269
  1179. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js.map +0 -1
  1180. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts +0 -38
  1181. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts.map +0 -1
  1182. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +0 -266
  1183. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js.map +0 -1
  1184. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts +0 -4
  1185. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts.map +0 -1
  1186. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +0 -4
  1187. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js.map +0 -1
  1188. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts +0 -14
  1189. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts.map +0 -1
  1190. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +0 -86
  1191. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js.map +0 -1
  1192. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts +0 -44
  1193. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts.map +0 -1
  1194. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +0 -454
  1195. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js.map +0 -1
  1196. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts +0 -8
  1197. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts.map +0 -1
  1198. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +0 -22
  1199. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js.map +0 -1
  1200. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts +0 -12
  1201. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts.map +0 -1
  1202. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +0 -24
  1203. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js.map +0 -1
  1204. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts +0 -42
  1205. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts.map +0 -1
  1206. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +0 -127
  1207. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js.map +0 -1
  1208. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts +0 -25
  1209. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts.map +0 -1
  1210. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +0 -114
  1211. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js.map +0 -1
  1212. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts +0 -23
  1213. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts.map +0 -1
  1214. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +0 -809
  1215. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js.map +0 -1
  1216. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts +0 -4
  1217. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts.map +0 -1
  1218. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +0 -600
  1219. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js.map +0 -1
  1220. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts +0 -26
  1221. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts.map +0 -1
  1222. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +0 -103
  1223. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js.map +0 -1
  1224. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts +0 -11
  1225. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts.map +0 -1
  1226. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +0 -19
  1227. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js.map +0 -1
  1228. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts +0 -20
  1229. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts.map +0 -1
  1230. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +0 -40
  1231. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js.map +0 -1
  1232. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts +0 -95
  1233. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts.map +0 -1
  1234. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +0 -81
  1235. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js.map +0 -1
  1236. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts +0 -24
  1237. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts.map +0 -1
  1238. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +0 -79
  1239. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js.map +0 -1
  1240. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts +0 -31
  1241. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts.map +0 -1
  1242. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +0 -217
  1243. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js.map +0 -1
  1244. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts +0 -4
  1245. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts.map +0 -1
  1246. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +0 -33
  1247. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js.map +0 -1
  1248. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts +0 -77
  1249. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts.map +0 -1
  1250. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js +0 -72
  1251. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js.map +0 -1
  1252. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +0 -32
  1253. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +0 -1
  1254. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +0 -62
  1255. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +0 -1
  1256. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts +0 -4
  1257. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts.map +0 -1
  1258. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js +0 -22
  1259. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js.map +0 -1
  1260. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +0 -77
  1261. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts.map +0 -1
  1262. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +0 -427
  1263. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js.map +0 -1
  1264. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +0 -12
  1265. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +0 -1
  1266. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +0 -93
  1267. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +0 -1
  1268. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts +0 -12
  1269. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts.map +0 -1
  1270. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +0 -19
  1271. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js.map +0 -1
  1272. package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts +0 -18
  1273. package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts.map +0 -1
  1274. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +0 -42
  1275. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js.map +0 -1
  1276. package/node_modules/@earendil-works/pi-tui/native/clipboard.h +0 -170
  1277. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +0 -93
  1278. package/node_modules/@earendil-works/pi-tui/native/linux/README.md +0 -23
  1279. package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +0 -65
  1280. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  1281. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  1282. package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +0 -70
  1283. package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +0 -274
  1284. package/node_modules/@earendil-works/pi-tui/native/napi.h +0 -89
  1285. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  1286. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  1287. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +0 -241
  1288. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/LICENSE +0 -201
  1289. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/README.md +0 -115
  1290. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-cjs/index.js +0 -96
  1291. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort-handler.js +0 -1
  1292. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort.js +0 -1
  1293. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +0 -5
  1294. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +0 -1
  1295. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +0 -1
  1296. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +0 -1
  1297. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +0 -1
  1298. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/auth.js +0 -5
  1299. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/index.js +0 -2
  1300. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +0 -1
  1301. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/checksum.js +0 -1
  1302. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/client.js +0 -1
  1303. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/command.js +0 -1
  1304. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/config.js +0 -1
  1305. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/index.js +0 -1
  1306. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/manager.js +0 -1
  1307. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/pool.js +0 -1
  1308. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/crypto.js +0 -1
  1309. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +0 -1
  1310. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/encode.js +0 -1
  1311. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoint.js +0 -5
  1312. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointParameterInstructions.js +0 -1
  1313. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +0 -1
  1314. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +0 -1
  1315. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +0 -1
  1316. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +0 -1
  1317. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/index.js +0 -1
  1318. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/shared.js +0 -1
  1319. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/eventStream.js +0 -1
  1320. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/checksum.js +0 -38
  1321. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +0 -7
  1322. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +0 -1
  1323. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/index.js +0 -2
  1324. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/retry.js +0 -1
  1325. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +0 -1
  1326. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/feature-ids.js +0 -1
  1327. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +0 -1
  1328. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http.js +0 -5
  1329. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +0 -1
  1330. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +0 -1
  1331. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/identity.js +0 -1
  1332. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/index.js +0 -1
  1333. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +0 -1
  1334. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/index.js +0 -7
  1335. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/logger.js +0 -1
  1336. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/metrics.js +0 -1
  1337. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/middleware.js +0 -1
  1338. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/pagination.js +0 -1
  1339. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/profile.js +0 -6
  1340. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/response.js +0 -1
  1341. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/retry.js +0 -1
  1342. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +0 -1
  1343. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema.js +0 -1
  1344. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/sentinels.js +0 -1
  1345. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/static-schemas.js +0 -1
  1346. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/traits.js +0 -1
  1347. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/serde.js +0 -1
  1348. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/shapes.js +0 -1
  1349. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/signature.js +0 -1
  1350. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/stream.js +0 -1
  1351. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +0 -1
  1352. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +0 -1
  1353. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +0 -1
  1354. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transfer.js +0 -6
  1355. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +0 -1
  1356. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +0 -1
  1357. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/exact.js +0 -1
  1358. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/mutable.js +0 -1
  1359. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/no-undefined.js +0 -1
  1360. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/type-transform.js +0 -1
  1361. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/uri.js +0 -1
  1362. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/util.js +0 -1
  1363. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/waiter.js +0 -1
  1364. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort-handler.d.ts +0 -7
  1365. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort.d.ts +0 -48
  1366. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +0 -7
  1367. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +0 -49
  1368. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +0 -20
  1369. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +0 -41
  1370. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +0 -14
  1371. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/auth.d.ts +0 -59
  1372. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/index.d.ts +0 -7
  1373. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +0 -37
  1374. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/checksum.d.ts +0 -61
  1375. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/client.d.ts +0 -57
  1376. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/command.d.ts +0 -28
  1377. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/config.d.ts +0 -15
  1378. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/index.d.ts +0 -3
  1379. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/manager.d.ts +0 -34
  1380. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/pool.d.ts +0 -32
  1381. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/crypto.d.ts +0 -58
  1382. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +0 -24
  1383. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/encode.d.ts +0 -31
  1384. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoint.d.ts +0 -77
  1385. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointParameterInstructions.d.ts +0 -41
  1386. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +0 -27
  1387. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +0 -10
  1388. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +0 -28
  1389. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +0 -16
  1390. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +0 -5
  1391. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +0 -55
  1392. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/eventStream.d.ts +0 -137
  1393. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +0 -58
  1394. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +0 -32
  1395. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +0 -9
  1396. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/index.d.ts +0 -6
  1397. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +0 -18
  1398. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +0 -35
  1399. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/feature-ids.d.ts +0 -16
  1400. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +0 -142
  1401. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http.d.ts +0 -110
  1402. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +0 -14
  1403. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +0 -31
  1404. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/identity.d.ts +0 -15
  1405. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/index.d.ts +0 -4
  1406. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +0 -14
  1407. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/index.d.ts +0 -52
  1408. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/logger.d.ts +0 -13
  1409. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/metrics.d.ts +0 -93
  1410. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/middleware.d.ts +0 -541
  1411. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/pagination.d.ts +0 -33
  1412. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/profile.d.ts +0 -30
  1413. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/response.d.ts +0 -40
  1414. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/retry.d.ts +0 -162
  1415. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +0 -143
  1416. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema.d.ts +0 -236
  1417. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +0 -65
  1418. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +0 -99
  1419. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/traits.d.ts +0 -46
  1420. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/serde.d.ts +0 -114
  1421. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/shapes.d.ts +0 -79
  1422. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/signature.d.ts +0 -172
  1423. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/stream.d.ts +0 -22
  1424. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +0 -28
  1425. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +0 -54
  1426. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +0 -41
  1427. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transfer.d.ts +0 -42
  1428. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +0 -26
  1429. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +0 -73
  1430. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/exact.d.ts +0 -6
  1431. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +0 -6
  1432. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +0 -68
  1433. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +0 -39
  1434. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +0 -7
  1435. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +0 -45
  1436. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +0 -7
  1437. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +0 -49
  1438. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +0 -20
  1439. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +0 -41
  1440. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +0 -14
  1441. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +0 -59
  1442. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +0 -7
  1443. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +0 -37
  1444. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +0 -61
  1445. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +0 -57
  1446. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +0 -28
  1447. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +0 -15
  1448. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +0 -3
  1449. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +0 -34
  1450. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +0 -32
  1451. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +0 -58
  1452. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +0 -40
  1453. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +0 -31
  1454. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +0 -77
  1455. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointParameterInstructions.d.ts +0 -41
  1456. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +0 -27
  1457. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +0 -10
  1458. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +0 -28
  1459. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +0 -16
  1460. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +0 -5
  1461. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +0 -55
  1462. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +0 -137
  1463. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +0 -58
  1464. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +0 -32
  1465. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +0 -9
  1466. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +0 -6
  1467. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +0 -18
  1468. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +0 -35
  1469. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +0 -16
  1470. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +0 -142
  1471. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +0 -110
  1472. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +0 -14
  1473. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +0 -31
  1474. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +0 -15
  1475. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +0 -4
  1476. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +0 -14
  1477. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +0 -52
  1478. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +0 -13
  1479. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +0 -93
  1480. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +0 -541
  1481. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +0 -33
  1482. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +0 -30
  1483. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +0 -40
  1484. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +0 -162
  1485. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +0 -149
  1486. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +0 -251
  1487. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +0 -65
  1488. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +0 -118
  1489. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +0 -46
  1490. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +0 -114
  1491. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +0 -79
  1492. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +0 -172
  1493. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +0 -22
  1494. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +0 -28
  1495. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +0 -54
  1496. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +0 -41
  1497. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +0 -42
  1498. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +0 -26
  1499. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +0 -77
  1500. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +0 -14
  1501. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +0 -6
  1502. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +0 -88
  1503. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +0 -40
  1504. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +0 -17
  1505. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +0 -192
  1506. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +0 -35
  1507. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/uri.d.ts +0 -17
  1508. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/util.d.ts +0 -176
  1509. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/waiter.d.ts +0 -35
  1510. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/package.json +0 -50
  1511. package/node_modules/esbuild/LICENSE.md +0 -21
  1512. package/node_modules/esbuild/README.md +0 -3
  1513. package/node_modules/esbuild/bin/esbuild +0 -223
  1514. package/node_modules/esbuild/install.js +0 -300
  1515. package/node_modules/esbuild/lib/main.d.ts +0 -720
  1516. package/node_modules/esbuild/lib/main.js +0 -2536
  1517. package/node_modules/esbuild/package.json +0 -47
  1518. package/node_modules/typebox/build/schema/intern/index.d.mts +0 -1
  1519. package/node_modules/typebox/build/schema/intern/index.mjs +0 -1
  1520. package/node_modules/typebox/build/schema/intern/intern.d.mts +0 -14
  1521. package/node_modules/typebox/build/schema/intern/intern.mjs +0 -259
  1522. package/vendor/pi-protocol/protocol.d.ts +0 -167
  1523. package/vendor/pi-protocol/protocol.d.ts.map +0 -1
  1524. package/vendor/pi-protocol/protocol.js +0 -85
  1525. package/vendor/pi-protocol/protocol.js.map +0 -1
@@ -45,8 +45,9 @@ function findJpegTiffOffset(bytes) {
45
45
  const segmentStart = offset + 4;
46
46
  if (segmentStart + 6 > bytes.length)
47
47
  return -1;
48
- if (hasExifHeader(bytes, segmentStart))
49
- return segmentStart + 6;
48
+ if (!hasExifHeader(bytes, segmentStart))
49
+ return -1;
50
+ return segmentStart + 6;
50
51
  }
51
52
  if (offset + 4 > bytes.length)
52
53
  return -1;
@@ -1 +1 @@
1
- {"version":3,"file":"exif-orientation.js","sourceRoot":"","sources":["../../src/utils/exif-orientation.ts"],"names":[],"mappings":"AAIA,SAAS,uBAAuB,CAAC,KAAiB,EAAE,SAAiB;IACpE,IAAI,SAAS,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC;IAE3C,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IACjE,MAAM,EAAE,GAAG,SAAS,KAAK,MAAM,CAAC;IAEhC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAU,EAAE;QACtC,IAAI,EAAE;YAAE,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAClD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAM,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E,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE;YACC,OAAO,KAAK,CAAC;IACf,CAAC;AACF,CAAC","sourcesContent":["import type { PhotonImageType } from \"./photon.ts\";\n\ntype Photon = typeof import(\"@silvia-odwyer/photon-node\");\n\nfunction readOrientationFromTiff(bytes: Uint8Array, tiffStart: number): number {\n\tif (tiffStart + 8 > bytes.length) return 1;\n\n\tconst byteOrder = (bytes[tiffStart] << 8) | bytes[tiffStart + 1];\n\tconst le = byteOrder === 0x4949;\n\n\tconst read16 = (pos: number): number => {\n\t\tif (le) return bytes[pos] | (bytes[pos + 1] << 8);\n\t\treturn (bytes[pos] << 8) | bytes[pos + 1];\n\t};\n\n\tconst read32 = (pos: number): number => {\n\t\tif (le) return bytes[pos] | (bytes[pos + 1] << 8) | (bytes[pos + 2] << 16) | (bytes[pos + 3] << 24);\n\t\treturn ((bytes[pos] << 24) | (bytes[pos + 1] << 16) | (bytes[pos + 2] << 8) | bytes[pos + 3]) >>> 0;\n\t};\n\n\tconst ifdOffset = read32(tiffStart + 4);\n\tconst ifdStart = tiffStart + ifdOffset;\n\tif (ifdStart + 2 > bytes.length) return 1;\n\n\tconst entryCount = read16(ifdStart);\n\tfor (let i = 0; i < entryCount; i++) {\n\t\tconst entryPos = ifdStart + 2 + i * 12;\n\t\tif (entryPos + 12 > bytes.length) return 1;\n\n\t\tif (read16(entryPos) === 0x0112) {\n\t\t\tconst value = read16(entryPos + 8);\n\t\t\treturn value >= 1 && value <= 8 ? value : 1;\n\t\t}\n\t}\n\n\treturn 1;\n}\n\nfunction findJpegTiffOffset(bytes: Uint8Array): number {\n\tlet offset = 2;\n\twhile (offset < bytes.length - 1) {\n\t\tif (bytes[offset] !== 0xff) return -1;\n\t\tconst marker = bytes[offset + 1];\n\t\tif (marker === 0xff) {\n\t\t\toffset++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (marker === 0xe1) {\n\t\t\tif (offset + 4 >= bytes.length) return -1;\n\t\t\tconst segmentStart = offset + 4;\n\t\t\tif (segmentStart + 6 > bytes.length) return -1;\n\t\t\tif (hasExifHeader(bytes, segmentStart)) return segmentStart + 6;\n\t\t}\n\n\t\tif (offset + 4 > bytes.length) return -1;\n\t\tconst length = (bytes[offset + 2] << 8) | bytes[offset + 3];\n\t\toffset += 2 + length;\n\t}\n\n\treturn -1;\n}\n\nfunction findWebpTiffOffset(bytes: Uint8Array): number {\n\tlet offset = 12;\n\twhile (offset + 8 <= bytes.length) {\n\t\tconst chunkId = String.fromCharCode(bytes[offset], bytes[offset + 1], bytes[offset + 2], bytes[offset + 3]);\n\t\tconst chunkSize =\n\t\t\tbytes[offset + 4] | (bytes[offset + 5] << 8) | (bytes[offset + 6] << 16) | (bytes[offset + 7] << 24);\n\t\tconst dataStart = offset + 8;\n\n\t\tif (chunkId === \"EXIF\") {\n\t\t\tif (dataStart + chunkSize > bytes.length) return -1;\n\t\t\t// Some WebP files have \"Exif\\0\\0\" prefix before the TIFF header\n\t\t\tconst tiffStart = chunkSize >= 6 && hasExifHeader(bytes, dataStart) ? dataStart + 6 : dataStart;\n\t\t\treturn tiffStart;\n\t\t}\n\n\t\t// RIFF chunks are padded to even size\n\t\toffset = dataStart + chunkSize + (chunkSize % 2);\n\t}\n\n\treturn -1;\n}\n\nfunction hasExifHeader(bytes: Uint8Array, offset: number): boolean {\n\treturn (\n\t\tbytes[offset] === 0x45 &&\n\t\tbytes[offset + 1] === 0x78 &&\n\t\tbytes[offset + 2] === 0x69 &&\n\t\tbytes[offset + 3] === 0x66 &&\n\t\tbytes[offset + 4] === 0x00 &&\n\t\tbytes[offset + 5] === 0x00\n\t);\n}\n\nfunction getExifOrientation(bytes: Uint8Array): number {\n\tlet tiffOffset = -1;\n\n\t// JPEG: starts with FF D8\n\tif (bytes.length >= 2 && bytes[0] === 0xff && bytes[1] === 0xd8) {\n\t\ttiffOffset = findJpegTiffOffset(bytes);\n\t}\n\t// WebP: starts with RIFF....WEBP\n\telse if (\n\t\tbytes.length >= 12 &&\n\t\tbytes[0] === 0x52 &&\n\t\tbytes[1] === 0x49 &&\n\t\tbytes[2] === 0x46 &&\n\t\tbytes[3] === 0x46 &&\n\t\tbytes[8] === 0x57 &&\n\t\tbytes[9] === 0x45 &&\n\t\tbytes[10] === 0x42 &&\n\t\tbytes[11] === 0x50\n\t) {\n\t\ttiffOffset = findWebpTiffOffset(bytes);\n\t}\n\n\tif (tiffOffset === -1) return 1;\n\treturn readOrientationFromTiff(bytes, tiffOffset);\n}\n\ntype DstIndexFn = (x: number, y: number, w: number, h: number) => number;\n\nfunction rotate90(photon: Photon, image: PhotonImageType, dstIndex: DstIndexFn): PhotonImageType {\n\tconst w = image.get_width();\n\tconst h = image.get_height();\n\tconst src = image.get_raw_pixels();\n\tconst dst = new Uint8Array(src.length);\n\n\tfor (let y = 0; y < h; y++) {\n\t\tfor (let x = 0; x < w; x++) {\n\t\t\tconst srcIdx = (y * w + x) * 4;\n\t\t\tconst dstIdx = dstIndex(x, y, w, h) * 4;\n\t\t\tdst[dstIdx] = src[srcIdx];\n\t\t\tdst[dstIdx + 1] = src[srcIdx + 1];\n\t\t\tdst[dstIdx + 2] = src[srcIdx + 2];\n\t\t\tdst[dstIdx + 3] = src[srcIdx + 3];\n\t\t}\n\t}\n\n\treturn new photon.PhotonImage(dst, h, w);\n}\n\n// Flip orientations mutate in-place. Rotations return a new image (caller must free the old one if different).\nexport function applyExifOrientation(\n\tphoton: Photon,\n\timage: PhotonImageType,\n\toriginalBytes: Uint8Array,\n): PhotonImageType {\n\tconst orientation = getExifOrientation(originalBytes);\n\tif (orientation === 1) return image;\n\n\tswitch (orientation) {\n\t\tcase 2:\n\t\t\tphoton.fliph(image);\n\t\t\treturn image;\n\t\tcase 3:\n\t\t\tphoton.fliph(image);\n\t\t\tphoton.flipv(image);\n\t\t\treturn image;\n\t\tcase 4:\n\t\t\tphoton.flipv(image);\n\t\t\treturn image;\n\t\tcase 5: {\n\t\t\tconst rotated = rotate90(photon, image, (x, y, _w, h) => x * h + (h - 1 - y));\n\t\t\tphoton.fliph(rotated);\n\t\t\treturn rotated;\n\t\t}\n\t\tcase 6:\n\t\t\treturn rotate90(photon, image, (x, y, _w, h) => x * h + (h - 1 - y));\n\t\tcase 7: {\n\t\t\tconst rotated = rotate90(photon, image, (x, y, w, h) => (w - 1 - x) * h + y);\n\t\t\tphoton.fliph(rotated);\n\t\t\treturn rotated;\n\t\t}\n\t\tcase 8:\n\t\t\treturn rotate90(photon, image, (x, y, w, h) => (w - 1 - x) * h + y);\n\t\tdefault:\n\t\t\treturn image;\n\t}\n}\n"]}
1
+ {"version":3,"file":"exif-orientation.js","sourceRoot":"","sources":["../../src/utils/exif-orientation.ts"],"names":[],"mappings":"AAIA,SAAS,uBAAuB,CAAC,KAAiB,EAAE,SAAiB;IACpE,IAAI,SAAS,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC;IAE3C,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IACjE,MAAM,EAAE,GAAG,SAAS,KAAK,MAAM,CAAC;IAEhC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAU,EAAE;QACtC,IAAI,EAAE;YAAE,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAClD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,GAAW,EAAU,EAAE;QACtC,IAAI,EAAE;YAAE,OAAO,KAAK,CA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EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE;YACC,OAAO,KAAK,CAAC;IACf,CAAC;AACF,CAAC","sourcesContent":["import type { PhotonImageType } from \"./photon.ts\";\n\ntype Photon = typeof import(\"@silvia-odwyer/photon-node\");\n\nfunction readOrientationFromTiff(bytes: Uint8Array, tiffStart: number): number {\n\tif (tiffStart + 8 > bytes.length) return 1;\n\n\tconst byteOrder = (bytes[tiffStart] << 8) | bytes[tiffStart + 1];\n\tconst le = byteOrder === 0x4949;\n\n\tconst read16 = (pos: number): number => {\n\t\tif (le) return bytes[pos] | (bytes[pos + 1] << 8);\n\t\treturn (bytes[pos] << 8) | bytes[pos + 1];\n\t};\n\n\tconst read32 = (pos: number): number => {\n\t\tif (le) return bytes[pos] | (bytes[pos + 1] << 8) | (bytes[pos + 2] << 16) | (bytes[pos + 3] << 24);\n\t\treturn ((bytes[pos] << 24) | (bytes[pos + 1] << 16) | (bytes[pos + 2] << 8) | bytes[pos + 3]) >>> 0;\n\t};\n\n\tconst ifdOffset = read32(tiffStart + 4);\n\tconst ifdStart = tiffStart + ifdOffset;\n\tif (ifdStart + 2 > bytes.length) return 1;\n\n\tconst entryCount = read16(ifdStart);\n\tfor (let i = 0; i < entryCount; i++) {\n\t\tconst entryPos = ifdStart + 2 + i * 12;\n\t\tif (entryPos + 12 > bytes.length) return 1;\n\n\t\tif (read16(entryPos) === 0x0112) {\n\t\t\tconst value = read16(entryPos + 8);\n\t\t\treturn value >= 1 && value <= 8 ? value : 1;\n\t\t}\n\t}\n\n\treturn 1;\n}\n\nfunction findJpegTiffOffset(bytes: Uint8Array): number {\n\tlet offset = 2;\n\twhile (offset < bytes.length - 1) {\n\t\tif (bytes[offset] !== 0xff) return -1;\n\t\tconst marker = bytes[offset + 1];\n\t\tif (marker === 0xff) {\n\t\t\toffset++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (marker === 0xe1) {\n\t\t\tif (offset + 4 >= bytes.length) return -1;\n\t\t\tconst segmentStart = offset + 4;\n\t\t\tif (segmentStart + 6 > bytes.length) return -1;\n\t\t\tif (!hasExifHeader(bytes, segmentStart)) return -1;\n\t\t\treturn segmentStart + 6;\n\t\t}\n\n\t\tif (offset + 4 > bytes.length) return -1;\n\t\tconst length = (bytes[offset + 2] << 8) | bytes[offset + 3];\n\t\toffset += 2 + length;\n\t}\n\n\treturn -1;\n}\n\nfunction findWebpTiffOffset(bytes: Uint8Array): number {\n\tlet offset = 12;\n\twhile (offset + 8 <= bytes.length) {\n\t\tconst chunkId = String.fromCharCode(bytes[offset], bytes[offset + 1], bytes[offset + 2], bytes[offset + 3]);\n\t\tconst chunkSize =\n\t\t\tbytes[offset + 4] | (bytes[offset + 5] << 8) | (bytes[offset + 6] << 16) | (bytes[offset + 7] << 24);\n\t\tconst dataStart = offset + 8;\n\n\t\tif (chunkId === \"EXIF\") {\n\t\t\tif (dataStart + chunkSize > bytes.length) return -1;\n\t\t\t// Some WebP files have \"Exif\\0\\0\" prefix before the TIFF header\n\t\t\tconst tiffStart = chunkSize >= 6 && hasExifHeader(bytes, dataStart) ? dataStart + 6 : dataStart;\n\t\t\treturn tiffStart;\n\t\t}\n\n\t\t// RIFF chunks are padded to even size\n\t\toffset = dataStart + chunkSize + (chunkSize % 2);\n\t}\n\n\treturn -1;\n}\n\nfunction hasExifHeader(bytes: Uint8Array, offset: number): boolean {\n\treturn (\n\t\tbytes[offset] === 0x45 &&\n\t\tbytes[offset + 1] === 0x78 &&\n\t\tbytes[offset + 2] === 0x69 &&\n\t\tbytes[offset + 3] === 0x66 &&\n\t\tbytes[offset + 4] === 0x00 &&\n\t\tbytes[offset + 5] === 0x00\n\t);\n}\n\nfunction getExifOrientation(bytes: Uint8Array): number {\n\tlet tiffOffset = -1;\n\n\t// JPEG: starts with FF D8\n\tif (bytes.length >= 2 && bytes[0] === 0xff && bytes[1] === 0xd8) {\n\t\ttiffOffset = findJpegTiffOffset(bytes);\n\t}\n\t// WebP: starts with RIFF....WEBP\n\telse if (\n\t\tbytes.length >= 12 &&\n\t\tbytes[0] === 0x52 &&\n\t\tbytes[1] === 0x49 &&\n\t\tbytes[2] === 0x46 &&\n\t\tbytes[3] === 0x46 &&\n\t\tbytes[8] === 0x57 &&\n\t\tbytes[9] === 0x45 &&\n\t\tbytes[10] === 0x42 &&\n\t\tbytes[11] === 0x50\n\t) {\n\t\ttiffOffset = findWebpTiffOffset(bytes);\n\t}\n\n\tif (tiffOffset === -1) return 1;\n\treturn readOrientationFromTiff(bytes, tiffOffset);\n}\n\ntype DstIndexFn = (x: number, y: number, w: number, h: number) => number;\n\nfunction rotate90(photon: Photon, image: PhotonImageType, dstIndex: DstIndexFn): PhotonImageType {\n\tconst w = image.get_width();\n\tconst h = image.get_height();\n\tconst src = image.get_raw_pixels();\n\tconst dst = new Uint8Array(src.length);\n\n\tfor (let y = 0; y < h; y++) {\n\t\tfor (let x = 0; x < w; x++) {\n\t\t\tconst srcIdx = (y * w + x) * 4;\n\t\t\tconst dstIdx = dstIndex(x, y, w, h) * 4;\n\t\t\tdst[dstIdx] = src[srcIdx];\n\t\t\tdst[dstIdx + 1] = src[srcIdx + 1];\n\t\t\tdst[dstIdx + 2] = src[srcIdx + 2];\n\t\t\tdst[dstIdx + 3] = src[srcIdx + 3];\n\t\t}\n\t}\n\n\treturn new photon.PhotonImage(dst, h, w);\n}\n\n// Flip orientations mutate in-place. Rotations return a new image (caller must free the old one if different).\nexport function applyExifOrientation(\n\tphoton: Photon,\n\timage: PhotonImageType,\n\toriginalBytes: Uint8Array,\n): PhotonImageType {\n\tconst orientation = getExifOrientation(originalBytes);\n\tif (orientation === 1) return image;\n\n\tswitch (orientation) {\n\t\tcase 2:\n\t\t\tphoton.fliph(image);\n\t\t\treturn image;\n\t\tcase 3:\n\t\t\tphoton.fliph(image);\n\t\t\tphoton.flipv(image);\n\t\t\treturn image;\n\t\tcase 4:\n\t\t\tphoton.flipv(image);\n\t\t\treturn image;\n\t\tcase 5: {\n\t\t\tconst rotated = rotate90(photon, image, (x, y, _w, h) => x * h + (h - 1 - y));\n\t\t\tphoton.fliph(rotated);\n\t\t\treturn rotated;\n\t\t}\n\t\tcase 6:\n\t\t\treturn rotate90(photon, image, (x, y, _w, h) => x * h + (h - 1 - y));\n\t\tcase 7: {\n\t\t\tconst rotated = rotate90(photon, image, (x, y, w, h) => (w - 1 - x) * h + y);\n\t\t\tphoton.fliph(rotated);\n\t\t\treturn rotated;\n\t\t}\n\t\tcase 8:\n\t\t\treturn rotate90(photon, image, (x, y, w, h) => (w - 1 - x) * h + y);\n\t\tdefault:\n\t\t\treturn image;\n\t}\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  export declare function getToolPath(tool: "fd" | "rg"): string | null;
2
- export declare function getLatestVersion(repo: string): Promise<string>;
3
2
  export interface ToolStatus {
4
3
  type: "info" | "warning";
5
4
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tools-manager.d.ts","sourceRoot":"","sources":["../../src/utils/tools-manager.ts"],"names":[],"mappings":"AAoFA,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAmB5D;AAQD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BpE;AAyMD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAC/B,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GACrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgD7B"}
1
+ {"version":3,"file":"tools-manager.d.ts","sourceRoot":"","sources":["../../src/utils/tools-manager.ts"],"names":[],"mappings":"AAsFA,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAmB5D;AA6ND,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAC/B,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GACrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAoC7B"}
@@ -30,7 +30,7 @@ const TOOLS = {
30
30
  }
31
31
  else if (plat === "linux") {
32
32
  const archStr = architecture === "arm64" ? "aarch64" : "x86_64";
33
- return `fd-v${version}-${archStr}-unknown-linux-musl.tar.gz`;
33
+ return `fd-v${version}-${archStr}-unknown-linux-gnu.tar.gz`;
34
34
  }
35
35
  else if (plat === "win32") {
36
36
  const archStr = architecture === "arm64" ? "aarch64" : "x86_64";
@@ -50,8 +50,10 @@ const TOOLS = {
50
50
  return `ripgrep-${version}-${archStr}-apple-darwin.tar.gz`;
51
51
  }
52
52
  else if (plat === "linux") {
53
- const archStr = architecture === "arm64" ? "aarch64" : "x86_64";
54
- return `ripgrep-${version}-${archStr}-unknown-linux-musl.tar.gz`;
53
+ if (architecture === "arm64") {
54
+ return `ripgrep-${version}-aarch64-unknown-linux-gnu.tar.gz`;
55
+ }
56
+ return `ripgrep-${version}-x86_64-unknown-linux-musl.tar.gz`;
55
57
  }
56
58
  else if (plat === "win32") {
57
59
  const archStr = architecture === "arm64" ? "aarch64" : "x86_64";
@@ -91,40 +93,22 @@ export function getToolPath(tool) {
91
93
  }
92
94
  return null;
93
95
  }
94
- // Resolve the latest release version from the release page redirect.
95
- // The api.github.com releases endpoint counts against the anonymous API
96
- // quota (60 requests/hour per IP), which is permanently exhausted behind
97
- // shared egress IPs such as corporate proxies and CI runners. The web
98
- // endpoint answers with a redirect to the tagged release at no quota cost
99
- // and lives on the same origin as the binary download itself.
100
- export async function getLatestVersion(repo) {
101
- const response = await fetchWithRetry(`https://github.com/${repo}/releases/latest`, {
96
+ // Fetch latest release version from GitHub
97
+ async function getLatestVersion(repo) {
98
+ const response = await fetchWithRetry(`https://api.github.com/repos/${repo}/releases/latest`, {
102
99
  headers: { "User-Agent": `${APP_NAME}-coding-agent` },
103
- redirect: "manual",
104
100
  }, { timeoutMs: NETWORK_TIMEOUT_MS });
105
- // Only the status and headers matter here. Discard the body so the
106
- // connection can be reused.
107
- try {
108
- await response.body?.cancel();
109
- }
110
- catch {
111
- // Discarding the body is best-effort.
112
- }
113
- const location = response.status >= 300 && response.status < 400 ? response.headers.get("location") : null;
114
- if (!location) {
115
- throw new Error(`Failed to resolve latest ${repo} release: HTTP ${response.status} without redirect`);
116
- }
117
- const tag = new URL(location, "https://github.com").pathname.split("/").pop();
118
- if (!tag || !location.includes("/releases/tag/")) {
119
- throw new Error(`Failed to resolve latest ${repo} release: unexpected redirect to ${location}`);
101
+ if (!response.ok) {
102
+ throw new Error(`GitHub API error: ${response.status}`);
120
103
  }
121
- return decodeURIComponent(tag).replace(/^v/, "");
104
+ const data = (await response.json());
105
+ return data.tag_name.replace(/^v/, "");
122
106
  }
123
107
  // Download a file from URL
124
108
  async function downloadFile(url, dest) {
125
109
  const response = await fetchWithRetry(url, undefined, { timeoutMs: DOWNLOAD_TIMEOUT_MS });
126
110
  if (!response.ok) {
127
- throw new Error(`Download failed with HTTP ${response.status}: ${url}`);
111
+ throw new Error(`Failed to download: ${response.status}`);
128
112
  }
129
113
  if (!response.body) {
130
114
  throw new Error("No response body");
@@ -232,8 +216,11 @@ async function downloadTool(tool) {
232
216
  throw new Error(`Unknown tool: ${tool}`);
233
217
  const plat = platform();
234
218
  const architecture = arch();
235
- // fd is pinned on darwin/x64, so skip the version lookup there.
236
- const version = tool === "fd" && plat === "darwin" && architecture === "x64" ? "10.3.0" : await getLatestVersion(config.repo);
219
+ // Get latest version
220
+ let version = await getLatestVersion(config.repo);
221
+ if (tool === "fd" && plat === "darwin" && architecture === "x64") {
222
+ version = "10.3.0";
223
+ }
237
224
  // Get asset name for this platform
238
225
  const assetName = config.getAssetName(version, plat, architecture);
239
226
  if (!assetName) {
@@ -325,18 +312,9 @@ export async function ensureTool(tool, onStatus) {
325
312
  return path;
326
313
  }
327
314
  catch (e) {
328
- // Include the error cause chain: fetch failures surface as a bare
329
- // "fetch failed" TypeError with the actionable detail (DNS, TLS,
330
- // timeout) hidden in the cause. Depth-capped to guard against
331
- // circular cause chains.
332
- const messages = [];
333
- for (let current = e, depth = 0; current instanceof Error && depth < 5; current = current.cause, depth++) {
334
- if (!messages.includes(current.message))
335
- messages.push(current.message);
336
- }
337
315
  onStatus?.({
338
316
  type: "warning",
339
- message: `Failed to download ${config.name}: ${messages.length > 0 ? messages.join(": ") : String(e)}`,
317
+ message: `Failed to download ${config.name}: ${e instanceof Error ? e.message : e}`,
340
318
  });
341
319
  return undefined;
342
320
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tools-manager.js","sourceRoot":"","sources":["../../src/utils/tools-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,SAAS,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EA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AAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;SACtG,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC","sourcesContent":["import type { ReadableStream as NodeReadableStream } from \"node:stream/web\";\nimport { type SpawnSyncReturns, spawnSync } from \"child_process\";\nimport { chmodSync, createWriteStream, existsSync, mkdirSync, readdirSync, renameSync, rmSync } from \"fs\";\nimport { arch, platform } from \"os\";\nimport { join } from \"path\";\nimport { Readable } from \"stream\";\nimport { pipeline } from \"stream/promises\";\nimport { APP_NAME, getBinDir } from \"../config.ts\";\nimport { envValue } from \"../core/brand.ts\";\nimport { fetchWithRetry } from \"./management-http.ts\";\n\nconst TOOLS_DIR = getBinDir();\nconst NETWORK_TIMEOUT_MS = 10_000;\nconst DOWNLOAD_TIMEOUT_MS = 120_000;\n\nfunction isOfflineModeEnabled(): boolean {\n\tconst value = envValue(\"OFFLINE\");\n\tif (!value) return false;\n\treturn value === \"1\" || value.toLowerCase() === \"true\" || value.toLowerCase() === \"yes\";\n}\n\ninterface ToolConfig {\n\tname: string;\n\trepo: string; // GitHub repo (e.g., \"sharkdp/fd\")\n\tbinaryName: string; // Name of the binary inside the archive\n\tsystemBinaryNames?: string[]; // Alternative system command names to try before downloading\n\ttagPrefix: string; // Prefix for tags (e.g., \"v\" for v1.0.0, \"\" for 1.0.0)\n\tgetAssetName: (version: string, plat: string, architecture: string) => string | null;\n}\n\nconst TOOLS: Record<string, ToolConfig> = {\n\tfd: {\n\t\tname: \"fd\",\n\t\trepo: \"sharkdp/fd\",\n\t\tbinaryName: \"fd\",\n\t\tsystemBinaryNames: [\"fd\", \"fdfind\"],\n\t\ttagPrefix: \"v\",\n\t\tgetAssetName: (version, plat, architecture) => {\n\t\t\tif (plat === \"darwin\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `fd-v${version}-${archStr}-apple-darwin.tar.gz`;\n\t\t\t} else if (plat === \"linux\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `fd-v${version}-${archStr}-unknown-linux-musl.tar.gz`;\n\t\t\t} else if (plat === \"win32\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `fd-v${version}-${archStr}-pc-windows-msvc.zip`;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t},\n\trg: {\n\t\tname: \"ripgrep\",\n\t\trepo: \"BurntSushi/ripgrep\",\n\t\tbinaryName: \"rg\",\n\t\ttagPrefix: \"\",\n\t\tgetAssetName: (version, plat, architecture) => {\n\t\t\tif (plat === \"darwin\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `ripgrep-${version}-${archStr}-apple-darwin.tar.gz`;\n\t\t\t} else if (plat === \"linux\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `ripgrep-${version}-${archStr}-unknown-linux-musl.tar.gz`;\n\t\t\t} else if (plat === \"win32\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `ripgrep-${version}-${archStr}-pc-windows-msvc.zip`;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t},\n};\n\n// Check if a command exists in PATH by trying to run it\nfunction commandExists(cmd: string): boolean {\n\ttry {\n\t\tconst result = spawnSync(cmd, [\"--version\"], { stdio: \"pipe\" });\n\t\t// Check for ENOENT error (command not found)\n\t\treturn result.error === undefined || result.error === null;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n// Get the path to a tool (system-wide or in our tools dir)\nexport function getToolPath(tool: \"fd\" | \"rg\"): string | null {\n\tconst config = TOOLS[tool];\n\tif (!config) return null;\n\n\t// Check our tools directory first\n\tconst localPath = join(TOOLS_DIR, config.binaryName + (platform() === \"win32\" ? \".exe\" : \"\"));\n\tif (existsSync(localPath)) {\n\t\treturn localPath;\n\t}\n\n\t// Check system PATH - if found, just return the command name (it's in PATH)\n\tconst systemBinaryNames = config.systemBinaryNames ?? [config.binaryName];\n\tfor (const systemBinaryName of systemBinaryNames) {\n\t\tif (commandExists(systemBinaryName)) {\n\t\t\treturn systemBinaryName;\n\t\t}\n\t}\n\n\treturn null;\n}\n\n// Resolve the latest release version from the release page redirect.\n// The api.github.com releases endpoint counts against the anonymous API\n// quota (60 requests/hour per IP), which is permanently exhausted behind\n// shared egress IPs such as corporate proxies and CI runners. The web\n// endpoint answers with a redirect to the tagged release at no quota cost\n// and lives on the same origin as the binary download itself.\nexport async function getLatestVersion(repo: string): Promise<string> {\n\tconst response = await fetchWithRetry(\n\t\t`https://github.com/${repo}/releases/latest`,\n\t\t{\n\t\t\theaders: { \"User-Agent\": `${APP_NAME}-coding-agent` },\n\t\t\tredirect: \"manual\",\n\t\t},\n\t\t{ timeoutMs: NETWORK_TIMEOUT_MS },\n\t);\n\n\t// Only the status and headers matter here. Discard the body so the\n\t// connection can be reused.\n\ttry {\n\t\tawait response.body?.cancel();\n\t} catch {\n\t\t// Discarding the body is best-effort.\n\t}\n\n\tconst location = response.status >= 300 && response.status < 400 ? response.headers.get(\"location\") : null;\n\tif (!location) {\n\t\tthrow new Error(`Failed to resolve latest ${repo} release: HTTP ${response.status} without redirect`);\n\t}\n\n\tconst tag = new URL(location, \"https://github.com\").pathname.split(\"/\").pop();\n\tif (!tag || !location.includes(\"/releases/tag/\")) {\n\t\tthrow new Error(`Failed to resolve latest ${repo} release: unexpected redirect to ${location}`);\n\t}\n\treturn decodeURIComponent(tag).replace(/^v/, \"\");\n}\n\n// Download a file from URL\nasync function downloadFile(url: string, dest: string): Promise<void> {\n\tconst response = await fetchWithRetry(url, undefined, { timeoutMs: DOWNLOAD_TIMEOUT_MS });\n\n\tif (!response.ok) {\n\t\tthrow new Error(`Download failed with HTTP ${response.status}: ${url}`);\n\t}\n\n\tif (!response.body) {\n\t\tthrow new Error(\"No response body\");\n\t}\n\n\tconst fileStream = createWriteStream(dest);\n\tawait pipeline(Readable.fromWeb(response.body as NodeReadableStream<Uint8Array>), fileStream);\n}\n\nfunction findBinaryRecursively(rootDir: string, binaryFileName: string): string | null {\n\tconst stack: string[] = [rootDir];\n\n\twhile (stack.length > 0) {\n\t\tconst currentDir = stack.pop();\n\t\tif (!currentDir) continue;\n\n\t\tconst entries = readdirSync(currentDir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tconst fullPath = join(currentDir, entry.name);\n\t\t\tif (entry.isFile() && entry.name === binaryFileName) {\n\t\t\t\treturn fullPath;\n\t\t\t}\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tstack.push(fullPath);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction formatSpawnFailure(result: SpawnSyncReturns<Buffer>): string {\n\tif (result.error?.message) {\n\t\treturn result.error.message;\n\t}\n\tconst stderr = result.stderr?.toString().trim();\n\tif (stderr) {\n\t\treturn stderr;\n\t}\n\tconst stdout = result.stdout?.toString().trim();\n\tif (stdout) {\n\t\treturn stdout;\n\t}\n\treturn `exit status ${result.status ?? \"unknown\"}`;\n}\n\nfunction runExtractionCommand(command: string, args: string[]): string | null {\n\tconst result = spawnSync(command, args, { stdio: \"pipe\" });\n\tif (!result.error && result.status === 0) {\n\t\treturn null;\n\t}\n\treturn `${command}: ${formatSpawnFailure(result)}`;\n}\n\nfunction extractTarGzArchive(archivePath: string, extractDir: string, assetName: string): void {\n\tconst failure = runExtractionCommand(\"tar\", [\"xzf\", archivePath, \"-C\", extractDir]);\n\tif (failure) {\n\t\tthrow new Error(`Failed to extract ${assetName}: ${failure}`);\n\t}\n}\n\nfunction getWindowsTarCommand(): string {\n\tconst systemRoot = process.env.SystemRoot ?? process.env.WINDIR;\n\tif (systemRoot) {\n\t\tconst systemTar = join(systemRoot, \"System32\", \"tar.exe\");\n\t\tif (existsSync(systemTar)) {\n\t\t\treturn systemTar;\n\t\t}\n\t}\n\treturn \"tar.exe\";\n}\n\nfunction extractZipArchive(archivePath: string, extractDir: string, assetName: string): void {\n\tconst failures: string[] = [];\n\n\tif (platform() === \"win32\") {\n\t\t// Windows ships bsdtar as tar.exe, which supports zip files. Prefer the\n\t\t// System32 binary over Git Bash's GNU tar, which does not handle zip archives.\n\t\tconst tarFailure = runExtractionCommand(getWindowsTarCommand(), [\"xf\", archivePath, \"-C\", extractDir]);\n\t\tif (!tarFailure) return;\n\t\tfailures.push(tarFailure);\n\n\t\tconst script =\n\t\t\t\"& { param($archive, $destination) $ErrorActionPreference = 'Stop'; Expand-Archive -LiteralPath $archive -DestinationPath $destination -Force }\";\n\t\tconst powershellFailure = runExtractionCommand(\"powershell.exe\", [\n\t\t\t\"-NoLogo\",\n\t\t\t\"-NoProfile\",\n\t\t\t\"-NonInteractive\",\n\t\t\t\"-ExecutionPolicy\",\n\t\t\t\"Bypass\",\n\t\t\t\"-Command\",\n\t\t\tscript,\n\t\t\tarchivePath,\n\t\t\textractDir,\n\t\t]);\n\t\tif (!powershellFailure) return;\n\t\tfailures.push(powershellFailure);\n\t} else {\n\t\tconst unzipFailure = runExtractionCommand(\"unzip\", [\"-q\", archivePath, \"-d\", extractDir]);\n\t\tif (!unzipFailure) return;\n\t\tfailures.push(unzipFailure);\n\n\t\tconst tarFailure = runExtractionCommand(\"tar\", [\"xf\", archivePath, \"-C\", extractDir]);\n\t\tif (!tarFailure) return;\n\t\tfailures.push(tarFailure);\n\t}\n\n\tthrow new Error(`Failed to extract ${assetName}: ${failures.join(\"; \")}`);\n}\n\n// Download and install a tool\nasync function downloadTool(tool: \"fd\" | \"rg\"): Promise<string> {\n\tconst config = TOOLS[tool];\n\tif (!config) throw new Error(`Unknown tool: ${tool}`);\n\n\tconst plat = platform();\n\tconst architecture = arch();\n\n\t// fd is pinned on darwin/x64, so skip the version lookup there.\n\tconst version =\n\t\ttool === \"fd\" && plat === \"darwin\" && architecture === \"x64\" ? \"10.3.0\" : await getLatestVersion(config.repo);\n\n\t// Get asset name for this platform\n\tconst assetName = config.getAssetName(version, plat, architecture);\n\tif (!assetName) {\n\t\tthrow new Error(`Unsupported platform: ${plat}/${architecture}`);\n\t}\n\n\t// Create tools directory\n\tmkdirSync(TOOLS_DIR, { recursive: true });\n\n\tconst downloadUrl = `https://github.com/${config.repo}/releases/download/${config.tagPrefix}${version}/${assetName}`;\n\tconst archivePath = join(TOOLS_DIR, assetName);\n\tconst binaryExt = plat === \"win32\" ? \".exe\" : \"\";\n\tconst binaryPath = join(TOOLS_DIR, config.binaryName + binaryExt);\n\n\t// Download\n\tawait downloadFile(downloadUrl, archivePath);\n\n\t// Extract into a unique temp directory. fd and rg downloads can run concurrently\n\t// during startup, so sharing a fixed directory causes races.\n\tconst extractDir = join(\n\t\tTOOLS_DIR,\n\t\t`extract_tmp_${config.binaryName}_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`,\n\t);\n\tmkdirSync(extractDir, { recursive: true });\n\n\ttry {\n\t\tif (assetName.endsWith(\".tar.gz\")) {\n\t\t\textractTarGzArchive(archivePath, extractDir, assetName);\n\t\t} else if (assetName.endsWith(\".zip\")) {\n\t\t\textractZipArchive(archivePath, extractDir, assetName);\n\t\t} else {\n\t\t\tthrow new Error(`Unsupported archive format: ${assetName}`);\n\t\t}\n\n\t\t// Find the binary in extracted files. Some archives contain files directly\n\t\t// at root, others nest under a versioned subdirectory.\n\t\tconst binaryFileName = config.binaryName + binaryExt;\n\t\tconst extractedDir = join(extractDir, assetName.replace(/\\.(tar\\.gz|zip)$/, \"\"));\n\t\tconst extractedBinaryCandidates = [join(extractedDir, binaryFileName), join(extractDir, binaryFileName)];\n\t\tlet extractedBinary = extractedBinaryCandidates.find((candidate) => existsSync(candidate));\n\n\t\tif (!extractedBinary) {\n\t\t\textractedBinary = findBinaryRecursively(extractDir, binaryFileName) ?? undefined;\n\t\t}\n\n\t\tif (extractedBinary) {\n\t\t\trenameSync(extractedBinary, binaryPath);\n\t\t} else {\n\t\t\tthrow new Error(`Binary not found in archive: expected ${binaryFileName} under ${extractDir}`);\n\t\t}\n\n\t\t// Make executable (Unix only)\n\t\tif (plat !== \"win32\") {\n\t\t\tchmodSync(binaryPath, 0o755);\n\t\t}\n\t} finally {\n\t\t// Cleanup\n\t\trmSync(archivePath, { force: true });\n\t\trmSync(extractDir, { recursive: true, force: true });\n\t}\n\n\treturn binaryPath;\n}\n\n// Termux package names for tools\nconst TERMUX_PACKAGES: Record<string, string> = {\n\tfd: \"fd\",\n\trg: \"ripgrep\",\n};\n\nexport interface ToolStatus {\n\ttype: \"info\" | \"warning\";\n\tmessage: string;\n}\n\n/**\n * Ensure a tool is available, downloading if necessary.\n * Reports progress through `onStatus`; status messages are otherwise silent.\n * Returns the tool path, or undefined if unavailable.\n */\nexport async function ensureTool(\n\ttool: \"fd\" | \"rg\",\n\tonStatus?: (status: ToolStatus) => void,\n): Promise<string | undefined> {\n\tconst existingPath = getToolPath(tool);\n\tif (existingPath) {\n\t\treturn existingPath;\n\t}\n\n\tconst config = TOOLS[tool];\n\tif (!config) return undefined;\n\n\tif (isOfflineModeEnabled()) {\n\t\tonStatus?.({ type: \"warning\", message: `${config.name} not found. Offline mode enabled, skipping download.` });\n\t\treturn undefined;\n\t}\n\n\t// On Android/Termux, Linux binaries don't work due to Bionic libc incompatibility.\n\t// Users must install via pkg.\n\tif (platform() === \"android\") {\n\t\tconst pkgName = TERMUX_PACKAGES[tool] ?? tool;\n\t\tonStatus?.({ type: \"warning\", message: `${config.name} not found. Install with: pkg install ${pkgName}` });\n\t\treturn undefined;\n\t}\n\n\t// Tool not found - download it\n\tonStatus?.({ type: \"info\", message: `${config.name} not found. Downloading...` });\n\n\ttry {\n\t\tconst path = await downloadTool(tool);\n\t\tonStatus?.({ type: \"info\", message: `${config.name} installed to ${path}` });\n\t\treturn path;\n\t} catch (e) {\n\t\t// Include the error cause chain: fetch failures surface as a bare\n\t\t// \"fetch failed\" TypeError with the actionable detail (DNS, TLS,\n\t\t// timeout) hidden in the cause. Depth-capped to guard against\n\t\t// circular cause chains.\n\t\tconst messages: string[] = [];\n\t\tfor (\n\t\t\tlet current: unknown = e, depth = 0;\n\t\t\tcurrent instanceof Error && depth < 5;\n\t\t\tcurrent = current.cause, depth++\n\t\t) {\n\t\t\tif (!messages.includes(current.message)) messages.push(current.message);\n\t\t}\n\t\tonStatus?.({\n\t\t\ttype: \"warning\",\n\t\t\tmessage: `Failed to download ${config.name}: ${messages.length > 0 ? messages.join(\": \") : String(e)}`,\n\t\t});\n\t\treturn undefined;\n\t}\n}\n"]}
1
+ {"version":3,"file":"tools-manager.js","sourceRoot":"","sources":["../../src/utils/tools-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,SAAS,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAC9B,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,SAAS,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AC,CAAC,CAAC,EAAE;SACnF,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC","sourcesContent":["import type { ReadableStream as NodeReadableStream } from \"node:stream/web\";\nimport { type SpawnSyncReturns, spawnSync } from \"child_process\";\nimport { chmodSync, createWriteStream, existsSync, mkdirSync, readdirSync, renameSync, rmSync } from \"fs\";\nimport { arch, platform } from \"os\";\nimport { join } from \"path\";\nimport { Readable } from \"stream\";\nimport { pipeline } from \"stream/promises\";\nimport { APP_NAME, getBinDir } from \"../config.ts\";\nimport { envValue } from \"../core/brand.ts\";\nimport { fetchWithRetry } from \"./management-http.ts\";\n\nconst TOOLS_DIR = getBinDir();\nconst NETWORK_TIMEOUT_MS = 10_000;\nconst DOWNLOAD_TIMEOUT_MS = 120_000;\n\nfunction isOfflineModeEnabled(): boolean {\n\tconst value = envValue(\"OFFLINE\");\n\tif (!value) return false;\n\treturn value === \"1\" || value.toLowerCase() === \"true\" || value.toLowerCase() === \"yes\";\n}\n\ninterface ToolConfig {\n\tname: string;\n\trepo: string; // GitHub repo (e.g., \"sharkdp/fd\")\n\tbinaryName: string; // Name of the binary inside the archive\n\tsystemBinaryNames?: string[]; // Alternative system command names to try before downloading\n\ttagPrefix: string; // Prefix for tags (e.g., \"v\" for v1.0.0, \"\" for 1.0.0)\n\tgetAssetName: (version: string, plat: string, architecture: string) => string | null;\n}\n\nconst TOOLS: Record<string, ToolConfig> = {\n\tfd: {\n\t\tname: \"fd\",\n\t\trepo: \"sharkdp/fd\",\n\t\tbinaryName: \"fd\",\n\t\tsystemBinaryNames: [\"fd\", \"fdfind\"],\n\t\ttagPrefix: \"v\",\n\t\tgetAssetName: (version, plat, architecture) => {\n\t\t\tif (plat === \"darwin\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `fd-v${version}-${archStr}-apple-darwin.tar.gz`;\n\t\t\t} else if (plat === \"linux\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `fd-v${version}-${archStr}-unknown-linux-gnu.tar.gz`;\n\t\t\t} else if (plat === \"win32\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `fd-v${version}-${archStr}-pc-windows-msvc.zip`;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t},\n\trg: {\n\t\tname: \"ripgrep\",\n\t\trepo: \"BurntSushi/ripgrep\",\n\t\tbinaryName: \"rg\",\n\t\ttagPrefix: \"\",\n\t\tgetAssetName: (version, plat, architecture) => {\n\t\t\tif (plat === \"darwin\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `ripgrep-${version}-${archStr}-apple-darwin.tar.gz`;\n\t\t\t} else if (plat === \"linux\") {\n\t\t\t\tif (architecture === \"arm64\") {\n\t\t\t\t\treturn `ripgrep-${version}-aarch64-unknown-linux-gnu.tar.gz`;\n\t\t\t\t}\n\t\t\t\treturn `ripgrep-${version}-x86_64-unknown-linux-musl.tar.gz`;\n\t\t\t} else if (plat === \"win32\") {\n\t\t\t\tconst archStr = architecture === \"arm64\" ? \"aarch64\" : \"x86_64\";\n\t\t\t\treturn `ripgrep-${version}-${archStr}-pc-windows-msvc.zip`;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t},\n};\n\n// Check if a command exists in PATH by trying to run it\nfunction commandExists(cmd: string): boolean {\n\ttry {\n\t\tconst result = spawnSync(cmd, [\"--version\"], { stdio: \"pipe\" });\n\t\t// Check for ENOENT error (command not found)\n\t\treturn result.error === undefined || result.error === null;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n// Get the path to a tool (system-wide or in our tools dir)\nexport function getToolPath(tool: \"fd\" | \"rg\"): string | null {\n\tconst config = TOOLS[tool];\n\tif (!config) return null;\n\n\t// Check our tools directory first\n\tconst localPath = join(TOOLS_DIR, config.binaryName + (platform() === \"win32\" ? \".exe\" : \"\"));\n\tif (existsSync(localPath)) {\n\t\treturn localPath;\n\t}\n\n\t// Check system PATH - if found, just return the command name (it's in PATH)\n\tconst systemBinaryNames = config.systemBinaryNames ?? [config.binaryName];\n\tfor (const systemBinaryName of systemBinaryNames) {\n\t\tif (commandExists(systemBinaryName)) {\n\t\t\treturn systemBinaryName;\n\t\t}\n\t}\n\n\treturn null;\n}\n\n// Fetch latest release version from GitHub\nasync function getLatestVersion(repo: string): Promise<string> {\n\tconst response = await fetchWithRetry(\n\t\t`https://api.github.com/repos/${repo}/releases/latest`,\n\t\t{\n\t\t\theaders: { \"User-Agent\": `${APP_NAME}-coding-agent` },\n\t\t},\n\t\t{ timeoutMs: NETWORK_TIMEOUT_MS },\n\t);\n\n\tif (!response.ok) {\n\t\tthrow new Error(`GitHub API error: ${response.status}`);\n\t}\n\n\tconst data = (await response.json()) as { tag_name: string };\n\treturn data.tag_name.replace(/^v/, \"\");\n}\n\n// Download a file from URL\nasync function downloadFile(url: string, dest: string): Promise<void> {\n\tconst response = await fetchWithRetry(url, undefined, { timeoutMs: DOWNLOAD_TIMEOUT_MS });\n\n\tif (!response.ok) {\n\t\tthrow new Error(`Failed to download: ${response.status}`);\n\t}\n\n\tif (!response.body) {\n\t\tthrow new Error(\"No response body\");\n\t}\n\n\tconst fileStream = createWriteStream(dest);\n\tawait pipeline(Readable.fromWeb(response.body as NodeReadableStream<Uint8Array>), fileStream);\n}\n\nfunction findBinaryRecursively(rootDir: string, binaryFileName: string): string | null {\n\tconst stack: string[] = [rootDir];\n\n\twhile (stack.length > 0) {\n\t\tconst currentDir = stack.pop();\n\t\tif (!currentDir) continue;\n\n\t\tconst entries = readdirSync(currentDir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tconst fullPath = join(currentDir, entry.name);\n\t\t\tif (entry.isFile() && entry.name === binaryFileName) {\n\t\t\t\treturn fullPath;\n\t\t\t}\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tstack.push(fullPath);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction formatSpawnFailure(result: SpawnSyncReturns<Buffer>): string {\n\tif (result.error?.message) {\n\t\treturn result.error.message;\n\t}\n\tconst stderr = result.stderr?.toString().trim();\n\tif (stderr) {\n\t\treturn stderr;\n\t}\n\tconst stdout = result.stdout?.toString().trim();\n\tif (stdout) {\n\t\treturn stdout;\n\t}\n\treturn `exit status ${result.status ?? \"unknown\"}`;\n}\n\nfunction runExtractionCommand(command: string, args: string[]): string | null {\n\tconst result = spawnSync(command, args, { stdio: \"pipe\" });\n\tif (!result.error && result.status === 0) {\n\t\treturn null;\n\t}\n\treturn `${command}: ${formatSpawnFailure(result)}`;\n}\n\nfunction extractTarGzArchive(archivePath: string, extractDir: string, assetName: string): void {\n\tconst failure = runExtractionCommand(\"tar\", [\"xzf\", archivePath, \"-C\", extractDir]);\n\tif (failure) {\n\t\tthrow new Error(`Failed to extract ${assetName}: ${failure}`);\n\t}\n}\n\nfunction getWindowsTarCommand(): string {\n\tconst systemRoot = process.env.SystemRoot ?? process.env.WINDIR;\n\tif (systemRoot) {\n\t\tconst systemTar = join(systemRoot, \"System32\", \"tar.exe\");\n\t\tif (existsSync(systemTar)) {\n\t\t\treturn systemTar;\n\t\t}\n\t}\n\treturn \"tar.exe\";\n}\n\nfunction extractZipArchive(archivePath: string, extractDir: string, assetName: string): void {\n\tconst failures: string[] = [];\n\n\tif (platform() === \"win32\") {\n\t\t// Windows ships bsdtar as tar.exe, which supports zip files. Prefer the\n\t\t// System32 binary over Git Bash's GNU tar, which does not handle zip archives.\n\t\tconst tarFailure = runExtractionCommand(getWindowsTarCommand(), [\"xf\", archivePath, \"-C\", extractDir]);\n\t\tif (!tarFailure) return;\n\t\tfailures.push(tarFailure);\n\n\t\tconst script =\n\t\t\t\"& { param($archive, $destination) $ErrorActionPreference = 'Stop'; Expand-Archive -LiteralPath $archive -DestinationPath $destination -Force }\";\n\t\tconst powershellFailure = runExtractionCommand(\"powershell.exe\", [\n\t\t\t\"-NoLogo\",\n\t\t\t\"-NoProfile\",\n\t\t\t\"-NonInteractive\",\n\t\t\t\"-ExecutionPolicy\",\n\t\t\t\"Bypass\",\n\t\t\t\"-Command\",\n\t\t\tscript,\n\t\t\tarchivePath,\n\t\t\textractDir,\n\t\t]);\n\t\tif (!powershellFailure) return;\n\t\tfailures.push(powershellFailure);\n\t} else {\n\t\tconst unzipFailure = runExtractionCommand(\"unzip\", [\"-q\", archivePath, \"-d\", extractDir]);\n\t\tif (!unzipFailure) return;\n\t\tfailures.push(unzipFailure);\n\n\t\tconst tarFailure = runExtractionCommand(\"tar\", [\"xf\", archivePath, \"-C\", extractDir]);\n\t\tif (!tarFailure) return;\n\t\tfailures.push(tarFailure);\n\t}\n\n\tthrow new Error(`Failed to extract ${assetName}: ${failures.join(\"; \")}`);\n}\n\n// Download and install a tool\nasync function downloadTool(tool: \"fd\" | \"rg\"): Promise<string> {\n\tconst config = TOOLS[tool];\n\tif (!config) throw new Error(`Unknown tool: ${tool}`);\n\n\tconst plat = platform();\n\tconst architecture = arch();\n\n\t// Get latest version\n\tlet version = await getLatestVersion(config.repo);\n\tif (tool === \"fd\" && plat === \"darwin\" && architecture === \"x64\") {\n\t\tversion = \"10.3.0\";\n\t}\n\n\t// Get asset name for this platform\n\tconst assetName = config.getAssetName(version, plat, architecture);\n\tif (!assetName) {\n\t\tthrow new Error(`Unsupported platform: ${plat}/${architecture}`);\n\t}\n\n\t// Create tools directory\n\tmkdirSync(TOOLS_DIR, { recursive: true });\n\n\tconst downloadUrl = `https://github.com/${config.repo}/releases/download/${config.tagPrefix}${version}/${assetName}`;\n\tconst archivePath = join(TOOLS_DIR, assetName);\n\tconst binaryExt = plat === \"win32\" ? \".exe\" : \"\";\n\tconst binaryPath = join(TOOLS_DIR, config.binaryName + binaryExt);\n\n\t// Download\n\tawait downloadFile(downloadUrl, archivePath);\n\n\t// Extract into a unique temp directory. fd and rg downloads can run concurrently\n\t// during startup, so sharing a fixed directory causes races.\n\tconst extractDir = join(\n\t\tTOOLS_DIR,\n\t\t`extract_tmp_${config.binaryName}_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`,\n\t);\n\tmkdirSync(extractDir, { recursive: true });\n\n\ttry {\n\t\tif (assetName.endsWith(\".tar.gz\")) {\n\t\t\textractTarGzArchive(archivePath, extractDir, assetName);\n\t\t} else if (assetName.endsWith(\".zip\")) {\n\t\t\textractZipArchive(archivePath, extractDir, assetName);\n\t\t} else {\n\t\t\tthrow new Error(`Unsupported archive format: ${assetName}`);\n\t\t}\n\n\t\t// Find the binary in extracted files. Some archives contain files directly\n\t\t// at root, others nest under a versioned subdirectory.\n\t\tconst binaryFileName = config.binaryName + binaryExt;\n\t\tconst extractedDir = join(extractDir, assetName.replace(/\\.(tar\\.gz|zip)$/, \"\"));\n\t\tconst extractedBinaryCandidates = [join(extractedDir, binaryFileName), join(extractDir, binaryFileName)];\n\t\tlet extractedBinary = extractedBinaryCandidates.find((candidate) => existsSync(candidate));\n\n\t\tif (!extractedBinary) {\n\t\t\textractedBinary = findBinaryRecursively(extractDir, binaryFileName) ?? undefined;\n\t\t}\n\n\t\tif (extractedBinary) {\n\t\t\trenameSync(extractedBinary, binaryPath);\n\t\t} else {\n\t\t\tthrow new Error(`Binary not found in archive: expected ${binaryFileName} under ${extractDir}`);\n\t\t}\n\n\t\t// Make executable (Unix only)\n\t\tif (plat !== \"win32\") {\n\t\t\tchmodSync(binaryPath, 0o755);\n\t\t}\n\t} finally {\n\t\t// Cleanup\n\t\trmSync(archivePath, { force: true });\n\t\trmSync(extractDir, { recursive: true, force: true });\n\t}\n\n\treturn binaryPath;\n}\n\n// Termux package names for tools\nconst TERMUX_PACKAGES: Record<string, string> = {\n\tfd: \"fd\",\n\trg: \"ripgrep\",\n};\n\nexport interface ToolStatus {\n\ttype: \"info\" | \"warning\";\n\tmessage: string;\n}\n\n/**\n * Ensure a tool is available, downloading if necessary.\n * Reports progress through `onStatus`; status messages are otherwise silent.\n * Returns the tool path, or undefined if unavailable.\n */\nexport async function ensureTool(\n\ttool: \"fd\" | \"rg\",\n\tonStatus?: (status: ToolStatus) => void,\n): Promise<string | undefined> {\n\tconst existingPath = getToolPath(tool);\n\tif (existingPath) {\n\t\treturn existingPath;\n\t}\n\n\tconst config = TOOLS[tool];\n\tif (!config) return undefined;\n\n\tif (isOfflineModeEnabled()) {\n\t\tonStatus?.({ type: \"warning\", message: `${config.name} not found. Offline mode enabled, skipping download.` });\n\t\treturn undefined;\n\t}\n\n\t// On Android/Termux, Linux binaries don't work due to Bionic libc incompatibility.\n\t// Users must install via pkg.\n\tif (platform() === \"android\") {\n\t\tconst pkgName = TERMUX_PACKAGES[tool] ?? tool;\n\t\tonStatus?.({ type: \"warning\", message: `${config.name} not found. Install with: pkg install ${pkgName}` });\n\t\treturn undefined;\n\t}\n\n\t// Tool not found - download it\n\tonStatus?.({ type: \"info\", message: `${config.name} not found. Downloading...` });\n\n\ttry {\n\t\tconst path = await downloadTool(tool);\n\t\tonStatus?.({ type: \"info\", message: `${config.name} installed to ${path}` });\n\t\treturn path;\n\t} catch (e) {\n\t\tonStatus?.({\n\t\t\ttype: \"warning\",\n\t\t\tmessage: `Failed to download ${config.name}: ${e instanceof Error ? e.message : e}`,\n\t\t});\n\t\treturn undefined;\n\t}\n}\n"]}
package/docs/AGENTS.md ADDED
@@ -0,0 +1,67 @@
1
+ # packages/coding-agent/docs/
2
+
3
+ Public documentation for `@code-yeongyu/senpi`. Shipped inside the npm package: `package.json`
4
+ `files` array includes `"docs"`, so every file here lands in the published tarball.
5
+
6
+ ## Navigation manifest
7
+
8
+ `docs.json` has two top-level keys: `navigation` (ordered section and page list) and `redirects`.
9
+ Sections are `{ "title", "items": [{ "title", "path" }] }`; page paths are relative to this directory.
10
+
11
+ - Every new `.md` file needs an entry in `docs.json` under `navigation`.
12
+ - Renamed or moved pages need a `redirects` entry to avoid broken links.
13
+ - Navigation-only stubs without real content belong in `redirects`, not `navigation`.
14
+
15
+ ## Landing page and images
16
+
17
+ `index.md` is the landing page. Images live under `docs/images/`:
18
+ `doom-extension.png`, `exy.png`, `interactive-mode.png`, `tree-view.png`.
19
+
20
+ New images go in `docs/images/`. Don't reference images by absolute URL when a relative path works.
21
+
22
+ ## Protocol and reference pages
23
+
24
+ These pages must track their implementation counterparts. Treat them as specs, not tutorials.
25
+
26
+ | Page | Tracks |
27
+ |------|--------|
28
+ | `rpc.md` | `packages/coding-agent/src/modes/rpc/` |
29
+ | `app-server.md` | `packages/coding-agent/src/modes/app-server/` |
30
+ | `json.md` | JSONL wire format and record shapes |
31
+ | `session-format.md` | Session file structure and field types |
32
+ | `extensions.md` | Public extension API in `src/core/extensions/`; largest page — API tables must match `types.ts` |
33
+ | `release-guide.md` | Release tooling; canonical check/build/test/lock command sequences |
34
+
35
+ Preserve LF line endings and exact field names in these pages. Field spellings and JSONL record
36
+ structures are asserted by tests; prose-only rewording can still break them.
37
+
38
+ ## Validators
39
+
40
+ - `packages/coding-agent/test/qa/app-server/task20-doc-example-check.ts`: Spins up a live
41
+ app-server process and validates that JSON examples in `app-server.md` match actual server
42
+ behavior. Prose edits to `app-server.md` that change JSON shapes will fail this test.
43
+
44
+ ## Terminology
45
+
46
+ Docs mix `senpi` and upstream `Pi` branding in legacy text. Don't do broad rebrand sweeps
47
+ during focused edits; update only the immediate context you're working in.
48
+
49
+ Consistent names: CLI binary is `senpi`, config directory is `.senpi`, npm package is
50
+ `@code-yeongyu/senpi`. Don't use `codex`, `pi`, or `openai-codex` in new prose.
51
+
52
+ ## Security rules
53
+
54
+ - `bearerTokenEnv` names an environment variable, not a token value. Examples must never put
55
+ a literal token in the JSON config; the implementation warns when it detects one.
56
+ - OAuth tokens persist under the agent directory at runtime. Don't surface them in doc examples
57
+ or log snippets.
58
+ - MCP config values are not shell-expanded. Don't document or imply `$VAR` substitution in
59
+ JSON config examples.
60
+ - `mcp.md` must not advertise URL-mode elicitation; it's not a shipped feature.
61
+
62
+ ## Anti-patterns
63
+
64
+ - No new `.md` file without a `docs.json` entry.
65
+ - Don't edit protocol page prose without checking whether `task20-doc-example-check.ts` would break.
66
+ - Don't copy claims from upstream Pi docs without verifying they apply to the senpi fork.
67
+ - Don't embed bearer tokens, session IDs, or raw API keys in example output.
@@ -2,12 +2,12 @@
2
2
 
3
3
  LLMs have limited context windows. When conversations grow too long, senpi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
4
4
 
5
- **Source files** ([pi](https://github.com/earendil-works/pi)):
6
- - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
- - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
- - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
- - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
- - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
5
+ **Source files** ([pi-mono](https://github.com/earendil-works/pi-mono)):
6
+ - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
+ - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
+ - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
+ - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
+ - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
11
11
 
12
12
  For TypeScript definitions in your project, inspect `node_modules/@code-yeongyu/senpi/dist/`.
13
13
 
@@ -120,7 +120,7 @@ Never cut at tool results (they must stay with their tool call).
120
120
 
121
121
  ### CompactionEntry Structure
122
122
 
123
- Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts):
123
+ Defined in [`session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
124
124
 
125
125
  ```typescript
126
126
  interface CompactionEntry<T = unknown> {
@@ -145,7 +145,7 @@ interface CompactionDetails {
145
145
 
146
146
  Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure. Generated and extension-provided summaries store their LLM `usage` when available so session totals include summarization work.
147
147
 
148
- See [`prepareCompaction()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation. For direct programmatic summarization, `generateSummary()` returns the summary text and `generateSummaryWithUsage()` returns `{ text, usage }`.
148
+ See [`prepareCompaction()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation. For direct programmatic summarization, `generateSummary()` returns the summary text and `generateSummaryWithUsage()` returns `{ text, usage }`.
149
149
 
150
150
  ## Branch Summarization
151
151
 
@@ -188,7 +188,7 @@ This means file tracking accumulates across multiple compactions or nested branc
188
188
 
189
189
  ### BranchSummaryEntry Structure
190
190
 
191
- Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts):
191
+ Defined in [`session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
192
192
 
193
193
  ```typescript
194
194
  interface BranchSummaryEntry<T = unknown> {
@@ -212,7 +212,7 @@ interface BranchSummaryDetails {
212
212
 
213
213
  Same as compaction, extensions can store custom data in `details`.
214
214
 
215
- See [`collectEntriesForBranchSummary()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
215
+ See [`collectEntriesForBranchSummary()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
216
216
 
217
217
  ## Summary Format
218
218
 
@@ -256,7 +256,7 @@ path/to/changed.ts
256
256
 
257
257
  ### Message Serialization
258
258
 
259
- Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
259
+ Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
260
260
 
261
261
  ```
262
262
  [User]: What they said
@@ -272,7 +272,7 @@ Tool results are truncated to 2000 characters during serialization. Content beyo
272
272
 
273
273
  ## Custom Summarization via Extensions
274
274
 
275
- Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
275
+ Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
276
276
 
277
277
  ### session_before_compact
278
278
 
@@ -288,7 +288,7 @@ pi.on("session_before_compact", async (event, ctx) => {
288
288
  // preparation.fileOps - extracted file operations
289
289
  // preparation.tokensBefore - context tokens before compaction
290
290
  // preparation.firstKeptEntryId - where kept messages start
291
- // preparation.settings - effective settings after applying model overrides
291
+ // preparation.settings - compaction settings
292
292
 
293
293
  // branchEntries - all entries on current branch (for custom state)
294
294
  // reason - "manual" (/compact), "threshold", or "overflow"
@@ -416,29 +416,3 @@ Configure compaction in `~/.senpi/agent/settings.json` or `<project-dir>/.senpi/
416
416
  | `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
417
417
 
418
418
  Disable proactive auto-compaction with `"enabled": false`. You can still compact manually with `/compact`, and a context the provider rejects as too large is still compacted once and retried automatically.
419
-
420
- ### Per-model overrides
421
-
422
- Use `compaction.modelOverrides` to tune token budgets for different models:
423
-
424
- ```json
425
- {
426
- "compaction": {
427
- "reserveTokens": 16384,
428
- "keepRecentTokens": 20000,
429
- "modelOverrides": {
430
- "some-provider/big-model": {
431
- "reserveTokens": 400000
432
- }
433
- }
434
- }
435
- }
436
- ```
437
-
438
- For a model with a 1M context window, this override triggers compaction above 600K tokens and keeps the ordinary 20000 recent tokens. Other models retain the ordinary 16384-token reserve. `reserveTokens` also influences summarization output limits, capped by the model's maximum output tokens; it is not solely a trigger threshold.
439
-
440
- Keys are exact, case-sensitive `provider/modelId` values, including any slashes within the model ID. Each `reserveTokens` and `keepRecentTokens` value falls back independently from the model override to the ordinary setting to the built-in default. Values must be non-negative safe integers. Invalid values in the matching model override produce an error when read; only omitted fields fall back to the ordinary setting. Model override entries must be objects. Invalid ordinary token settings produce an error when read, even if the active model has a valid override. Only omitted ordinary values use built-in defaults. `enabled` remains global, not model-specific.
441
-
442
- These resolved values are used for manual compaction, all automatic threshold checks, overflow recovery, and extension-visible `preparation.settings`. Model switches affect subsequent checks and compactions without changing ordinary settings. Compaction already in progress uses the model and settings captured for that operation. Branch summarization settings are unaffected.
443
-
444
- Overrides work in both global and project settings. The files merge recursively before lookup, so a global model-specific value beats a project-wide fallback; a project must override that model entry to change it. See [settings.md](settings.md#per-model-compaction-overrides) for details.
@@ -13,7 +13,6 @@ There are two general options. You can either
13
13
  | Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
14
14
  | Plain Docker | Whole `senpi` process in a local container | Simple local isolation | Provider API keys enter the container. |
15
15
  | OpenShell | Whole `senpi` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
16
- | Docker Sandboxes | Whole `senpi` process in a managed sandbox | Local isolation with provider keys kept on the host | Requires Docker Sandboxes (`sbx`) and a kit that includes `senpi`. |
17
16
 
18
17
  Extensions run wherever the `senpi` process runs. If you run host `senpi` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
19
18
 
@@ -110,47 +109,3 @@ openshell sandbox download senpi-sandbox /workspace/repo ./repo-out
110
109
  OpenShell providers can keep raw model API keys outside the sandbox.
111
110
  When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
112
111
  Configure senpi to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
113
-
114
- ## Docker Sandboxes
115
-
116
- [Docker Sandboxes](https://docs.docker.com/ai/sandboxes/) is a managed sandbox runtime from Docker that runs the whole `senpi` process inside a sandbox.
117
- It is one of the container boundaries [No Built-in Sandbox](security.md#no-built-in-sandbox) points to.
118
-
119
- Unlike the Plain Docker pattern above, the provider credential is not passed into the container.
120
- The sandbox receives a sentinel value instead, and the `sbx` proxy substitutes the real credential on egress to `api.anthropic.com`.
121
- Credentials are wired at creation time, so store yours on the host before you create the sandbox.
122
-
123
- For a Claude Pro/Max subscription, run `claude setup-token` on a machine with Claude Code, then store the result on the host.
124
- If an `anthropic` secret is already bound, remove it first: otherwise the proxy adds an `x-api-key` header alongside the Bearer token and Anthropic rejects the request.
125
- `sbx secret set-custom` reads the token from stdin, so it stays out of shell history.
126
-
127
- ```bash
128
- sbx secret rm anthropic
129
-
130
- sbx secret set-custom \
131
- --host api.anthropic.com \
132
- --env ANTHROPIC_OAUTH_TOKEN \
133
- --placeholder 'sk-ant-oat01-{rand}'
134
- ```
135
-
136
- The sandbox gets an OAuth-shaped placeholder, not the real token, and the proxy swaps it on egress to that host; `ANTHROPIC_OAUTH_TOKEN` is a variable senpi already reads and prefers over an API key, so no extra senpi configuration is needed.
137
-
138
- For an API key, store it with `sbx secret set anthropic` instead. The kit wires it the same way, as a sentinel the proxy substitutes on egress.
139
-
140
- With the credential stored, launch `senpi` from the project you want mounted. The community `pi-kit` bakes upstream `pi` into its image, not `senpi`, so use a kit that installs `@code-yeongyu/senpi` (or install it inside the sandbox) and start `senpi` from it:
141
-
142
- ```bash
143
- sbx run --kit "<your-senpi-kit>" senpi
144
- ```
145
-
146
- The current directory becomes the sandbox workspace.
147
-
148
- Do not authenticate from inside the sandbox: `/login` there writes a real token into the container and defeats the proxy model.
149
-
150
- Scripted use works the same way:
151
-
152
- ```bash
153
- sbx exec <sandbox-name> -- senpi -p "list the failing tests"
154
- ```
155
-
156
- See the upstream [pi kit documentation](https://github.com/docker/sbx-kits-contrib/tree/main/pi) for the credential matrix, troubleshooting, and pinning; the same secret wiring applies to a `senpi` kit.
@@ -19,19 +19,6 @@ Run from source:
19
19
 
20
20
  The script can be run from any directory. Senpi keeps the caller's current working directory.
21
21
 
22
- ### Experimental remote harness
23
-
24
- The upstream remote harness server/client integration lives under `packages/coding-agent/src/experimental/` and is development-only. Run it from the repository with:
25
-
26
- ```bash
27
- PI_EXPERIMENTAL=1 ./pi-test.sh server
28
- PI_EXPERIMENTAL=1 ./pi-test.sh client
29
- ```
30
-
31
- `PI_SERVER_DIR` overrides the server profile and socket directory (default: `~/.pi/server`). `PI_SERVER_ID` selects the logical server ID when `--server-id` is omitted.
32
-
33
- The `experimental/plugin` subpath and the experimental server/client commands resolve only under the `source` condition in a checkout. Their implementations are excluded from npm packages and standalone binaries. Unlike upstream, `@earendil-works/pi-client` and `@earendil-works/pi-protocol` remain runtime dependencies of `@code-yeongyu/senpi`, and the `./client` entry point stays published; only the experimental sources are source-only. The local SDK and stdio RPC API are unchanged.
34
-
35
22
  ## Forking / Rebranding
36
23
 
37
24
  This repo is itself a rebrand of upstream `pi-mono` to `senpi`. The runtime identity (CLI name, config dir, env var prefix) is configured via `package.json`:
@@ -82,12 +69,6 @@ bun run --cwd packages/coding-agent test -- test/specific.test.ts
82
69
  bun run test --workspace packages/coding-agent -- test/specific.test.ts
83
70
  ```
84
71
 
85
- ### Published package smoke test
86
-
87
- After building, run `npm run check:package-install`. It packs the public packages and installs only coding-agent as a direct dependency in a temporary directory outside the repository. Local tarball overrides select declared transitive dependencies without installing development-only packages. The check verifies SDK imports and CLI startup without credentials or model requests.
88
-
89
- `npm run check` also checks runtime dependency declarations and rejects excluded development sources pulled into a package's build through imports.
90
-
91
72
  ## Project Structure
92
73
 
93
74
  ```
package/docs/docs.json CHANGED
@@ -93,10 +93,6 @@
93
93
  {
94
94
  "title": "Reference",
95
95
  "items": [
96
- {
97
- "title": "Environment Variables",
98
- "path": "environment-variables.md"
99
- },
100
96
  {
101
97
  "title": "Session Format",
102
98
  "path": "session-format.md"
@@ -105,5 +105,3 @@ These variables are read by Pi itself:
105
105
  | `PI_IMAGE_GEN_PROVIDER` | Pin a specific configured gateway provider for image generation (for example `quotio-openai`). The provider must have a resolvable API key and base URL in `models.json`. When unset, the credential resolver picks the best available source automatically |
106
106
 
107
107
  Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and cloud-provider configuration are listed in [Providers](providers.md#environment-variables-or-auth-file).
108
-
109
- `PI_SERVER_DIR` and `PI_SERVER_ID` apply only to the source-only [experimental remote harness](development.md#experimental-remote-harness), not distributed builds.