@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
@@ -974,6 +974,8 @@ declare module "node:util" {
974
974
  * `reason`.
975
975
  *
976
976
  * ```js
977
+ * import util from 'node:util';
978
+ *
977
979
  * function fn() {
978
980
  * return Promise.reject(null);
979
981
  * }
@@ -1246,13 +1248,28 @@ declare module "node:util" {
1246
1248
  *
1247
1249
  * The special format value `none` applies no additional styling to the text.
1248
1250
  *
1251
+ * In addition to predefined color names, `util.styleText()` supports hex color
1252
+ * strings using ANSI TrueColor (24-bit) escape sequences. Hex colors can be
1253
+ * specified in either 3-digit (`#RGB`) or 6-digit (`#RRGGBB`) format:
1254
+ *
1255
+ * ```js
1256
+ * import { styleText } from 'node:util';
1257
+ *
1258
+ * // 6-digit hex color
1259
+ * console.log(styleText('#ff5733', 'Orange text'));
1260
+ *
1261
+ * // 3-digit hex color (shorthand)
1262
+ * console.log(styleText('#f00', 'Red text'));
1263
+ * ```
1264
+ *
1249
1265
  * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v26.x/api/util.html#modifiers).
1250
- * @param format A text format or an Array of text formats defined in `util.inspect.colors`.
1266
+ * @param format A text format or an Array of text formats defined in `util.inspect.colors`, or a hex color in `#RGB`
1267
+ * or `#RRGGBB` form.
1251
1268
  * @param text The text to to be formatted.
1252
1269
  * @since v20.12.0
1253
1270
  */
1254
1271
  export function styleText(
1255
- format: InspectColor | readonly InspectColor[],
1272
+ format: InspectColor | readonly InspectColor[] | `#${string}`,
1256
1273
  text: string,
1257
1274
  options?: StyleTextOptions,
1258
1275
  ): string;
@@ -412,6 +412,21 @@ declare module "node:v8" {
412
412
  */
413
413
  [Symbol.dispose](): void;
414
414
  }
415
+ /**
416
+ * @since v26.1.0
417
+ */
418
+ interface SyncHeapProfileHandle {
419
+ /**
420
+ * Stopping collecting the profile and return the profile data.
421
+ * @since v26.1.0
422
+ */
423
+ stop(): string;
424
+ /**
425
+ * Stopping collecting the profile and the profile will be discarded.
426
+ * @since v26.1.0
427
+ */
428
+ [Symbol.dispose](): void;
429
+ }
415
430
  /**
416
431
  * @since v24.8.0
417
432
  */
@@ -444,18 +459,85 @@ declare module "node:v8" {
444
459
  */
445
460
  [Symbol.asyncDispose](): Promise<void>;
446
461
  }
462
+ interface CPUProfileOptions {
463
+ /**
464
+ * Requested sampling interval in milliseconds. **Default:** `0`.
465
+ */
466
+ sampleInterval?: number | undefined;
467
+ /**
468
+ * Maximum number of samples to keep before older
469
+ * entries are discarded. **Default:** `4294967295`.
470
+ */
471
+ maxBufferSize?: number | undefined;
472
+ }
447
473
  /**
448
474
  * Starting a CPU profile then return a `SyncCPUProfileHandle` object.
449
475
  * This API supports `using` syntax.
450
476
  *
451
477
  * ```js
452
- * const handle = v8.startCpuProfile();
478
+ * const handle = v8.startCpuProfile({ sampleInterval: 1, maxBufferSize: 10_000 });
453
479
  * const profile = handle.stop();
454
480
  * console.log(profile);
455
481
  * ```
456
482
  * @since v25.0.0
457
483
  */
458
- function startCpuProfile(): SyncCPUProfileHandle;
484
+ function startCpuProfile(options?: CPUProfileOptions): SyncCPUProfileHandle;
485
+ interface HeapProfileOptions {
486
+ /**
487
+ * The average sampling interval in bytes.
488
+ * **Default:** `524288` (512 KiB).
489
+ */
490
+ sampleInterval?: number | undefined;
491
+ /**
492
+ * The maximum stack depth for samples.
493
+ * **Default:** `16`.
494
+ */
495
+ stackDepth?: number | undefined;
496
+ /**
497
+ * Force garbage collection before taking the profile.
498
+ * **Default:** `false`.
499
+ */
500
+ forceGC?: boolean | undefined;
501
+ /**
502
+ * Include objects collected
503
+ * by major GC. **Default:** `false`.
504
+ */
505
+ includeObjectsCollectedByMajorGC?: boolean | undefined;
506
+ /**
507
+ * Include objects collected
508
+ * by minor GC. **Default:** `false`.
509
+ */
510
+ includeObjectsCollectedByMinorGC?: boolean | undefined;
511
+ }
512
+ /**
513
+ * Starting a heap profile then return a `SyncHeapProfileHandle` object.
514
+ * This API supports `using` syntax.
515
+ *
516
+ * ```js
517
+ * import v8 from 'node:v8';
518
+ *
519
+ * const handle = v8.startHeapProfile();
520
+ * const profile = handle.stop();
521
+ * console.log(profile);
522
+ * ```
523
+ *
524
+ * With custom parameters:
525
+ *
526
+ * ```js
527
+ * import v8 from 'node:v8';
528
+ *
529
+ * const handle = v8.startHeapProfile({
530
+ * sampleInterval: 1024,
531
+ * stackDepth: 8,
532
+ * forceGC: true,
533
+ * includeObjectsCollectedByMajorGC: true,
534
+ * });
535
+ * const profile = handle.stop();
536
+ * console.log(profile);
537
+ * ```
538
+ * @since v26.1.0
539
+ */
540
+ function startHeapProfile(options?: HeapProfileOptions): SyncHeapProfileHandle;
459
541
  /**
460
542
  * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
461
543
  * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
@@ -10,7 +10,7 @@ declare module "node:worker_threads" {
10
10
  import { Readable, Writable } from "node:stream";
11
11
  import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
12
12
  import { URL } from "node:url";
13
- import { CPUProfileHandle, HeapInfo, HeapProfileHandle } from "node:v8";
13
+ import { CPUProfileHandle, CPUProfileOptions, HeapInfo, HeapProfileHandle, HeapProfileOptions } from "node:v8";
14
14
  import { Context } from "node:vm";
15
15
  import { MessageEvent } from "undici-types";
16
16
  const isInternalThread: boolean;
@@ -259,7 +259,7 @@ declare module "node:worker_threads" {
259
259
  * `, { eval: true });
260
260
  *
261
261
  * worker.on('online', async () => {
262
- * const handle = await worker.startCpuProfile();
262
+ * const handle = await worker.startCpuProfile({ sampleInterval: 1 });
263
263
  * const profile = await handle.stop();
264
264
  * console.log(profile);
265
265
  * worker.terminate();
@@ -283,16 +283,16 @@ declare module "node:worker_threads" {
283
283
  * ```
284
284
  * @since v24.8.0
285
285
  */
286
- startCpuProfile(): Promise<CPUProfileHandle>;
286
+ startCpuProfile(options?: CPUProfileOptions): Promise<CPUProfileHandle>;
287
287
  /**
288
288
  * Starting a Heap profile then return a Promise that fulfills with an error
289
289
  * or an `HeapProfileHandle` object. This API supports `await using` syntax.
290
290
  *
291
291
  * ```js
292
- * const { Worker } = require('node:worker_threads');
292
+ * import { Worker } from 'node:worker_threads';
293
293
  *
294
294
  * const worker = new Worker(`
295
- * const { parentPort } = require('worker_threads');
295
+ * const { parentPort } = require('node:worker_threads');
296
296
  * parentPort.on('message', () => {});
297
297
  * `, { eval: true });
298
298
  *
@@ -307,7 +307,7 @@ declare module "node:worker_threads" {
307
307
  * `await using` example.
308
308
  *
309
309
  * ```js
310
- * const { Worker } = require('node:worker_threads');
310
+ * import { Worker } from 'node:worker_threads';
311
311
  *
312
312
  * const w = new Worker(`
313
313
  * const { parentPort } = require('node:worker_threads');
@@ -319,8 +319,9 @@ declare module "node:worker_threads" {
319
319
  * await using handle = await w.startHeapProfile();
320
320
  * });
321
321
  * ```
322
+ * @since v24.9.0
322
323
  */
323
- startHeapProfile(): Promise<HeapProfileHandle>;
324
+ startHeapProfile(options?: HeapProfileOptions): Promise<HeapProfileHandle>;
324
325
  /**
325
326
  * Calls `worker.terminate()` when the dispose scope is exited.
326
327
  *
@@ -95,19 +95,23 @@ function gte(i, y) {
95
95
  function expand_(str, max, isTop) {
96
96
  /** @type {string[]} */
97
97
  const expansions = [];
98
- const m = (0, balanced_match_1.balanced)('{', '}', str);
99
- if (!m)
100
- return [str];
101
- // no need to expand pre, since it is guaranteed to be free of brace-sets
102
- const pre = m.pre;
103
- const post = m.post.length ? expand_(m.post, max, false) : [''];
104
- if (/\$$/.test(m.pre)) {
105
- for (let k = 0; k < post.length && k < max; k++) {
106
- const expansion = pre + '{' + m.body + '}' + post[k];
107
- expansions.push(expansion);
98
+ // The `{a},b}` rewrite below restarts expansion on a rewritten string with
99
+ // the same `max` and `isTop = true`. Loop instead of recursing so a long run
100
+ // of non-expanding `{}` groups can't exhaust the call stack.
101
+ for (;;) {
102
+ const m = (0, balanced_match_1.balanced)('{', '}', str);
103
+ if (!m)
104
+ return [str];
105
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
106
+ const pre = m.pre;
107
+ if (/\$$/.test(m.pre)) {
108
+ const post = m.post.length ? expand_(m.post, max, false) : [''];
109
+ for (let k = 0; k < post.length && k < max; k++) {
110
+ const expansion = pre + '{' + m.body + '}' + post[k];
111
+ expansions.push(expansion);
112
+ }
113
+ return expansions;
108
114
  }
109
- }
110
- else {
111
115
  const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
112
116
  const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
113
117
  const isSequence = isNumericSequence || isAlphaSequence;
@@ -116,10 +120,16 @@ function expand_(str, max, isTop) {
116
120
  // {a},b}
117
121
  if (m.post.match(/,(?!,).*\}/)) {
118
122
  str = m.pre + '{' + m.body + escClose + m.post;
119
- return expand_(str, max, true);
123
+ isTop = true;
124
+ continue;
120
125
  }
121
126
  return [str];
122
127
  }
128
+ // Only expand post once we know this brace set actually expands. Computing
129
+ // it before the early returns above expanded post a second time on every
130
+ // non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up
131
+ // exponentially.
132
+ const post = m.post.length ? expand_(m.post, max, false) : [''];
123
133
  let n;
124
134
  if (isSequence) {
125
135
  n = m.body.split(/\.\./);
@@ -195,7 +205,7 @@ function expand_(str, max, isTop) {
195
205
  }
196
206
  }
197
207
  }
208
+ return expansions;
198
209
  }
199
- return expansions;
200
210
  }
