@psnext/slingcli 2.5.20260623-1 → 2.5.20260705-1

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 (445) hide show
  1. package/node_modules/@aws/lambda-invoke-store/README.md +25 -1
  2. package/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +12 -0
  3. package/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +12 -0
  4. package/node_modules/@aws/lambda-invoke-store/dist-types/invoke-store.d.ts +6 -0
  5. package/node_modules/@aws/lambda-invoke-store/package.json +1 -1
  6. package/node_modules/@aws-sdk/core/account-id-endpoint.d.ts +1 -3
  7. package/node_modules/@aws-sdk/core/client.d.ts +1 -3
  8. package/node_modules/@aws-sdk/core/httpAuthSchemes.d.ts +1 -3
  9. package/node_modules/@aws-sdk/core/package.json +10 -17
  10. package/node_modules/@aws-sdk/core/protocols.d.ts +1 -3
  11. package/node_modules/@aws-sdk/core/util.d.ts +1 -3
  12. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  13. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +172 -1
  14. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
  15. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
  16. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
  17. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +4 -4
  18. package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -10
  19. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  20. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  21. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  22. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  23. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
  24. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  25. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +58 -3
  26. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -8
  27. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
  28. package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
  29. package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
  30. package/node_modules/@aws-sdk/nested-clients/cognito-identity.d.ts +1 -3
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +13 -25
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +13 -17
  33. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +12 -15
  34. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +12 -15
  35. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +13 -25
  36. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commandBuilder.js +6 -0
  37. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.js +2 -14
  38. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetIdCommand.js +2 -14
  39. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/index.js +1 -0
  40. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +0 -2
  41. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +1 -2
  42. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.native.js +0 -2
  43. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.shared.js +2 -0
  44. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commandBuilder.js +8 -0
  45. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +2 -17
  46. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js +1 -0
  47. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +0 -2
  48. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +1 -2
  49. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.native.js +0 -2
  50. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js +2 -0
  51. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commandBuilder.js +6 -0
  52. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js +2 -14
  53. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js +1 -0
  54. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +0 -2
  55. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +1 -2
  56. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.native.js +0 -2
  57. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js +2 -0
  58. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commandBuilder.js +6 -0
  59. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js +2 -14
  60. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js +1 -0
  61. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +0 -2
  62. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +1 -2
  63. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.native.js +0 -2
  64. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js +2 -0
  65. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commandBuilder.js +6 -0
  66. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js +2 -14
  67. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js +2 -14
  68. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js +1 -0
  69. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +0 -2
  70. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +1 -2
  71. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.native.js +0 -2
  72. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js +2 -0
  73. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commandBuilder.d.ts +18 -0
  74. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +3 -8
  75. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commands/GetIdCommand.d.ts +3 -8
  76. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/index.d.ts +1 -0
  77. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -2
  78. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -2
  79. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -2
  80. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +1 -0
  81. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commandBuilder.d.ts +18 -0
  82. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +3 -8
  83. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -0
  84. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -2
  85. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -2
  86. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -2
  87. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +1 -0
  88. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/commandBuilder.d.ts +18 -0
  89. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +3 -8
  90. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/index.d.ts +1 -0
  91. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -2
  92. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -2
  93. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -2
  94. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +1 -0
  95. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/commandBuilder.d.ts +18 -0
  96. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +3 -8
  97. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/index.d.ts +1 -0
  98. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -2
  99. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -2
  100. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -2
  101. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +1 -0
  102. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commandBuilder.d.ts +18 -0
  103. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleCommand.d.ts +3 -8
  104. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -8
  105. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +1 -0
  106. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -2
  107. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -2
  108. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -2
  109. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +1 -0
  110. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commandBuilder.d.ts +46 -0
  111. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +7 -16
  112. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commands/GetIdCommand.d.ts +7 -16
  113. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/index.d.ts +1 -0
  114. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +8 -2
  115. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +8 -2
  116. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +8 -2
  117. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +1 -0
  118. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commandBuilder.d.ts +42 -0
  119. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +3 -8
  120. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/index.d.ts +1 -0
  121. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +8 -2
  122. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +8 -2
  123. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +8 -2
  124. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +1 -0
  125. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/commandBuilder.d.ts +42 -0
  126. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +3 -8
  127. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/index.d.ts +1 -0
  128. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +8 -2
  129. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +8 -2
  130. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +8 -2
  131. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +1 -0
  132. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/commandBuilder.d.ts +42 -0
  133. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +3 -8
  134. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/index.d.ts +1 -0
  135. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +8 -2
  136. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +8 -2
  137. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +8 -2
  138. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +1 -0
  139. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commandBuilder.d.ts +46 -0
  140. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commands/AssumeRoleCommand.d.ts +7 -16
  141. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +7 -16
  142. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/index.d.ts +1 -0
  143. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +8 -2
  144. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +8 -2
  145. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +8 -2
  146. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +1 -0
  147. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
  148. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
  149. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
  150. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +4 -4
  151. package/node_modules/@aws-sdk/nested-clients/package.json +8 -10
  152. package/node_modules/@aws-sdk/nested-clients/signin.d.ts +1 -3
  153. package/node_modules/@aws-sdk/nested-clients/sso-oidc.d.ts +1 -3
  154. package/node_modules/@aws-sdk/nested-clients/sso.d.ts +1 -3
  155. package/node_modules/@aws-sdk/nested-clients/sts.d.ts +1 -3
  156. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
  157. package/node_modules/@aws-sdk/types/package.json +2 -2
  158. package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +236 -3
  159. package/node_modules/@aws-sdk/xml-builder/package.json +3 -4
  160. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +10 -1
  161. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +9 -8
  162. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +20 -2
  163. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +2 -1
  164. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -1
  165. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  166. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +51 -47
  167. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +11 -17
  168. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +25 -11
  169. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare.js +0 -18
  170. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +8 -4
  171. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +8 -4
  172. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
  173. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +68 -43
  174. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +38 -29
  175. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +189 -204
  176. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +26 -35
  177. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +4 -6
  178. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +11 -2
  179. package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +2 -2
  180. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +19 -4
  181. package/node_modules/@earendil-works/pi-ai/dist/compat.js +81 -7
  182. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +60 -45
  183. package/node_modules/@earendil-works/pi-ai/dist/images-models.js +7 -3
  184. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  185. package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.js +49 -0
  186. package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -3
  187. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +149 -12
  188. package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js +3 -3
  189. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +18 -34
  190. package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +20 -0
  191. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +2 -2
  192. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +39 -9
  193. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +85 -0
  194. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js +2 -2
  195. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js +13 -13
  196. package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +2 -2
  197. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +1 -20
  198. package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +20 -1
  199. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +57 -0
  200. package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +1 -1
  201. package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js +72 -0
  202. package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js +4 -4
  203. package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js +4 -4
  204. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +4 -4
  205. package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +23 -4
  206. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +16 -16
  207. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +90 -17
  208. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +390 -102
  209. package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +39 -20
  210. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +389 -80
  211. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +7 -0
  212. package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +12 -12
  213. package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +12 -12
  214. package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +12 -12
  215. package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +15 -15
  216. package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +6 -6
  217. package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +6 -6
  218. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +109 -0
  219. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +95 -0
  220. package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js +10 -0
  221. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +15 -2
  222. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +3 -2
  223. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +2 -2
  224. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -0
  225. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +87 -0
  226. package/node_modules/@earendil-works/pi-ai/package.json +1 -33
  227. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +13 -25
  228. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +50 -34
  229. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +13 -5
  230. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +11 -11
  231. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +11 -1
  232. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +33 -1
  233. package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +28 -1
  234. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +2 -4
  235. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +15 -18
  236. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
  237. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +0 -10
  238. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +2 -0
  239. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +96 -73
  240. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +19 -0
  241. package/node_modules/@earendil-works/pi-coding-agent/dist/core/timings.js +24 -14
  242. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +20 -5
  243. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +2 -2
  244. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +12 -25
  245. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
  246. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +20 -4
  247. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +23 -15
  248. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +52 -0
  249. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +12 -3
  250. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +14 -3
  251. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +13 -1
  252. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +60 -0
  253. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +19 -6
  254. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +180 -155
  255. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +14 -0
  256. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +16 -0
  257. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +7 -0
  258. package/node_modules/@earendil-works/pi-coding-agent/dist/rpc-entry.js +10 -0
  259. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-convert.js +21 -15
  260. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-process.js +83 -0
  261. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/mime.js +41 -0
  262. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
  263. package/node_modules/@earendil-works/pi-coding-agent/package.json +8 -5
  264. package/node_modules/@earendil-works/pi-orchestrator/dist/cli.js +136 -0
  265. package/node_modules/@earendil-works/pi-orchestrator/dist/config.js +55 -0
  266. package/node_modules/@earendil-works/pi-orchestrator/dist/handler.js +105 -0
  267. package/node_modules/@earendil-works/pi-orchestrator/dist/index.js +11 -0
  268. package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/client.js +56 -0
  269. package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/protocol.js +12 -0
  270. package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/server.js +145 -0
  271. package/node_modules/@earendil-works/pi-orchestrator/dist/radius.js +365 -0
  272. package/node_modules/@earendil-works/pi-orchestrator/dist/rpc-process.js +168 -0
  273. package/node_modules/@earendil-works/pi-orchestrator/dist/serve.js +70 -0
  274. package/node_modules/@earendil-works/pi-orchestrator/dist/storage.js +58 -0
  275. package/node_modules/@earendil-works/pi-orchestrator/dist/supervisor.js +290 -0
  276. package/node_modules/@earendil-works/pi-orchestrator/dist/types.js +2 -0
  277. package/node_modules/@earendil-works/pi-orchestrator/package.json +45 -0
  278. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -0
  279. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  280. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +358 -145
  281. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +462 -142
  282. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +358 -145
  283. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +18 -0
  284. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +108 -63
  285. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +11 -8
  286. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -8
  287. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +5 -2
  288. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +30 -36
  289. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +85 -137
  290. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +30 -36
  291. package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js +30 -0
  292. package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js +24 -0
  293. package/node_modules/@smithy/core/dist-es/submodules/checksum/index.browser.js +7 -1
  294. package/node_modules/@smithy/core/dist-es/submodules/checksum/index.js +7 -1
  295. package/node_modules/@smithy/core/dist-es/submodules/checksum/index.native.js +7 -1
  296. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Js.js +92 -0
  297. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Node.js +29 -0
  298. package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Js.js +179 -0
  299. package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js +59 -0
  300. package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256WebCrypto.js +71 -0
  301. package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -0
  302. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client-command-builder.js +17 -0
  303. package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js +6 -1
  304. package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.js +92 -0
  305. package/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js +3 -0
  306. package/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js +3 -56
  307. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js +5 -3
  308. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js +7 -6
  309. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -1
  310. package/node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js +15 -0
  311. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +2 -0
  312. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +2 -0
  313. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +2 -0
  314. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.js +35 -27
  315. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.js +2 -1
  316. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js +12 -38
  317. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js +18 -33
  318. package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.browser.js +3 -0
  319. package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js +3 -0
  320. package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Js.d.ts +18 -0
  321. package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Node.d.ts +18 -0
  322. package/node_modules/@smithy/core/dist-types/submodules/checksum/index.browser.d.ts +7 -1
  323. package/node_modules/@smithy/core/dist-types/submodules/checksum/index.d.ts +7 -1
  324. package/node_modules/@smithy/core/dist-types/submodules/checksum/index.native.d.ts +7 -1
  325. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Js.d.ts +19 -0
  326. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Node.d.ts +17 -0
  327. package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Js.d.ts +28 -0
  328. package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Node.d.ts +13 -0
  329. package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256WebCrypto.d.ts +22 -0
  330. package/node_modules/@smithy/core/dist-types/submodules/client/index.d.ts +1 -0
  331. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/client-command-builder.d.ts +22 -0
  332. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/command.d.ts +5 -6
  333. package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.d.ts +7 -0
  334. package/node_modules/@smithy/core/dist-types/submodules/config/defaults-mode/constants.d.ts +12 -0
  335. package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.browser.d.ts +4 -5
  336. package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +4 -5
  337. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.d.ts +3 -4
  338. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/endpointMiddleware.d.ts +1 -2
  339. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/getEndpointPlugin.d.ts +1 -2
  340. package/node_modules/@smithy/core/dist-types/submodules/serde/concatBytes.d.ts +6 -0
  341. package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +2 -0
  342. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +2 -0
  343. package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +2 -0
  344. package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/checksum/ChecksumStream.d.ts +29 -12
  345. package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.browser.d.ts +8 -2
  346. package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.d.ts +4 -1
  347. package/node_modules/@smithy/core/package.json +5 -5
  348. package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
  349. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -55
  350. package/node_modules/@smithy/fetch-http-handler/dist-es/index.js +2 -2
  351. package/node_modules/@smithy/fetch-http-handler/dist-types/index.d.ts +2 -2
  352. package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
  353. package/node_modules/@smithy/signature-v4/package.json +3 -4
  354. package/node_modules/@smithy/types/dist-types/index.d.ts +1 -0
  355. package/node_modules/@smithy/types/package.json +1 -1
  356. package/node_modules/@types/node/README.md +1 -1
  357. package/node_modules/@types/node/buffer.d.ts +64 -25
  358. package/node_modules/@types/node/crypto.d.ts +18 -5
  359. package/node_modules/@types/node/diagnostics_channel.d.ts +254 -23
  360. package/node_modules/@types/node/dns.d.ts +1 -1
  361. package/node_modules/@types/node/ffi.d.ts +486 -0
  362. package/node_modules/@types/node/fs/promises.d.ts +3 -0
  363. package/node_modules/@types/node/fs.d.ts +21 -6
  364. package/node_modules/@types/node/http.d.ts +25 -0
  365. package/node_modules/@types/node/index.d.ts +1 -0
  366. package/node_modules/@types/node/package.json +2 -2
  367. package/node_modules/@types/node/process.d.ts +14 -1
  368. package/node_modules/@types/node/quic.d.ts +92 -11
  369. package/node_modules/@types/node/sqlite.d.ts +55 -0
  370. package/node_modules/@types/node/stream/iter.d.ts +150 -0
  371. package/node_modules/@types/node/stream.d.ts +32 -0
  372. package/node_modules/@types/node/test.d.ts +112 -2
  373. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  374. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  375. package/node_modules/@types/node/util.d.ts +19 -2
  376. package/node_modules/@types/node/v8.d.ts +84 -2
  377. package/node_modules/@types/node/worker_threads.d.ts +8 -7
  378. package/node_modules/brace-expansion/dist/commonjs/index.js +24 -14
  379. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
  380. package/node_modules/brace-expansion/dist/esm/index.js +24 -14
  381. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
  382. package/node_modules/brace-expansion/package.json +2 -2
  383. package/node_modules/google-auth-library/build/src/auth/googleauth.js +1 -1
  384. package/node_modules/google-auth-library/package.json +4 -4
  385. package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
  386. package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
  387. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  388. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  389. package/node_modules/protobufjs/dist/protobuf.js +5 -2
  390. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  391. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  392. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  393. package/node_modules/protobufjs/package.json +1 -1
  394. package/node_modules/protobufjs/src/parse.js +3 -0
  395. package/package.json +7 -6
  396. package/slingshot/index.js +293 -295
  397. package/node_modules/@aws-crypto/crc32/CHANGELOG.md +0 -100
  398. package/node_modules/@aws-crypto/crc32/LICENSE +0 -201
  399. package/node_modules/@aws-crypto/crc32/README.md +0 -16
  400. package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.d.ts +0 -7
  401. package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js +0 -31
  402. package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js.map +0 -1
  403. package/node_modules/@aws-crypto/crc32/build/main/index.d.ts +0 -7
  404. package/node_modules/@aws-crypto/crc32/build/main/index.js +0 -108
  405. package/node_modules/@aws-crypto/crc32/build/main/index.js.map +0 -1
  406. package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.d.ts +0 -7
  407. package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js +0 -28
  408. package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js.map +0 -1
  409. package/node_modules/@aws-crypto/crc32/build/module/index.d.ts +0 -7
  410. package/node_modules/@aws-crypto/crc32/build/module/index.js +0 -103
  411. package/node_modules/@aws-crypto/crc32/build/module/index.js.map +0 -1
  412. package/node_modules/@aws-crypto/crc32/package.json +0 -32
  413. package/node_modules/@aws-crypto/crc32/src/aws_crc32.ts +0 -24
  414. package/node_modules/@aws-crypto/crc32/src/index.ts +0 -92
  415. package/node_modules/@aws-crypto/crc32/tsconfig.json +0 -9
  416. package/node_modules/@aws-crypto/crc32/tsconfig.module.json +0 -7
  417. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +0 -869
  418. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +0 -862
  419. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +0 -42
  420. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +0 -27
  421. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +0 -71
  422. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +0 -49
  423. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +0 -13
  424. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +0 -2
  425. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
  426. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
  427. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
  428. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
  429. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +0 -29
  430. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +0 -25
  431. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
  432. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
  433. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
  434. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
  435. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +0 -57
  436. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +0 -234
  437. package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +0 -44
  438. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/constants.js +0 -3
  439. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/md5.js +0 -168
  440. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/constants.d.ts +0 -12
  441. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/md5.d.ts +0 -16
  442. package/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js +0 -53
  443. package/node_modules/@smithy/fetch-http-handler/dist-types/stream-collector.d.ts +0 -2
  444. /package/node_modules/@smithy/{core/dist-es/submodules/endpoints/middleware-endpoint/types.js → types/dist-es/endpoints/EndpointParameterInstructions.js} +0 -0
  445. /package/node_modules/@smithy/{core/dist-types/submodules/endpoints/middleware-endpoint/types.d.ts → types/dist-types/endpoints/EndpointParameterInstructions.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/signature-v4-multi-region",
3
- "version": "3.996.35",
3
+ "version": "3.996.38",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
6
6
  "build:browser": "node ./test-browser/browser-build/esbuild",
@@ -26,9 +26,9 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/types": "^3.973.13",
30
- "@smithy/signature-v4": "^5.4.6",
31
- "@smithy/types": "^4.14.3",
29
+ "@aws-sdk/types": "^3.973.15",
30
+ "@smithy/signature-v4": "^5.6.1",
31
+ "@smithy/types": "^4.15.1",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/types",
3
- "version": "3.973.13",
3
+ "version": "3.973.15",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "module": "./dist-es/index.js",
6
6
  "types": "./dist-types/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "directory": "packages-internal/types"
43
43
  },