201
211
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js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AC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n const post: string[] = m.post.length ? expand_(m.post, max, false) : ['']\n\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n } else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n return expand_(str, max, true)\n }\n return [str]\n }\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n }\n\n return expansions\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA8EA,wB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C,EAAE,EAAE,CAAC;YAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n // The `{a},b}` rewrite below restarts expansion on a rewritten string with\n // the same `max` and `isTop = true`. Loop instead of recursing so a long run\n // of non-expanding `{}` groups can't exhaust the call stack.\n for (;;) {\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(m.pre)) {\n const post: string[] =\n m.post.length ? expand_(m.post, max, false) : ['']\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n return expansions\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n return [str]\n }\n\n // Only expand post once we know this brace set actually expands. Computing\n // it before the early returns above expanded post a second time on every\n // non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up\n // exponentially.\n const post: string[] =\n m.post.length ? expand_(m.post, max, false) : ['']\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n\n return expansions\n }\n}\n"]}
@@ -91,19 +91,23 @@ function gte(i, y) {
91
91
  function expand_(str, max, isTop) {
92
92
  /** @type {string[]} */
93
93
  const expansions = [];
94
- const m = balanced('{', '}', str);
95
- if (!m)
96
- return [str];
97
- // no need to expand pre, since it is guaranteed to be free of brace-sets
98
- const pre = m.pre;
99
- const post = m.post.length ? expand_(m.post, max, false) : [''];
100
- if (/\$$/.test(m.pre)) {
101
- for (let k = 0; k < post.length && k < max; k++) {
102
- const expansion = pre + '{' + m.body + '}' + post[k];
103
- expansions.push(expansion);
94
+ // The `{a},b}` rewrite below restarts expansion on a rewritten string with
95
+ // the same `max` and `isTop = true`. Loop instead of recursing so a long run
96
+ // of non-expanding `{}` groups can't exhaust the call stack.
97
+ for (;;) {
98
+ const m = balanced('{', '}', str);
99
+ if (!m)
100
+ return [str];
101
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
102
+ const pre = m.pre;
103
+ if (/\$$/.test(m.pre)) {
104
+ const post = m.post.length ? expand_(m.post, max, false) : [''];
105
+ for (let k = 0; k < post.length && k < max; k++) {
106
+ const expansion = pre + '{' + m.body + '}' + post[k];
107
+ expansions.push(expansion);
108
+ }
109
+ return expansions;
104
110
  }
105
- }
106
- else {
107
111
  const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
108
112
  const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
109
113
  const isSequence = isNumericSequence || isAlphaSequence;
@@ -112,10 +116,16 @@ function expand_(str, max, isTop) {
112
116
  // {a},b}
113
117
  if (m.post.match(/,(?!,).*\}/)) {
114
118
  str = m.pre + '{' + m.body + escClose + m.post;
115
- return expand_(str, max, true);
119
+ isTop = true;
120
+ continue;
116
121
  }
117
122
  return [str];
118
123
  }
124
+ // Only expand post once we know this brace set actually expands. Computing
125
+ // it before the early returns above expanded post a second time on every
126
+ // non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up
127
+ // exponentially.
128
+ const post = m.post.length ? expand_(m.post, max, false) : [''];
119
129
  let n;
120
130
  if (isSequence) {
121
131
  n = m.body.split(/\.\./);
@@ -191,7 +201,7 @@ function expand_(str, max, isTop) {
191
201
  }
192
202
  }
193
203
  }
204
+ return expansions;
194
205
  }
195
- return expansions;
196
206
  }
197
207
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAA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AC;gBACD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACX,CAAC;QACH,CAAC;aAAM,CAAC;YACN,CAAC,GAAG,EAAE,CAAA;YAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;YACtD,CAAC;QACH,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n const post: string[] = m.post.length ? expand_(m.post, max, false) : ['']\n\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n } else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n return expand_(str, max, true)\n }\n return [str]\n }\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n }\n\n return expansions\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MA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= '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n // The `{a},b}` rewrite below restarts expansion on a rewritten string with\n // the same `max` and `isTop = true`. Loop instead of recursing so a long run\n // of non-expanding `{}` groups can't exhaust the call stack.\n for (;;) {\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(m.pre)) {\n const post: string[] =\n m.post.length ? expand_(m.post, max, false) : ['']\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n return expansions\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n return [str]\n }\n\n // Only expand post once we know this brace set actually expands. Computing\n // it before the early returns above expanded post a second time on every\n // non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up\n // exponentially.\n const post: string[] =\n m.post.length ? expand_(m.post, max, false) : ['']\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n\n return expansions\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "brace-expansion",
3
3
  "description": "Brace expansion as known from sh/bash",
4
- "version": "5.0.6",
4
+ "version": "5.0.7",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
@@ -59,6 +59,6 @@
59
59
  "module": "./dist/esm/index.js",
60
60
  "repository": {
61
61
  "type": "git",
62
- "url": "git+ssh://git@github.com/juliangruber/brace-expansion.git"
62
+ "url": "git+https://github.com/juliangruber/brace-expansion.git"
63
63
  }
64
64
  }
@@ -749,7 +749,7 @@ class GoogleAuth {
749
749
  const endpoint = opts.apiEndpoint || opts.servicePath;
750
750
  if (endpoint) {
751
751
  const scheme = endpoint.startsWith('http') ? '' : 'https://';
752
- const formattedAudience = `${scheme}${endpoint}/`.replace(/\/+$/, '/');
752
+ const formattedAudience = `${scheme}${endpoint}`.replace(/\/+$/, '');
753
753
  const newClient = client.createWithGdchAudience(formattedAudience);
754
754
  this.cachedCredential = newClient;
755
755
  return newClient;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-auth-library",
3
- "version": "10.7.0",
3
+ "version": "10.9.0",
4
4
  "author": "Google Inc.",
5
5
  "description": "Google APIs Authentication Client Library for Node.js",
6
6
  "engines": {
@@ -10,8 +10,8 @@
10
10
  "types": "./build/src/index.d.ts",
11
11
  "repository": {
12
12
  "type": "git",
13
- "directory": "packages/google-auth-library-nodejs",
14
- "url": "https://github.com/googleapis/google-cloud-node-core.git"
13
+ "directory": "core/packages/google-auth-library-nodejs",
14
+ "url": "https://github.com/googleapis/google-cloud-node.git"
15
15
  },
16
16
  "keywords": [
17
17
  "google",
@@ -86,5 +86,5 @@
86
86
  "prelint": "cd samples; npm link ../; npm install"
87
87
  },
88
88
  "license": "Apache-2.0",
89
- "homepage": "https://github.com/googleapis/google-cloud-node-core/tree/main/packages/google-auth-library-nodejs"
89
+ "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/core/packages/google-auth-library-nodejs"
90
90
  }
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.6.4 (c) 2016, daniel wirtz
3
- * compiled fri, 12 jun 2026 12:10:46 utc
2
+ * protobuf.js v7.6.5 (c) 2016, daniel wirtz
3
+ * compiled sat, 04 jul 2026 01:13:07 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.6.4 (c) 2016, daniel wirtz
3
- * compiled fri, 12 jun 2026 12:10:47 utc
2
+ * protobuf.js v7.6.5 (c) 2016, daniel wirtz
3
+ * compiled sat, 04 jul 2026 01:13:07 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.6.4 (c) 2016, daniel wirtz
3
- * compiled fri, 12 jun 2026 12:10:46 utc
2
+ * protobuf.js v7.6.5 (c) 2016, daniel wirtz
3
+ * compiled sat, 04 jul 2026 01:13:07 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.6.4 (c) 2016, daniel wirtz
3
- * compiled fri, 12 jun 2026 12:10:47 utc
2
+ * protobuf.js v7.6.5 (c) 2016, daniel wirtz
3
+ * compiled sat, 04 jul 2026 01:13:07 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.6.4 (c) 2016, daniel wirtz
3
- * compiled fri, 12 jun 2026 12:10:46 utc
2
+ * protobuf.js v7.6.5 (c) 2016, daniel wirtz
3
+ * compiled sat, 04 jul 2026 01:13:07 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -5211,6 +5211,9 @@ function parse(source, root, options) {
5211
5211
  }
5212
5212
 
5213
5213
  while (token !== "=") {
5214
+ if (token === null) {
5215
+ throw illegal(token, "end of input");
5216
+ }
5214
5217
  if (token === "(") {
5215
5218
  var parensValue = next();
5216
5219
  skip(")");