44
44
  "dependencies": {
45
- "@smithy/types": "^4.14.3",
45
+ "@smithy/types": "^4.15.1",
46
46
  "tslib": "^2.6.2"
47
47
  },
48
48
  "devDependencies": {
@@ -1,6 +1,3 @@
1
- const { parseXML } = require("./xml-parser");
2
- exports.parseXML = parseXML;
3
-
4
1
  const ATTR_ESCAPE_RE = /[&<>"]/g;
5
2
  const ATTR_ESCAPE_MAP = {
6
3
  "&": "&amp;",
@@ -125,5 +122,241 @@ class XmlNode {
125
122
  }
126
123
  }
127
124
 
125
+ function parseXML(xml) {
126
+ const state = new AwsXmlParser(xml);
127
+ return state.parse();
128
+ }
129
+ class AwsXmlParser {
130
+ x;
131
+ i = 0;
132
+ z;
133
+ constructor(x) {
134
+ this.x = x;
135
+ this.x = x.replace(/\r\n?/g, "\n");
136
+ this.z = this.x.length;
137
+ }
138
+ parse() {
139
+ const p = this;
140
+ const { z } = p;
141
+ while (p.i < z) {
142
+ p.trim();
143
+ if (p.i >= z) {
144
+ break;
145
+ }
146
+ if (p.isNext("<?")) {
147
+ p.readTo("?>");
148
+ p.trim();
149
+ }
150
+ else if (p.isNext("<!--")) {
151
+ p.readTo("-->");
152
+ p.trim();
153
+ }
154
+ else if (p.isNext("<!DOCTYPE", false)) {
155
+ p.skipDoctype();
156
+ p.trim();
157
+ }
158
+ else if (p.x[p.i] === "<") {
159
+ const root = p.parseTag();
160
+ return { [root.tag]: root.value };
161
+ }
162
+ else {
163
+ throw new Error("@aws-sdk XML parse error: unexpected content.");
164
+ }
165
+ }
166
+ throw new Error("@aws-sdk XML parse error: no root element.");
167
+ }
168
+ isNext(s, caseSensitive = true) {
169
+ const p = this;
170
+ if (caseSensitive) {
171
+ return p.x.startsWith(s, p.i);
172
+ }
173
+ return p.x.toLowerCase().startsWith(s.toLowerCase(), p.i);
174
+ }
175
+ readTo(stop) {
176
+ const p = this;
177
+ const _i = p.x.indexOf(stop, p.i);
178
+ if (_i === -1) {
179
+ throw new Error(`@aws-sdk XML parse error: expected "${stop}" not found.`);
180
+ }
181
+ const result = p.x.slice(p.i, _i);
182
+ p.i = _i + stop.length;
183
+ return result;
184
+ }
185
+ trim() {
186
+ const p = this;
187
+ while (p.i < p.z && " \t\r\n".includes(p.x[p.i])) {
188
+ ++p.i;
189
+ }
190
+ }
191
+ readAttrValue() {
192
+ const p = this;
193
+ const quote = p.x[p.i];
194
+ ++p.i;
195
+ let value = "";
196
+ while (p.i < p.z && p.x[p.i] !== quote) {
197
+ value += p.x[p.i++];
198
+ }
199
+ ++p.i;
200
+ return p.decodeEntities(value);
201
+ }
202
+ parseTag() {
203
+ const p = this;
204
+ ++p.i;
205
+ let tag = "";
206
+ while (p.i < p.z && !" \t\r\n>/".includes(p.x[p.i])) {
207
+ tag += p.x[p.i++];
208
+ }
209
+ let hasAttrs = false;
210
+ const attrs = Object.create(null);
211
+ while (p.i < p.z) {
212
+ p.trim();
213
+ if (">/".includes(p.x[p.i])) {
214
+ break;
215
+ }
216
+ let name = "";
217
+ while (p.i < p.z && !"= \t\r\n>/?".includes(p.x[p.i])) {
218
+ name += p.x[p.i++];
219
+ }
220
+ p.trim();
221
+ if (p.x[p.i] !== "=") {
222
+ break;
223
+ }
224
+ ++p.i;
225
+ p.trim();
226
+ attrs[name] = p.readAttrValue();
227
+ hasAttrs = true;
228
+ }
229
+ if (p.i >= p.z) {
230
+ throw new Error("@aws-sdk XML parse error: unexpected end of input.");
231
+ }
232
+ if (p.x[p.i] === "/") {
233
+ ++p.i;
234
+ if (p.i >= p.z || p.x[p.i] !== ">") {
235
+ throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");
236
+ }
237
+ ++p.i;
238
+ Object.setPrototypeOf(attrs, Object.prototype);
239
+ return { tag, value: hasAttrs ? attrs : "" };
240
+ }
241
+ if (p.x[p.i] !== ">") {
242
+ throw new Error("@aws-sdk XML parse error: expected > at the end of opening tag.");
243
+ }
244
+ ++p.i;
245
+ const textParts = [];
246
+ const childTags = [];
247
+ let hasElementChild = false;
248
+ while (p.i < p.z) {
249
+ if (p.isNext("</")) {
250
+ break;
251
+ }
252
+ if (p.x[p.i] === "<") {
253
+ if (p.isNext("<!--")) {
254
+ p.readTo("-->");
255
+ }
256
+ else if (p.isNext("<![CDATA[")) {
257
+ p.i += 9;
258
+ textParts.push(p.readTo("]]>"));
259
+ }
260
+ else if (p.isNext("<?")) {
261
+ p.readTo("?>");
262
+ }
263
+ else {
264
+ hasElementChild = true;
265
+ childTags.push(p.parseTag());
266
+ }
267
+ }
268
+ else {
269
+ let text = "";
270
+ while (p.i < p.z && p.x[p.i] !== "<") {
271
+ text += p.x[p.i++];
272
+ }
273
+ textParts.push(p.decodeEntities(text));
274
+ }
275
+ }
276
+ if (!p.isNext("</")) {
277
+ throw new Error(`@aws-sdk XML parse error: missing closing tag </${tag}>.`);
278
+ }
279
+ p.i += 2;
280
+ const closeTag = p.readTo(">").trim();
281
+ if (closeTag !== tag) {
282
+ throw new Error(`@aws-sdk XML parse error: mismatched tags <${tag}> and </${closeTag}>.`);
283
+ }
284
+ if (!hasAttrs && textParts.length === 0 && !hasElementChild) {
285
+ return { tag, value: "" };
286
+ }
287
+ if (!hasAttrs && !hasElementChild) {
288
+ const text = textParts.length === 1 ? textParts[0] : textParts.join("");
289
+ if (text.trim() === "" && text.includes("\n")) {
290
+ return { tag, value: "" };
291
+ }
292
+ return { tag, value: text };
293
+ }
294
+ const obj = Object.create(null);
295
+ for (const text of textParts) {
296
+ if (text.trim() === "" && text.includes("\n")) {
297
+ continue;
298
+ }
299
+ obj["#text"] = "#text" in obj ? obj["#text"] + text : text;
300
+ }
301
+ for (const child of childTags) {
302
+ if (child.tag in obj) {
303
+ if (Array.isArray(obj[child.tag])) {
304
+ obj[child.tag].push(child.value);
305
+ }
306
+ else {
307
+ obj[child.tag] = [obj[child.tag], child.value];
308
+ }
309
+ }
310
+ else {
311
+ obj[child.tag] = child.value;
312
+ }
313
+ }
314
+ for (const [k, v] of Object.entries(attrs)) {
315
+ obj[k] = v;
316
+ }
317
+ Object.setPrototypeOf(obj, Object.prototype);
318
+ return { tag, value: obj };
319
+ }
320
+ static ENTITIES = {
321
+ amp: "&",
322
+ lt: "<",
323
+ gt: ">",
324
+ quot: '"',
325
+ apos: "'",
326
+ };
327
+ skipDoctype() {
328
+ const p = this;
329
+ p.i += 9;
330
+ let depth = 0;
331
+ while (p.i < p.z) {
332
+ const c = p.x[p.i];
333
+ if (c === "[") {
334
+ ++depth;
335
+ }
336
+ else if (c === "]") {
337
+ --depth;
338
+ }
339
+ else if (c === ">" && depth === 0) {
340
+ ++p.i;
341
+ return;
342
+ }
343
+ ++p.i;
344
+ }
345
+ throw new Error("@aws-sdk XML parse error: unclosed DOCTYPE.");
346
+ }
347
+ decodeEntities(s) {
348
+ return s.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g, (_, hex, dec, named) => {
349
+ if (hex) {
350
+ return String.fromCharCode(parseInt(hex, 16));
351
+ }
352
+ if (dec) {
353
+ return String.fromCharCode(parseInt(dec, 10));
354
+ }
355
+ return AwsXmlParser.ENTITIES[named] ?? "";
356
+ });
357
+ }
358
+ }
359
+
128
360
  exports.XmlNode = XmlNode;
129
361
  exports.XmlText = XmlText;
362
+ exports.parseXML = parseXML;
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aws-sdk/xml-builder",
3
- "version": "3.972.31",
3
+ "version": "3.972.33",
4
4
  "description": "XML utilities for the AWS SDK",
5
5
  "dependencies": {
6
- "@smithy/types": "^4.14.3",
6
+ "@smithy/types": "^4.15.1",
7
7
  "tslib": "^2.6.2"
8
8
  },
9
9
  "scripts": {
@@ -45,8 +45,7 @@
45
45
  "./dist-es/xml-parser": "./dist-es/xml-parser.browser"
46
46
  },
47
47
  "react-native": {
48
- "./dist-es/xml-parser": "./dist-es/xml-parser.browser",
49
- "./dist-cjs/xml-parser": "./dist-cjs/xml-parser.browser"
48
+ "./dist-es/xml-parser": "./dist-es/xml-parser.browser"
50
49
  },
51
50
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/xml-builder",
52
51
  "repository": {
@@ -97,6 +97,7 @@ export class Agent {
97
97
  beforeToolCall;
98
98
  afterToolCall;
99
99
  prepareNextTurn;
100
+ prepareNextTurnWithContext;
100
101
  activeRun;
101
102
  /** Session identifier forwarded to providers for cache-aware backends. */
102
103
  sessionId;
@@ -119,6 +120,7 @@ export class Agent {
119
120
  this.beforeToolCall = options.beforeToolCall;
120
121
  this.afterToolCall = options.afterToolCall;
121
122
  this.prepareNextTurn = options.prepareNextTurn;
123
+ this.prepareNextTurnWithContext = options.prepareNextTurnWithContext;
122
124
  this.steeringQueue = new PendingMessageQueue(options.steeringMode ?? "one-at-a-time");
123
125
  this.followUpQueue = new PendingMessageQueue(options.followUpMode ?? "one-at-a-time");
124
126
  this.sessionId = options.sessionId;
@@ -289,7 +291,14 @@ export class Agent {
289
291
  toolExecution: this.toolExecution,
290
292
  beforeToolCall: this.beforeToolCall,
291
293
  afterToolCall: this.afterToolCall,
292
- prepareNextTurn: this.prepareNextTurn ? async () => await this.prepareNextTurn?.(this.signal) : undefined,
294
+ prepareNextTurn: this.prepareNextTurnWithContext || this.prepareNextTurn
295
+ ? async (context) => {
296
+ if (this.prepareNextTurnWithContext) {
297
+ return await this.prepareNextTurnWithContext(context, this.signal);
298
+ }
299
+ return await this.prepareNextTurn?.(this.signal);
300
+ }
301
+ : undefined,
293
302
  convertToLlm: this.convertToLlm,
294
303
  transformContext: this.transformContext,
295
304
  getApiKey: this.getApiKey,
@@ -65,13 +65,16 @@ export function calculateContextTokens(usage) {
65
65
  function getAssistantUsage(msg) {
66
66
  if (msg.role === "assistant" && "usage" in msg) {
67
67
  const assistantMsg = msg;
68
- if (assistantMsg.stopReason !== "aborted" && assistantMsg.stopReason !== "error" && assistantMsg.usage) {
68
+ if (assistantMsg.stopReason !== "aborted" &&
69
+ assistantMsg.stopReason !== "error" &&
70
+ assistantMsg.usage &&
71
+ calculateContextTokens(assistantMsg.usage) > 0) {
69
72
  return assistantMsg.usage;
70
73
  }
71
74
  }
72
75
  return undefined;
73
76
  }
74
- /** Return usage from the last successful assistant message in session entries. */
77
+ /** Return usage from the last valid assistant message in session entries. */
75
78
  export function getLastAssistantUsage(entries) {
76
79
  for (let i = entries.length - 1; i >= 0; i--) {
77
80
  const entry = entries[i];
@@ -471,14 +474,12 @@ export async function compact(preparation, models, model, customInstructions, si
471
474
  }
472
475
  let summary;
473
476
  if (isSplitTurn && turnPrefixMessages.length > 0) {
474
- const [historyResult, turnPrefixResult] = await Promise.all([
475
- messagesToSummarize.length > 0
476
- ? generateSummary(messagesToSummarize, models, model, settings.reserveTokens, signal, customInstructions, previousSummary, thinkingLevel)
477
- : Promise.resolve(ok("No prior history.")),
478
- generateTurnPrefixSummary(turnPrefixMessages, models, model, settings.reserveTokens, signal, thinkingLevel),
479
- ]);
477
+ const historyResult = messagesToSummarize.length > 0
478
+ ? await generateSummary(messagesToSummarize, models, model, settings.reserveTokens, signal, customInstructions, previousSummary, thinkingLevel)
479
+ : ok("No prior history.");
480
480
  if (!historyResult.ok)
481
481
  return err(historyResult.error);
482
+ const turnPrefixResult = await generateTurnPrefixSummary(turnPrefixMessages, models, model, settings.reserveTokens, signal, thinkingLevel);
482
483
  if (!turnPrefixResult.ok)
483
484
  return err(turnPrefixResult.error);
484
485
  summary = `${historyResult.value}\n\n---\n\n**Turn Context (split turn):**\n\n${turnPrefixResult.value}`;
@@ -6,6 +6,20 @@ import { tmpdir } from "node:os";
6
6
  import { isAbsolute, join, resolve } from "node:path";
7
7
  import { createInterface } from "node:readline";
8
8
  import { ExecutionError, err, FileError, ok, toError, } from "../types.js";
9
+ const MAX_TIMEOUT_MS = 2_147_483_647;
10
+ const MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;
11
+ function resolveTimeoutMs(timeout) {
12
+ if (timeout === undefined)
13
+ return ok(undefined);
14
+ if (!Number.isFinite(timeout) || timeout <= 0) {
15
+ return err(new ExecutionError("timeout", "Invalid timeout: must be a finite number of seconds"));
16
+ }
17
+ const timeoutMs = timeout * 1000;
18
+ if (timeoutMs > MAX_TIMEOUT_MS) {
19
+ return err(new ExecutionError("timeout", `Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`));
20
+ }
21
+ return ok(timeoutMs);
22
+ }
9
23
  function resolvePath(cwd, path) {
10
24
  return isAbsolute(path) ? path : resolve(cwd, path);
11
25
  }
@@ -203,6 +217,10 @@ export class NodeExecutionEnv {
203
217
  async exec(command, options) {
204
218
  if (options?.abortSignal?.aborted)
205
219
  return err(new ExecutionError("aborted", "aborted"));
220
+ const timeoutMsResult = resolveTimeoutMs(options?.timeout);
221
+ if (!timeoutMsResult.ok)
222
+ return err(timeoutMsResult.error);
223
+ const timeoutMs = timeoutMsResult.value;
206
224
  const cwd = options?.cwd ? resolvePath(this.cwd, options.cwd) : this.cwd;
207
225
  const shellConfig = await getShellConfig(this.shellPath);
208
226
  if (!shellConfig.ok)
@@ -250,13 +268,13 @@ export class NodeExecutionEnv {
250
268
  return;
251
269
  }
252
270
  timeoutId =
253
- typeof options?.timeout === "number"
271
+ timeoutMs !== undefined
254
272
  ? setTimeout(() => {
255
273
  timedOut = true;
256
274
  if (child?.pid) {
257
275
  killProcessTree(child.pid);
258
276
  }
259
- }, options.timeout * 1000)
277
+ }, timeoutMs)
260
278
  : undefined;
261
279
  if (options?.abortSignal) {
262
280
  if (options.abortSignal.aborted) {
@@ -180,12 +180,13 @@ export class Session {
180
180
  });
181
181
  }
182
182
  async appendSessionName(name) {
183
+ const sanitizedName = name.replace(/[\r\n]+/g, " ").trim();
183
184
  return this.appendTypedEntry({
184
185
  type: "session_info",
185
186
  id: await this.storage.createEntryId(),
186
187
  parentId: await this.storage.getLeafId(),
187
188
  timestamp: new Date().toISOString(),
188
- name: name.trim(),
189
+ name: sanitizedName,
189
190
  });
190
191
  }
191
192
  async moveTo(entryId, summary) {
@@ -1,4 +1,4 @@
1
- import { ExecutionError, err, ok, toError, } from "../types.js";
1
+ import { ExecutionError, err, ok, toError } from "../types.js";
2
2
  import { DEFAULT_MAX_BYTES, truncateTail } from "./truncate.js";
3
3
  function toExecutionError(error) {
4
4
  if (error instanceof ExecutionError)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-agent-core",
3
- "version": "0.79.10",
3
+ "version": "0.80.3",
4
4
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "prepublishOnly": "npm run clean && npm run build"
30
30
  },
31
31
  "dependencies": {
32
- "@earendil-works/pi-ai": "^0.79.10",
32
+ "@earendil-works/pi-ai": "^0.80.3",
33
33
  "ignore": "7.0.5",
34
34
  "typebox": "1.1.38",
35
35
  "yaml": "2.9.0"
@@ -5,9 +5,8 @@ import { headersToRecord } from "../utils/headers.js";
5
5
  import { parseJsonWithRepair, parseStreamingJson } from "../utils/json-parse.js";
6
6
  import { getProviderEnvValue } from "../utils/provider-env.js";
7
7
  import { sanitizeSurrogates } from "../utils/sanitize-unicode.js";
8
- import { resolveCloudflareBaseUrl } from "./cloudflare.js";
9
8
  import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "./github-copilot-headers.js";
10
- import { adjustMaxTokensForThinking, buildBaseOptions } from "./simple-options.js";
9
+ import { adjustMaxTokensForThinking, buildBaseOptions, clampMaxTokensToContext } from "./simple-options.js";
11
10
  import { transformMessages } from "./transform-messages.js";
12
11
  /**
13
12
  * Resolve cache retention preference.
@@ -108,14 +107,11 @@ function convertContentBlocks(content) {
108
107
  const FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14";
109
108
  const INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
110
109
  function getAnthropicCompat(model) {
111
- // Auto-detect session affinity and cache control support from provider
112
- const isFireworks = model.provider === "fireworks";
113
- const isCloudflareAiGatewayAnthropic = model.provider === "cloudflare-ai-gateway" && model.baseUrl.includes("anthropic");
114
110
  return {
115
- supportsEagerToolInputStreaming: model.compat?.supportsEagerToolInputStreaming ?? !isFireworks,
116
- supportsLongCacheRetention: model.compat?.supportsLongCacheRetention ?? !isFireworks,
117
- sendSessionAffinityHeaders: model.compat?.sendSessionAffinityHeaders ?? !!(isFireworks || isCloudflareAiGatewayAnthropic),
118
- supportsCacheControlOnTools: model.compat?.supportsCacheControlOnTools ?? !isFireworks,
111
+ supportsEagerToolInputStreaming: model.compat?.supportsEagerToolInputStreaming ?? true,
112
+ supportsLongCacheRetention: model.compat?.supportsLongCacheRetention ?? true,
113
+ sendSessionAffinityHeaders: model.compat?.sendSessionAffinityHeaders ?? false,
114
+ supportsCacheControlOnTools: model.compat?.supportsCacheControlOnTools ?? true,
119
115
  supportsTemperature: model.compat?.supportsTemperature ?? true,
120
116
  allowEmptySignature: model.compat?.allowEmptySignature ?? false,
121
117
  };
@@ -129,6 +125,26 @@ function mergeHeaders(...headerSources) {
129
125
  }
130
126
  return merged;
131
127
  }
128
+ function hasHeader(headers, name) {
129
+ if (!headers)
130
+ return false;
131
+ const expected = name.toLowerCase();
132
+ for (const [key, value] of Object.entries(headers)) {
133
+ if (key.toLowerCase() === expected && value !== null && value.trim().length > 0)
134
+ return true;
135
+ }
136
+ return false;
137
+ }
138
+ function assertRequestAuth(provider, apiKey, headers) {
139
+ if (apiKey)
140
+ return;
141
+ if (hasHeader(headers, "authorization") ||
142
+ hasHeader(headers, "x-api-key") ||
143
+ hasHeader(headers, "cf-aig-authorization")) {
144
+ return;
145
+ }
146
+ throw new Error(`No API key for provider: ${provider}`);
147
+ }
132
148
  const ANTHROPIC_MESSAGE_EVENTS = new Set([
133
149
  "message_start",
134
150
  "message_delta",
@@ -309,9 +325,7 @@ export const stream = (model, context, options) => {
309
325
  }
310
326
  else {
311
327
  const apiKey = options?.apiKey;
312
- if (!apiKey) {
313
- throw new Error(`No API key for provider: ${model.provider}`);
314
- }
328
+ assertRequestAuth(model.provider, apiKey, options?.headers);
315
329
  let copilotDynamicHeaders;
316
330
  if (model.provider === "github-copilot") {
317
331
  const hasImages = hasCopilotVisionInput(context.messages);
@@ -322,7 +336,7 @@ export const stream = (model, context, options) => {
322
336
  }
323
337
  const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env);
324
338
  const cacheSessionId = cacheRetention === "none" ? undefined : options?.sessionId;
325
- const created = createClient(model, apiKey, options?.interleavedThinking ?? true, shouldUseFineGrainedToolStreamingBeta(model, context), options?.headers, copilotDynamicHeaders, cacheSessionId, options?.env);
339
+ const created = createClient(model, apiKey, options?.interleavedThinking ?? true, shouldUseFineGrainedToolStreamingBeta(model, context), options?.headers, copilotDynamicHeaders, cacheSessionId);
326
340
  client = created.client;
327
341
  isOAuth = created.isOAuthToken;
328
342
  }
@@ -508,6 +522,14 @@ export const stream = (model, context, options) => {
508
522
  if (event.usage.cache_creation_input_tokens != null) {
509
523
  output.usage.cacheWrite = event.usage.cache_creation_input_tokens;
510
524
  }
525
+ // Anthropic reports reasoning tokens in `output_tokens_details.thinking_tokens` on the
526
+ // final message_delta usage (a subset of output_tokens). SDK 0.91.1 omits the field from
527
+ // its Usage type, so read it through a narrow cast. Verified against the live API.
528
+ const thinkingTokens = event.usage
529
+ .output_tokens_details?.thinking_tokens;
530
+ if (thinkingTokens != null) {
531
+ output.usage.reasoning = thinkingTokens;
532
+ }
511
533
  // Anthropic doesn't provide total_tokens, compute from components
512
534
  output.usage.totalTokens =
513
535
  output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
@@ -558,11 +580,8 @@ function mapThinkingLevelToEffort(model, level) {
558
580
  }
559
581
  }
560
582
  export const streamSimple = (model, context, options) => {
561
- const apiKey = options?.apiKey;
562
- if (!apiKey) {
563
- throw new Error(`No API key for provider: ${model.provider}`);
564
- }
565
- const base = buildBaseOptions(model, options, apiKey);
583
+ assertRequestAuth(model.provider, options?.apiKey, options?.headers);
584
+ const base = buildBaseOptions(model, context, options, options?.apiKey);
566
585
  if (!options?.reasoning) {
567
586
  return stream(model, context, { ...base, thinkingEnabled: false });
568
587
  }
@@ -579,17 +598,18 @@ export const streamSimple = (model, context, options) => {
579
598
  // Undefined means the caller did not request an output cap; let the helper use the model cap.
580
599
  // Do not coerce to 0 here, or the thinking budget would become the entire max_tokens value.
581
600
  const adjusted = adjustMaxTokensForThinking(base.maxTokens, model.maxTokens, options.reasoning, options.thinkingBudgets);
601
+ const maxTokens = clampMaxTokensToContext(model, context, adjusted.maxTokens);
582
602
  return stream(model, context, {
583
603
  ...base,
584
- maxTokens: adjusted.maxTokens,
604
+ maxTokens,
585
605
  thinkingEnabled: true,
586
- thinkingBudgetTokens: adjusted.thinkingBudget,
606
+ thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024)),
587
607
  });
588
608
  };
589
609
  function isOAuthToken(apiKey) {
590
610
  return apiKey.includes("sk-ant-oat");
591
611
  }
592
- function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStreamingBeta, optionsHeaders, dynamicHeaders, sessionId, env) {
612
+ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStreamingBeta, optionsHeaders, dynamicHeaders, sessionId) {
593
613
  // Adaptive thinking models have interleaved thinking built in, so skip the beta header.
594
614
  const needsInterleavedBeta = interleavedThinking && model.compat?.forceAdaptiveThinking !== true;
595
615
  const betaFeatures = [];
@@ -599,28 +619,11 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
599
619
  if (needsInterleavedBeta) {
600
620
  betaFeatures.push(INTERLEAVED_THINKING_BETA);
601
621
  }
602
- if (model.provider === "cloudflare-ai-gateway") {
603
- const client = new Anthropic({
604
- apiKey: null,
605
- authToken: null,
606
- baseURL: resolveCloudflareBaseUrl(model, env),
607
- dangerouslyAllowBrowser: true,
608
- defaultHeaders: mergeHeaders({
609
- accept: "application/json",
610
- "anthropic-dangerous-direct-browser-access": "true",
611
- "cf-aig-authorization": `Bearer ${apiKey}`,
612
- "x-api-key": null,
613
- Authorization: null,
614
- ...(betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}),
615
- }, model.headers, optionsHeaders),
616
- });
617
- return { client, isOAuthToken: false };
618
- }
619
622
  // Copilot: Bearer auth, selective betas.
620
623
  if (model.provider === "github-copilot") {
621
624
  const client = new Anthropic({
622
625
  apiKey: null,
623
- authToken: apiKey,
626
+ authToken: apiKey ?? null,
624
627
  baseURL: model.baseUrl,
625
628
  dangerouslyAllowBrowser: true,
626
629
  defaultHeaders: mergeHeaders({
@@ -632,7 +635,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
632
635
  return { client, isOAuthToken: false };
633
636
  }
634
637
  // OAuth: Bearer auth, Claude Code identity headers
635
- if (isOAuthToken(apiKey)) {
638
+ if (apiKey && isOAuthToken(apiKey)) {
636
639
  const client = new Anthropic({
637
640
  apiKey: null,
638
641
  authToken: apiKey,
@@ -648,18 +651,19 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
648
651
  });
649
652
  return { client, isOAuthToken: true };
650
653
  }
651
- // API key auth
654
+ // API key or header-owned auth.
652
655
  const sessionAffinityHeaders = sessionId && getAnthropicCompat(model).sendSessionAffinityHeaders ? { "x-session-affinity": sessionId } : {};
656
+ const defaultHeaders = mergeHeaders({
657
+ accept: "application/json",
658
+ "anthropic-dangerous-direct-browser-access": "true",
659
+ ...(betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}),
660
+ }, sessionAffinityHeaders, model.headers, optionsHeaders);
653
661
  const client = new Anthropic({
654
- apiKey,
662
+ apiKey: apiKey ?? null,
655
663
  authToken: null,
656
664
  baseURL: model.baseUrl,
657
665
  dangerouslyAllowBrowser: true,
658
- defaultHeaders: mergeHeaders({
659
- accept: "application/json",
660
- "anthropic-dangerous-direct-browser-access": "true",
661
- ...(betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}),
662
- }, sessionAffinityHeaders, model.headers, optionsHeaders),
666
+ defaultHeaders,
663
667
  });
664
668
  return { client, isOAuthToken: false };
665
669
  }