@psnext/slingcli 3.5.20261026-1 → 3.6.20261105-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 (476) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +38 -13
  2. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +7 -7
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
  4. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
  5. package/node_modules/@aws-sdk/core/dist-es/submodules/client/getDefaultSocketTimeout.js +10 -0
  6. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.browser.js +1 -0
  7. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +1 -0
  8. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.native.js +1 -0
  9. package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
  10. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +1 -4
  14. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
  16. package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
  17. package/node_modules/@aws-sdk/core/dist-types/submodules/client/getDefaultSocketTimeout.d.ts +11 -0
  18. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.browser.d.ts +1 -0
  19. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +1 -0
  20. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.native.d.ts +1 -0
  21. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +3 -7
  22. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +1 -0
  23. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
  24. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/getDefaultSocketTimeout.d.ts +4 -0
  25. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +1 -0
  26. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -0
  27. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +1 -0
  28. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  29. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
  30. package/node_modules/@aws-sdk/core/package.json +4 -4
  31. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  32. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  33. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/README.md +9 -0
  34. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +914 -0
  35. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  36. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  37. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +13 -0
  38. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +51 -0
  39. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  40. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +263 -0
  41. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +135 -0
  42. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +46 -0
  43. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +204 -0
  44. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  45. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  46. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/resolve-default-socket-timeout.js +4 -0
  47. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  48. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  49. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  50. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +38 -0
  51. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  52. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  53. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  54. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  55. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  56. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +46 -0
  57. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  58. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
  59. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +46 -0
  60. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +36 -0
  61. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +76 -0
  62. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  63. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  64. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/resolve-default-socket-timeout.d.ts +4 -0
  65. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  66. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  67. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  68. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +11 -0
  69. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +9 -0
  70. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  71. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  72. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  73. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/http2/ClientHttp2SessionRef.d.ts +46 -0
  74. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  75. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +47 -0
  76. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +46 -0
  77. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +36 -0
  78. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +76 -0
  79. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2.d.ts +2 -0
  80. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-https.d.ts +2 -0
  81. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/resolve-default-socket-timeout.d.ts +4 -0
  82. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  83. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  84. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  85. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +11 -0
  86. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +9 -0
  87. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  88. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  89. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +56 -0
  90. package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
  91. package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -10
  92. package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
  93. package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
  94. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  95. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +4 -4
  96. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  97. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  98. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
  99. package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +4 -2
  100. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js +2 -1
  101. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js +2 -1
  102. package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
  103. package/node_modules/@aws-sdk/middleware-websocket/package.json +4 -4
  104. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +3 -2
  105. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +10 -2
  106. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +3 -2
  107. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +3 -2
  108. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +3 -2
  109. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +2 -1
  110. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +7 -0
  111. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +2 -1
  112. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +2 -1
  113. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +2 -1
  114. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +2 -1
  115. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +1 -0
  116. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +1 -2
  117. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +1 -2
  118. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +5 -59
  119. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenWithIAMCommand.d.ts +5 -33
  120. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -2
  121. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +16 -9
  122. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +8 -39
  123. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/models_0.d.ts +36 -48
  124. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +1 -0
  125. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +1 -0
  126. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +1 -0
  127. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +1 -0
  128. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +1 -0
  129. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +7 -0
  130. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +1 -0
  131. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +1 -0
  132. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +1 -0
  133. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +1 -0
  134. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  135. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/README.md +9 -0
  136. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +914 -0
  137. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  138. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  139. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +13 -0
  140. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +51 -0
  141. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  142. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +263 -0
  143. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +135 -0
  144. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +46 -0
  145. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +204 -0
  146. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  147. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  148. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/resolve-default-socket-timeout.js +4 -0
  149. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  150. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  151. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  152. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +38 -0
  153. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  154. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  155. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  156. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  157. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  158. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +46 -0
  159. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  160. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
  161. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +46 -0
  162. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +36 -0
  163. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +76 -0
  164. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  165. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  166. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/resolve-default-socket-timeout.d.ts +4 -0
  167. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  168. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  169. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  170. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +11 -0
  171. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +9 -0
  172. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  173. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  174. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  175. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/http2/ClientHttp2SessionRef.d.ts +46 -0
  176. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  177. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +47 -0
  178. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +46 -0
  179. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +36 -0
  180. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +76 -0
  181. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2.d.ts +2 -0
  182. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-https.d.ts +2 -0
  183. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/resolve-default-socket-timeout.d.ts +4 -0
  184. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  185. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  186. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  187. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +11 -0
  188. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +9 -0
  189. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  190. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  191. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +56 -0
  192. package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
  193. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  194. package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
  195. package/node_modules/@babel/runtime/helpers/asyncIterator.js +1 -1
  196. package/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +1 -1
  197. package/node_modules/@babel/runtime/package.json +1 -1
  198. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/LICENSE +15 -0
  199. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/bin/semver.js +195 -0
  200. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/classes/comparator.js +143 -0
  201. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/classes/index.js +7 -0
  202. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/classes/range.js +577 -0
  203. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/classes/semver.js +350 -0
  204. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/clean.js +8 -0
  205. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/cmp.js +54 -0
  206. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/coerce.js +62 -0
  207. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/compare-build.js +9 -0
  208. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/compare-loose.js +5 -0
  209. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/compare.js +7 -0
  210. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/diff.js +60 -0
  211. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/eq.js +5 -0
  212. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/gt.js +5 -0
  213. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/gte.js +5 -0
  214. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/inc.js +21 -0
  215. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/lt.js +5 -0
  216. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/lte.js +5 -0
  217. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/major.js +5 -0
  218. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/minor.js +5 -0
  219. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/neq.js +5 -0
  220. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/parse.js +18 -0
  221. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/patch.js +5 -0
  222. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/prerelease.js +8 -0
  223. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/rcompare.js +5 -0
  224. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/rsort.js +5 -0
  225. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/satisfies.js +12 -0
  226. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/sort.js +5 -0
  227. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/truncate.js +48 -0
  228. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/functions/valid.js +8 -0
  229. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/index.js +93 -0
  230. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/internal/constants.js +37 -0
  231. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/internal/debug.js +11 -0
  232. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/internal/identifiers.js +29 -0
  233. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/internal/lrucache.js +42 -0
  234. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/internal/parse-options.js +17 -0
  235. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/internal/re.js +223 -0
  236. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/package.json +78 -0
  237. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/preload.js +4 -0
  238. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/range.bnf +17 -0
  239. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/gtr.js +6 -0
  240. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/intersects.js +9 -0
  241. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/ltr.js +6 -0
  242. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/max-satisfying.js +27 -0
  243. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/min-satisfying.js +26 -0
  244. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/min-version.js +63 -0
  245. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/outside.js +82 -0
  246. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/simplify.js +49 -0
  247. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/subset.js +249 -0
  248. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/to-comparators.js +10 -0
  249. package/node_modules/@earendil-works/pi-coding-agent/node_modules/semver/ranges/valid.js +13 -0
  250. package/node_modules/@hono/node-server/dist/index.cjs +31 -6
  251. package/node_modules/@hono/node-server/dist/index.mjs +31 -6
  252. package/node_modules/@hono/node-server/package.json +1 -1
  253. package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
  254. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +45 -53
  255. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +37 -17
  256. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
  257. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
  258. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
  259. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  260. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
  261. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +18 -9
  262. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +18 -9
  263. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +86 -53
  264. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +53 -15
  265. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +57 -17
  266. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
  267. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
  268. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
  269. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
  270. package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  271. package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
  272. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +12 -37
  273. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
  274. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
  275. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
  276. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
  277. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
  278. package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
  279. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +1 -0
  280. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
  281. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
  282. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
  283. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
  284. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
  285. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js +10 -4
  286. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
  287. package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
  288. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
  289. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
  290. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
  291. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
  292. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
  293. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +2 -1
  294. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
  295. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
  296. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
  297. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
  298. package/node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js +35 -0
  299. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
  300. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
  301. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +6 -2
  302. package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +1 -0
  303. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +8 -31
  304. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
  305. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
  306. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
  307. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +6 -3
  308. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
  309. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
  310. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
  311. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
  312. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +17 -8
  313. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
  314. package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/race.js +22 -0
  315. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
  316. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  317. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
  318. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
  319. package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
  320. package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
  321. package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
  322. package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
  323. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  324. package/node_modules/@smithy/core/dist-types/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  325. package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +12 -0
  326. package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +1 -0
  327. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
  328. package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
  329. package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/race.d.ts +3 -0
  330. package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +1 -0
  331. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
  332. package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +1 -0
  333. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  334. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  335. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +12 -0
  336. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  337. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
  338. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
  339. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/race.d.ts +3 -0
  340. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
  341. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  342. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
  343. package/node_modules/@smithy/core/package.json +2 -2
  344. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +10 -4
  345. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +6 -2
  346. package/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js +4 -2
  347. package/node_modules/@smithy/fetch-http-handler/dist-types/request-timeout.d.ts +12 -1
  348. package/node_modules/@smithy/fetch-http-handler/dist-types/ts3.4/request-timeout.d.ts +12 -1
  349. package/node_modules/@smithy/fetch-http-handler/package.json +3 -3
  350. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
  351. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
  352. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
  353. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
  354. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
  355. package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
  356. package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
  357. package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
  358. package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
  359. package/node_modules/@smithy/signature-v4/package.json +2 -2
  360. package/node_modules/@smithy/types/dist-types/middleware.d.ts +6 -0
  361. package/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +6 -0
  362. package/node_modules/@smithy/types/package.json +1 -1
  363. package/node_modules/@types/node/README.md +1 -1
  364. package/node_modules/@types/node/package.json +2 -2
  365. package/node_modules/@types/node/zlib.d.ts +752 -0
  366. package/node_modules/bowser/README.md +26 -3
  367. package/node_modules/bowser/bowser.mjs +2225 -0
  368. package/node_modules/bowser/bundled.js +14 -1
  369. package/node_modules/bowser/es5.js +14 -1
  370. package/node_modules/bowser/index.d.mts +45 -0
  371. package/node_modules/bowser/package.json +90 -31
  372. package/node_modules/bowser/src/bowser.js +9 -1
  373. package/node_modules/bowser/src/constants.js +7 -0
  374. package/node_modules/bowser/src/parser-browsers.js +73 -7
  375. package/node_modules/bowser/src/parser-engines.js +12 -0
  376. package/node_modules/bowser/src/parser-os.js +3 -1
  377. package/node_modules/bowser/src/parser-platforms.js +3 -1
  378. package/node_modules/bowser/src/parser.js +22 -5
  379. package/node_modules/bowser/src/utils.js +16 -0
  380. package/node_modules/encodeurl/README.md +14 -0
  381. package/node_modules/encodeurl/index.js +5 -10
  382. package/node_modules/encodeurl/package.json +10 -6
  383. package/node_modules/express-rate-limit/dist/index.cjs +7 -3
  384. package/node_modules/express-rate-limit/dist/index.mjs +7 -3
  385. package/node_modules/express-rate-limit/package.json +10 -10
  386. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  387. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  388. package/node_modules/hono/dist/cjs/context.js +1 -1
  389. package/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
  390. package/node_modules/hono/dist/cjs/hono-base.js +4 -10
  391. package/node_modules/hono/dist/cjs/hono.js +0 -1
  392. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
  393. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
  394. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
  395. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
  396. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
  397. package/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
  398. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
  399. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
  400. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
  401. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
  402. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
  403. package/node_modules/hono/dist/cjs/utils/mount.js +35 -0
  404. package/node_modules/hono/dist/cjs/utils/url.js +10 -0
  405. package/node_modules/hono/dist/cjs/validator/validator.js +1 -1
  406. package/node_modules/hono/dist/context.js +1 -1
  407. package/node_modules/hono/dist/helper/css/common.js +3 -5
  408. package/node_modules/hono/dist/hono-base.js +4 -10
  409. package/node_modules/hono/dist/hono.js +0 -1
  410. package/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
  411. package/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
  412. package/node_modules/hono/dist/middleware/csrf/index.js +2 -2
  413. package/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
  414. package/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
  415. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  416. package/node_modules/hono/dist/middleware/mount/index.js +4 -4
  417. package/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
  418. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
  419. package/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
  420. package/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
  421. package/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
  422. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
  423. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
  424. package/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
  425. package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  426. package/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
  427. package/node_modules/hono/dist/utils/mount.js +34 -0
  428. package/node_modules/hono/dist/utils/url.js +10 -1
  429. package/node_modules/hono/dist/validator/validator.js +1 -1
  430. package/node_modules/hono/package.json +1 -1
  431. package/node_modules/ip-address/README.md +39 -39
  432. package/node_modules/ip-address/dist/ipv6.js +1 -1
  433. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  434. package/node_modules/ip-address/package.json +1 -1
  435. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +3 -0
  436. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -0
  437. package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -0
  438. package/node_modules/jose/dist/types/types.d.ts +8 -0
  439. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -0
  440. package/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
  441. package/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  442. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
  443. package/node_modules/jose/package.json +1 -1
  444. package/node_modules/qs/.editorconfig +1 -1
  445. package/node_modules/qs/CHANGELOG.md +87 -22
  446. package/node_modules/qs/README.md +63 -10
  447. package/node_modules/qs/dist/qs.js +17 -17
  448. package/node_modules/qs/eslint.config.mjs +61 -50
  449. package/node_modules/qs/lib/formats.js +7 -2
  450. package/node_modules/qs/lib/parse.js +29 -10
  451. package/node_modules/qs/lib/stringify.js +5 -3
  452. package/node_modules/qs/lib/utils.js +28 -9
  453. package/node_modules/qs/package.json +6 -6
  454. package/node_modules/qs/test/parse.js +335 -2
  455. package/node_modules/qs/test/stringify.js +222 -0
  456. package/node_modules/qs/test/utils.js +61 -3
  457. package/node_modules/semver/classes/range.js +2 -2
  458. package/node_modules/semver/internal/constants.js +30 -0
  459. package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
  460. package/node_modules/semver/package.json +1 -1
  461. package/node_modules/tslib/README.md +3 -8
  462. package/node_modules/tslib/package.json +1 -1
  463. package/node_modules/tslib/tslib.d.ts +4 -2
  464. package/node_modules/tslib/tslib.es6.js +10 -1
  465. package/node_modules/tslib/tslib.es6.mjs +10 -1
  466. package/node_modules/tslib/tslib.js +10 -1
  467. package/node_modules/ws/README.md +21 -29
  468. package/node_modules/ws/lib/buffer-util.js +13 -2
  469. package/node_modules/ws/lib/sender.js +4 -1
  470. package/node_modules/ws/lib/websocket.js +8 -3
  471. package/node_modules/ws/package.json +1 -1
  472. package/package.json +14 -14
  473. package/slingshot/index.js +2 -2
  474. /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
  475. /package/node_modules/@smithy/core/dist-types/submodules/{protocols → serde}/writeKey.d.ts +0 -0
  476. /package/node_modules/@smithy/core/dist-types/ts3.4/submodules/{protocols → serde}/writeKey.d.ts +0 -0
@@ -819,10 +819,15 @@ function initAsClient(websocket, address, protocols, options) {
819
819
  }
820
820
 
821
821
  if (isIpcUrl) {
822
- const parts = opts.path.split(':');
822
+ const i = opts.path.indexOf(':');
823
823
 
824
- opts.socketPath = parts[0];
825
- opts.path = parts[1];
824
+ if (i === -1) {
825
+ opts.socketPath = opts.path;
826
+ opts.path = '';
827
+ } else {
828
+ opts.socketPath = opts.path.slice(0, i);
829
+ opts.path = opts.path.slice(i + 1);
830
+ }
826
831
  }
827
832
 
828
833
  let req;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws",
3
- "version": "8.22.0",
3
+ "version": "8.22.1",
4
4
  "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
5
5
  "keywords": [
6
6
  "HyBi",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/slingcli",
3
- "version": "3.5.20261026-1",
3
+ "version": "3.6.20261105-1",
4
4
  "description": "Connects Sling CLI to Publicis Sapient Slingshot enterprise LLM gateway. Bundles the pi coding-agent runtime.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,20 +30,20 @@
30
30
  "type": "git",
31
31
  "url": "git+https://pscode.lioncloud.net/psaiproducts/slingcli.git"
32
32
  },
33
- "slingVersion": "3.5.20261026-1",
33
+ "slingVersion": "3.6.20261105-1",
34
34
  "dependencies": {
35
- "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-1.0.0.tgz",
36
- "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-1.0.0.tgz",
37
- "@earendil-works/chord": "file:../.sling-pack/earendil-works-chord-1.0.0.tgz",
38
- "@earendil-works/pi-durable": "file:../.sling-pack/earendil-works-pi-durable-0.87.1.tgz",
39
- "@earendil-works/pi-telemetry": "file:../.sling-pack/earendil-works-pi-telemetry-1.0.0.tgz",
40
- "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-1.0.0.tgz",
41
- "@earendil-works/pi-mcp": "file:../.sling-pack/earendil-works-pi-mcp-1.0.0.tgz",
42
- "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-1.0.0.tgz",
43
- "@earendil-works/pi-codemode": "file:../.sling-pack/earendil-works-pi-codemode-1.0.0.tgz",
44
- "@earendil-works/pi-server": "file:../.sling-pack/earendil-works-pi-server-1.0.0.tgz",
45
- "@earendil-works/pi-client": "file:../.sling-pack/earendil-works-pi-client-1.0.0.tgz",
46
- "@earendil-works/pi-protocol": "file:../.sling-pack/earendil-works-pi-protocol-1.0.0.tgz",
35
+ "@earendil-works/pi-tui": "1.0.0",
36
+ "@earendil-works/pi-ai": "1.0.0",
37
+ "@earendil-works/chord": "1.0.0",
38
+ "@earendil-works/pi-durable": "0.87.1",
39
+ "@earendil-works/pi-telemetry": "1.0.0",
40
+ "@earendil-works/pi-agent-core": "1.0.0",
41
+ "@earendil-works/pi-mcp": "1.0.0",
42
+ "@earendil-works/pi-coding-agent": "1.0.0",
43
+ "@earendil-works/pi-codemode": "1.0.0",
44
+ "@earendil-works/pi-server": "1.0.0",
45
+ "@earendil-works/pi-client": "1.0.0",
46
+ "@earendil-works/pi-protocol": "1.0.0",
47
47
  "@modelcontextprotocol/sdk": "^1.32.0",
48
48
  "undici": "7.30.1",
49
49
  "semver": "^7.6.0"
@@ -569,11 +569,11 @@ Log file: ${Rs}
569
569
  `;Ba.appendFileSync(Rs,n)}catch{}}function ut(t,e){if(!(!Rs||!Ba||!Wg))try{let i=`[${new Date().toISOString()}] ${t}:
570
570
  ${JSON.stringify(e,null,2)}
571
571
 
572
- `;Ba.appendFileSync(Rs,i)}catch{}}var Do=null,Vz=!1;function Abe(t){if(!t)return;let e=t.trim();if(e)return e.replace(/\/+$/,"")}var G=class t{static{this.BASE_URL="base_url"}static{this.ANALYTICS_DOMAIN="analytics_domain"}static{this.CLIENT_ID="client_id"}static{this.PROJECT_ID="project_id"}static{this.WORKSPACE_ID="workspace_id"}static{this.PROJECT_NAME="project_name"}static{this.WORKSPACE_NAME="workspace_name"}static{this.CLIENT_DISPLAY_NAME="client_name"}static{this.SCHEMA_VERSION="schema_version"}static{this.ACTIVE_CLIENT="active_client"}static{this.KNOWN_CLIENTS="known_clients"}static{this.ECG_ENABLED="ecg_enabled"}static{this.ECG_RESOURCES="ecg_resources"}static{this.ECG_DOMAIN="ecg_domain"}static{this.CURRENT_SCHEMA_VERSION=2}static{this.ANALYTICS_HOST_PREFIX="slingshot"}static{this.CACHE_CONTROL="cache_control"}static{this.APP_TOKEN_HOST_EXCEPTIONS={"sapientaiproducts.com":"https://slingshot.sapientaiproducts.com","uat.sapientaiproducts.com":"https://uat-slingshot.sapientaiproducts.com","dev.sapientaiproducts.com":"https://dev-slingshot.sapientaiproducts.com"}}static{this.defaultValues={[t.BASE_URL]:"https://sapientaiproducts.com",[t.ANALYTICS_DOMAIN]:"https://slingshot.sapientaiproducts.com",[t.CLIENT_ID]:"b97fbef7-cad9-4e56-9850-39e86c8fdf61",[t.PROJECT_ID]:"fa8121c4-e2fc-48f1-9478-8949c04e13cc",[t.WORKSPACE_ID]:"6e5756eb-d7e2-4d80-ad07-9d7a51600d85",[t.CACHE_CONTROL]:"5m"}}static defaultsFor(e){let n=String(e[this.BASE_URL]||this.defaultValues[this.BASE_URL]||"");if(this.makeClientKey(n)===this.getDefaultClientKey())return this.defaultValues;let i={...this.defaultValues};for(let r of[this.ANALYTICS_DOMAIN,this.CLIENT_ID,this.PROJECT_ID,this.WORKSPACE_ID])delete i[r];return i}static{this.LOGIN_PATH="/web/v1/studio-auth/login"}static{this.EXCHANGE_PATH="/api/v1/studio-auth/auth/desktop/exchange"}static{this.REFRESH_PATH="/api/v3/auth/refreshtoken"}static{this.QUERY_CLIENTS_PATH="/api/v2/projects/clients/queryClients"}static{this.API_BASE_PATH="/api/v1/llm"}static{this.SAGE_EVENTS_PATH="/api/v1/ai-portal/sage_events"}static{this.APP_TOKEN_PATH="/api/v1/ai-auth/token/app"}static{this.ECG_MCP_PATH="/api/v1/ecg/mcp"}static{this.USER_RESOURCES_PATH="/api/v1/ai-auth/auth/user"}static{this.SLINGSHOT_RAG_MCP="/api/v1/ai-prompt-lib/mcp/"}static{this.SAPI="/save/api/v1"}static{this.REFRESH_CLIENT_NAME="machine"}static{this.APP_TOKEN_REFRESH_BUFFER_MS=60*1e3}static{this.TOKEN_EXPIRY_BUFFER_MS=300*1e3}static{this.CLIENT_NAME="desktop"}static defaults(e){return this.defaultValues[e]}static deriveAnalyticsDomain(e){let n=(e||"").trim().replace(/\/+$/,"");if(!n)return"";let i;try{i=new URL(n)}catch{return""}return i.hostname?(i.hostname.startsWith(`${this.ANALYTICS_HOST_PREFIX}.`)||(i.hostname=`${this.ANALYTICS_HOST_PREFIX}.${i.hostname}`),`${i.protocol}//${i.host}`):""}static resolveAppTokenDomainForSave(e){let n=(e||"").trim().replace(/\/+$/,"");if(!n)return"";let i;try{i=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`)}catch{return n}if(!i.hostname)return n;let r=`${i.protocol}//${i.host}`;return this.APP_TOKEN_HOST_EXCEPTIONS[i.host.toLowerCase()]||r}static makeClientKey(e){try{return new URL((e||"").trim()).host}catch{return""}}static makeClientLabel(e){return this.makeClientKey(e)||e}static toKnownClient(e){let n=String(e[this.BASE_URL]||"");if(!this.makeClientKey(n))return null;let i=s=>String(e[s]||""),r=i(this.ANALYTICS_DOMAIN),o=i(this.CLIENT_DISPLAY_NAME);return{label:this.makeClientLabel(n),domain:n,client_id:i(this.CLIENT_ID),project_id:i(this.PROJECT_ID),project_name:i(this.PROJECT_NAME),workspace_id:i(this.WORKSPACE_ID),workspace_name:i(this.WORKSPACE_NAME),...r?{analytics_domain:r}:{},...o?{client_name:o}:{}}}static persist(e,n){let i=Ug.dirname(e);Fn.existsSync(i)||Fn.mkdirSync(i,{recursive:!0}),Fn.writeFileSync(e,JSON.stringify(n,null,2),"utf-8")}static migrate(e,n,i){if(e[this.SCHEMA_VERSION]===this.CURRENT_SCHEMA_VERSION)return e;let r=String(e[this.BASE_URL]||""),o=this.makeClientKey(r),s={...e[this.KNOWN_CLIENTS]||{}};if(o&&!s[o]){let l=this.toKnownClient(e);l&&(s[o]=l)}let a={[this.SCHEMA_VERSION]:this.CURRENT_SCHEMA_VERSION,[this.ACTIVE_CLIENT]:e[this.ACTIVE_CLIENT]||o,[this.KNOWN_CLIENTS]:s};if(n===this.getGlobalSettingsPath())try{this.persist(n,{...i,...a})}catch(l){ut("Error persisting sling.settings.json migration: ",l)}return{...e,...a}}static readGlobalSettings(){let e=this.getGlobalSettingsPath();try{let n=Fn.existsSync(e)?Fn.readFileSync(e,"utf-8"):"",i=n?JSON.parse(n)||{}:{};return this.migrate({...this.defaultsFor(i),...i},e,i)}catch(n){return ut("Error reading global sling.settings.json: ",n),{...this.defaultValues}}}static getClientRegistry(){let e=this.readGlobalSettings()[this.KNOWN_CLIENTS];return{activeKey:String(this.getSettings()[this.ACTIVE_CLIENT]||""),clients:e&&typeof e=="object"?e:{}}}static getKnownClients(){return this.getClientRegistry().clients}static getGlobalActiveClientKey(){return String(this.readGlobalSettings()[this.ACTIVE_CLIENT]||"")}static writeRegistry(e){this.updateSettings({[this.KNOWN_CLIENTS]:e},{scope:"global"})}static patchActiveClient(e){let{activeKey:n,clients:i}=this.getClientRegistry(),r=n?i[n]:void 0;r&&this.writeRegistry({...i,[n]:{...r,...e}})}static applyClient(e,n){let i=this.makeClientKey(e.domain),r=n?.scope??this.resolveWriteScope(),o=this.resolveAppTokenDomainForSave(e.domain),s={...this.getKnownClients()};s[i]={...e,analytics_domain:o,last_used:new Date().toISOString()},this.updateSettings({[this.BASE_URL]:e.domain,[this.ANALYTICS_DOMAIN]:o,[this.CLIENT_ID]:e.client_id||"",[this.PROJECT_ID]:e.project_id||"",[this.WORKSPACE_ID]:e.workspace_id||"",[this.PROJECT_NAME]:e.project_name||"",[this.WORKSPACE_NAME]:e.workspace_name||"",[this.CLIENT_DISPLAY_NAME]:e.client_name||"",[this.ACTIVE_CLIENT]:i,[this.SCHEMA_VERSION]:this.CURRENT_SCHEMA_VERSION},{scope:r}),this.writeRegistry(s)}static recordActiveClientId(e){let n=(e||"").trim();if(!n)return;let{activeKey:i,clients:r}=this.getClientRegistry();(i?r[i]:void 0)?.client_id===n&&this.getDefaultClientId()===n||(this.updateSettings({[this.CLIENT_ID]:n}),this.patchActiveClient({client_id:n}))}static recordActiveAppTokenOverride(e){let n=(e||"").trim();this.patchActiveClient({analytics_domain:n||void 0})}static recordActiveProjectSelection(e){this.patchActiveClient(e)}static hasProjectSelection(){return!!(this.getDefaultProjectId()&&this.getDefaultWorkspaceId())}static getDefaultClientKey(){return this.makeClientKey(String(this.defaultValues[this.BASE_URL]||""))}static removeKnownClient(e){if(!e||e===this.getDefaultClientKey())return!1;let{activeKey:n,clients:i}=this.getClientRegistry();if(e===n||e===this.getGlobalActiveClientKey()||!i[e])return!1;let r={...i};return delete r[e],this.writeRegistry(r),!0}static getLocalSettingsPath(){return Ug.resolve(process.cwd(),".sling","sling.settings.json")}static getGlobalSettingsPath(){return Ug.resolve(ke(),"sling.settings.json")}static getSettingsPath(e){return e==="local"?this.getLocalSettingsPath():e==="global"?this.getGlobalSettingsPath():this.getActivePinPath()??this.getGlobalSettingsPath()}static getActivePinPath(){if(Vz)return null;let e=this.getLocalSettingsPath();return Fn.existsSync(e)?e:null}static disableLocalSettingsForSession(){Vz=!0,Do=null}static getUntrustedPinDomain(){if(!this.getActivePinPath())return null;let e=String(this.getSettings()[this.BASE_URL]||""),n=this.makeClientKey(e);return n?this.getClientRegistry().clients[n]?null:e:null}static trustActivePin(){let e=this.toKnownClient(this.getSettings());if(!e)return!1;let n=this.makeClientKey(e.domain),{clients:i}=this.getClientRegistry();return i[n]||this.writeRegistry({...i,[n]:{...e,last_used:new Date().toISOString()}}),!0}static resolveWriteScope(){return this.getActivePinPath()?"local":"global"}static clearLocalSettings(){let e=this.getLocalSettingsPath();try{return Fn.existsSync(e)?(Fn.unlinkSync(e),Do=null,!0):!1}catch(n){return ut("Error removing local sling.settings.json: ",n),!1}}static loadSettingsFile(e){if(Fn.existsSync(e)){let i=Fn.readFileSync(e,"utf-8"),r=JSON.parse(i)||{};return this.migrate({...this.defaultsFor(r),...r},e,r)}let n=Ug.dirname(e);return Fn.existsSync(n)||Fn.mkdirSync(n,{recursive:!0}),this.migrate({...this.defaultValues},e,{...this.defaultValues})}static getSettings(){if(!Do)try{Do=this.loadSettingsFile(this.getSettingsPath())}catch(n){ut("Error reading/writing sling.settings.json: ",n);let i=this.getActivePinPath();if(i){ut("Ignoring unreadable local pin for this session: ",i),this.disableLocalSettingsForSession();try{Do=this.loadSettingsFile(this.getSettingsPath())}catch(r){ut("Error reading global sling.settings.json: ",r)}}Do||(Do={...this.defaultValues})}let e=Abe(process.env.SLINGSHOT_API_DOMAIN);return{...Do,[t.BASE_URL]:e||Do[t.BASE_URL]}}static updateSettings(e,n){let i=n?.scope??this.resolveWriteScope();if(i==="local"&&this.KNOWN_CLIENTS in e){let{[this.KNOWN_CLIENTS]:r,...o}=e;this.writeToScope({[this.KNOWN_CLIENTS]:r},"global"),Object.keys(o).length>0&&this.writeToScope(o,"local");return}this.writeToScope(e,i)}static writeToScope(e,n){let i=this.getSettingsPath(n);try{let r={};if(Fn.existsSync(i)){let l=Fn.readFileSync(i,"utf-8");r=JSON.parse(l)||{}}let o={...r,...e},s={...this.defaultsFor(o),...o},a=Ug.dirname(i);Fn.existsSync(a)||Fn.mkdirSync(a,{recursive:!0}),Fn.writeFileSync(i,JSON.stringify(s,null,2),"utf-8"),Do=null}catch(r){ut("Error updating sling.settings.json: ",r)}}static getLoginUrl(e){let n=this.getSettings(),i=new URLSearchParams({client:this.CLIENT_NAME,port:String(e.port),localState:e.localState});return e.clientId&&i.set("clientId",e.clientId),`${n[t.BASE_URL]}${this.LOGIN_PATH}?${i.toString()}`}static getExchangeUrl(){return`${this.getSettings()[t.BASE_URL]}${this.EXCHANGE_PATH}`}static getRefreshUrl(){let e=this.getSettings(),n=new URLSearchParams({client:this.REFRESH_CLIENT_NAME});return`${e[t.BASE_URL]}${this.REFRESH_PATH}?${n.toString()}`}static getApiBaseUrl(){return`${this.getSettings()[t.BASE_URL]}${this.API_BASE_PATH}`}static resolvePlatformDomain(){return this.deriveAnalyticsDomain(String(this.getSettings()[t.BASE_URL]||""))}static getAppTokenDomain(){let e=this.getSettings();return String(e[t.ANALYTICS_DOMAIN]||"").trim()||String(e[t.BASE_URL]||"").trim()}static getLegacyPlatformDomain(){return this.resolvePlatformDomain()}static getSageEventsUrl(){return`${this.getLegacyPlatformDomain()}${this.SAGE_EVENTS_PATH}`}static getSlingshotRAGMCPUrl(){return`${this.getLegacyPlatformDomain()}${this.SLINGSHOT_RAG_MCP}`}static getTokenExpiryBuffer(){return this.TOKEN_EXPIRY_BUFFER_MS}static getCacheControlForClaude(){let n=this.getSettings()[t.CACHE_CONTROL]||"5m";return!n||typeof n!="string"||!/^(5m|1h)$/.test(n)?(ut("Invalid cache control value in sling.settings.json, falling back to default: ",n),"5m"):n}static getDefaultProjectId(){let e=this.getSettings();return process.env.SLINGSHOT_PROJECT_ID||e[t.PROJECT_ID]||""}static getDefaultWorkspaceId(){let e=this.getSettings();return process.env.SLINGSHOT_WORKSPACE_ID||e[t.WORKSPACE_ID]||""}static getDefaultClientId(){let e=this.getSettings();return process.env.CLIENT_ID||e[t.CLIENT_ID]||""}static getClientName(){return String(this.getSettings()[t.CLIENT_DISPLAY_NAME]||"").trim()}static recordClientName(e){let n=(e||"").trim();if(!n)return;let{activeKey:i,clients:r}=this.getClientRegistry(),o=i?r[i]:void 0;this.getClientName()===n&&o?.client_name===n||(this.updateSettings({[t.CLIENT_DISPLAY_NAME]:n}),this.patchActiveClient({client_name:n}))}static getEcgResourceKey(){let e=this.getDefaultClientId().trim(),n=this.getDefaultProjectId().trim();return e&&n?`${e}:${n}`:""}static isEcgEnabled(){return this.getSettings()[t.ECG_ENABLED]===!0}static setEcgEnabled(e){this.updateSettings({[t.ECG_ENABLED]:e})}static getEcgSelection(){let e=this.getEcgResourceKey();if(!e)return null;let i=this.getSettings()[t.ECG_RESOURCES]?.[e];return!i||!Array.isArray(i.resources)||i.resources.length===0?null:i}static setEcgSelection(e){let n=this.getEcgResourceKey();if(!n)return;let i={...this.getSettings()[t.ECG_RESOURCES]||{}};!e||e.resources.length===0?delete i[n]:i[n]=e,this.updateSettings({[t.ECG_RESOURCES]:i})}static getQueryClientsUrl(){return`${this.getSettings()[t.BASE_URL]}${this.QUERY_CLIENTS_PATH}`}static getUserActivityUrl(){return`${this.getSettings()[t.BASE_URL]}${this.SAPI}/users/activity`}static getUserUrl(){return`${this.getSettings()[t.BASE_URL]}${this.SAPI}/users`}static getModelsUrl(){return`${this.getSettings()[t.BASE_URL]}${this.SAPI}/ai/models`}static getPrimaryAppTokenUrl(){return`${this.getSettings()[t.BASE_URL]||""}${this.SAPI}/ai-auth/token/app`}static getAppTokenUrl(){return`${this.getAppTokenDomain()}${this.APP_TOKEN_PATH}`}static getAppTokenRefreshBuffer(){return this.APP_TOKEN_REFRESH_BUFFER_MS}static getEcgDomain(){return String(this.getSettings()[t.ECG_DOMAIN]||"").trim().replace(/\/+$/,"")||this.getAppTokenDomain()}static getEcgMcpUrl(){return`${this.getEcgDomain()}${this.ECG_MCP_PATH}`}static getUserResourcesUrl(){return`${this.getEcgDomain()}${this.USER_RESOURCES_PATH}`}};function HI(t,e=!1){let n=t.split(".");if(!(n.length<2||!n[1])&&!(e&&n.length!==3))try{let i=n[1].replace(/-/g,"+").replace(/_/g,"/"),r=(4-(i.length%4||4))%4,o=`${i}${"=".repeat(r)}`,s=JSON.parse(Buffer.from(o,"base64").toString("utf8"));return s&&typeof s=="object"?s:void 0}catch{return}}function ac(t){let e=HI(t,!0)?.exp;return typeof e=="number"?e*1e3:0}function Qz(t){let e=HI(t,!0)?.iss;return typeof e=="string"?e:""}function Jz(t){let e=HI(t);if(!e)return;let n=e.UserInfo&&typeof e.UserInfo=="object"?e.UserInfo:void 0;return{sub:typeof e.sub=="string"?e.sub:void 0,user_id:typeof e.user_id=="string"?e.user_id:typeof n?.id=="string"?n.id:void 0,email:typeof e.email=="string"?e.email:typeof n?.email=="string"?n.email:void 0}}function zI(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}oi();import{randomUUID as Ebe}from"node:crypto";import Yz from"node:fs";import Ibe from"node:path";var Pbe="slingcli",_be=1e4,Lbe=2e3,Obe=1e3,Wbe=5e3,Dbe=6e4,Ube="sling.app-creds.json",lc=null,Fg=null,As=null,GI=0;function eG(){let t=Ibe.resolve(ke(),Ube);try{Yz.existsSync(t)&&(Yz.unlinkSync(t),Me(`app-token: removed legacy app credentials at ${t}`))}catch(e){ut("app-token: failed to remove legacy app credentials",e)}}function Fbe(){let t=uA("slingshot");return t?.type==="oauth"&&typeof t.access=="string"?t.access:void 0}function Bbe(t){As&&(clearTimeout(As),As=null);let e=G.getAppTokenRefreshBuffer(),i=t.realExpiry-Date.now()>e?t.realExpiry-e:t.realExpiry+Lbe;As=setTimeout(()=>{As=null,kn().catch(r=>{ut("app-token: scheduled refresh failed",r)})},Math.max(i-Date.now(),Obe)),As.unref?.()}async function $be(t,e){let n={accept:"application/json","x-app-name":Pbe,"trace-id":Ebe()};e&&(n.authorization=`Bearer ${e}`);try{return await fetch(t,{method:"GET",headers:n,signal:AbortSignal.timeout(Dbe)})}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(`Cannot reach app-token service: ${r}`)}}async function Xz(t){let e=`${t.status} ${t.statusText}`;try{let n=await t.text()||"";n&&(e=n)}catch{}return e}function Nbe(t){if(!t.app_token)throw new Error("App token response missing app_token");let e=typeof t.expires_in=="number"?Date.now()+t.expires_in*1e3:ac(t.app_token);if(!e)throw new Error("App token response missing expires_in and its JWT has no decodable exp claim");return Me(`app-token: minted, expires ${new Date(e).toISOString()}`),{token:t.app_token,usableUntil:e-_be,realExpiry:e}}async function Zz(t,e){let n=await $be(t,e);if(n.ok)return Nbe(await n.json());if(n.status===404)return{notFound:await Xz(n)};throw new Error(`App token request failed: ${await Xz(n)}`)}async function jbe(t){let e=G.getPrimaryAppTokenUrl(),n=t??Fbe();Me(`app-token: minting from ${e}`);let i=await Zz(e,n);if(!("notFound"in i))return i;let r=G.getAppTokenUrl();Me(`app-token: primary 404, falling back to ${r}`);let o=await Zz(r);if("notFound"in o)throw new Error(`App token request failed: ${o.notFound}`);return o}async function kn(t){let e=Date.now();if(lc&&(lc.usableUntil>e||lc.realExpiry>e&&e-GI<Wbe))return lc.token;if(Fg)return(await Fg).token;let n=jbe(t).then(r=>(lc=r,GI=Date.now(),Bbe(r),r)).finally(()=>{Fg=null});return Fg=n,(await n).token}function Bg(){lc=null,Fg=null,GI=0,As&&(clearTimeout(As),As=null)}var $g=null,qI=null;typeof process<"u"&&process.versions?.node&&(qI=import("node:http").then(t=>{$g=t.createServer}));async function Hbe(){if($g||(qI&&await qI,$g))return $g;throw new Error("Slingshot OAuth requires Node.js")}async function KI(t){let e=await Hbe(),n,i,r,o=!1,s=new Promise((u,p)=>{i=u,r=p}),a=u=>{if(!o){o=!0;try{n.close()}catch{}u()}};n=e((u,p)=>{let d=new URL(u.url||"","http://127.0.0.1"),m=d.searchParams.get("code"),g=d.searchParams.get("state"),h=d.searchParams.get("clientId"),f=d.searchParams.get("error"),y=d.searchParams.get("error_description");if(f){p.writeHead(400,{"Content-Type":"text/html"}),p.end(`<html><body><h1>Login Failed</h1><p>${y||f}</p><p>You can close this window.</p></body></html>`),a(()=>r(new Error(`Login failed: ${y||f}`)));return}if(!m||!g){p.writeHead(400,{"Content-Type":"text/html"}),p.end("<html><body><h1>Login Failed</h1><p>Missing code or state in callback.</p><p>You can close this window.</p></body></html>"),a(()=>r(new Error("Missing code or state in callback")));return}p.writeHead(200,{"Content-Type":"text/html"}),p.end("<html><body><h1>Login Successful</h1><p>You can close this window and return to your terminal.</p><script>setTimeout(()=>window.close(),3000)</script></body></html>"),a(()=>i({code:m,state:g,clientId:h||""}))}),n.on("error",u=>{a(()=>r(u))});let l=setTimeout(()=>{a(()=>r(new Error("Login timeout - no callback received within 5 minutes")))},300*1e3);return n.on("close",()=>clearTimeout(l)),t&&t.addEventListener("abort",()=>{a(()=>r(new Error("Login cancelled")))}),{port:await new Promise((u,p)=>{n.once("error",p),n.listen(0,"127.0.0.1",()=>{let d=n.address();d&&typeof d=="object"?u(d.port):p(new Error("Failed to obtain loopback server port"))})}),result:s}}async function VI(t,e){if(!t)throw new Error("Missing exchange code");if(!e)throw new Error("Missing clientId for exchange");let n=G.getExchangeUrl(),i;try{i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({code:t,clientId:e})})}catch(o){let s=o instanceof Error?o.message:String(o);throw new Error(`Cannot reach Studio Auth: ${s}`)}if(!i.ok){let o,s=`${i.status} ${i.statusText}`;try{let a=await i.json();o=a.error?.code,a.error?.message?s=a.error.message:a.message?s=a.message:o&&(s=o)}catch{}throw o==="INVALID_CALLBACK"?new Error("Login failed: exchange code is expired, already used, or bound to a different tenant. Please log in again."):new Error(`Code exchange failed: ${s}`)}let r=await i.json();if(!r.accessToken||!r.refreshToken)throw new Error("Exchange response missing accessToken or refreshToken");return r}function Gbe(){return zbe(16).toString("hex")}function qbe(t){let e=new URL(t),n=e.searchParams.get("code"),i=e.searchParams.get("state"),r=e.searchParams.get("clientId");if(!n||!i)throw new Error("Pasted URL is missing code or state");return{code:n,state:i,clientId:r||""}}async function QI(t){let e=process.env.SLINGSHOT_TOKEN;if(e){let u=ac(e);return Me("Using Slingshot token from SLINGSHOT_TOKEN environment variable"),Bg(),await kn(e),{refresh:"",access:e,expires:u>0?u-G.getTokenExpiryBuffer():Date.now()+10800*1e3,projectId:G.getDefaultProjectId(),workspaceId:G.getDefaultWorkspaceId()}}let{port:n,result:i}=await KI(t.signal),r=Gbe(),o=G.getDefaultClientId(),s=G.getLoginUrl({port:n,localState:r,clientId:o||void 0});t.onAuth({url:s});let a;if(t.onManualCodeInput){let u=t.onManualCodeInput().then(qbe);a=await Promise.race([i,u])}else a=await i;if(a.state!==r)throw new Error("CSRF check failed - state does not match localState");if(!a.clientId)throw new Error("Login callback did not include clientId");let l=await VI(a.code,a.clientId);G.recordActiveClientId(a.clientId);let c=ac(l.accessToken);return Bg(),await kn(l.accessToken),{refresh:l.refreshToken,access:l.accessToken,expires:c>0?c-G.getTokenExpiryBuffer():Date.now()+10800*1e3,projectId:G.getDefaultProjectId(),workspaceId:G.getDefaultWorkspaceId()}}import{randomUUID as Kbe}from"node:crypto";async function JI(t){if(!t.refresh)throw new Error("No refresh token available. Please login again.");let e;try{e=await kn(t.access)}catch(a){throw ut("auth/refresh: app token unavailable for refresh call",a),new Error(`Cannot refresh Slingshot token: app token unavailable (${a instanceof Error?a.message:String(a)}). Please /login slingshot.`)}let n=Kbe(),i={accept:"application/json",rt:t.refresh,"trace-id":n,Authorization:`Bearer ${e}`},r;try{let a=G.getRefreshUrl();r=await fetch(a,{headers:i})}catch(a){let l=a instanceof Error?a.message:String(a);throw new Error(`Cannot reach Slingshot server: ${l}`)}if(!r.ok){let a=`${r.status} ${r.statusText}`;try{let l=await r.json();l.message?a=String(l.message):l.error&&(a=String(l.error))}catch{}throw new Error(`Token refresh failed: ${a}`)}let o=await r.json();if(!o.accessToken)throw new Error("No access token in refresh response");let s=ac(o.accessToken);try{await kn(o.accessToken)}catch(a){throw ut("auth/refresh: app token refresh failed",a),a}return{refresh:o.refreshToken||t.refresh,access:o.accessToken,expires:s>0?s-G.getTokenExpiryBuffer():Date.now()+10800*1e3,projectId:t.projectId,workspaceId:t.workspaceId}}var Vbe=240*1e3,tG=6e4,Gb,qb=0;function nG(t,e){t!==qb&&(qb=t,iG(t,e,t-Vbe-Date.now()))}function iG(t,e,n){clearTimeout(Gb),Gb=setTimeout(async()=>{await e().catch(i=>{Me(`auth/user-token-timer: scheduled refresh failed: ${oG(i)}`)}),qb===t&&Date.now()+tG<t&&iG(t,e,tG)},n),Gb.unref?.()}function rG(){clearTimeout(Gb),qb=0}function oG(t){return t instanceof Error?t.cause===void 0?t.message:`${t.message}: ${oG(t.cause)}`:String(t)}var Td=[{id:"gpt-5.4-nano",name:"GPT-5.4 nano",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-4.1",name:"GPT-4.1",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,provider:"slingshot",api:"openai-completions"},{id:"gpt-5",name:"GPT-5",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5-mini",name:"GPT-5 Mini",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5-nano",name:"GPT-5 Nano",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5.1",name:"GPT-5.1",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.13,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5.2",name:"GPT-5.2",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5.4-mini",name:"GPT-5.4 mini",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.4",name:"GPT-5.4",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:272e3,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.5",name:"GPT-5.5",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:272e3,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:.96,output:5.76,cacheRead:.096,cacheWrite:0},contextWindow:105e4,maxTokens:5e5,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:2.4,output:14.4,cacheRead:.24,cacheWrite:0},contextWindow:105e4,maxTokens:5e5,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:4.8,output:28.8,cacheRead:.48,cacheWrite:0},contextWindow:105e4,maxTokens:5e5,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"claude-opus-4@20250514",name:"Claude Opus 4",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},contextWindow:2e5,maxTokens:32e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-sonnet-4@20250514",name:"Claude Sonnet 4",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-sonnet-4-5@20250929",name:"Claude Sonnet 4.5",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",baseUrl:"",reasoning:!0,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-opus-4-6",name:"Claude Opus 4.6",baseUrl:"",reasoning:!0,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e5,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages"},{id:"Qwen/Qwen3.6-27B-FP8",name:"Qwen 3.6 27B FP8",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.2,output:3.6,cacheRead:.3,cacheWrite:3.75},contextWindow:64e3,maxTokens:56e3,provider:"slingshot",api:"openai-completions"},{id:"o3",name:"O3",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,provider:"slingshot",api:"openai-completions"},{id:"o3-mini",name:"o3-mini",baseUrl:"",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,provider:"slingshot",api:"openai-completions"},{id:"o4-mini",name:"o4-mini",baseUrl:"",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.28,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,provider:"slingshot",api:"openai-completions"},{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.44,output:1.32,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:65535,provider:"slingshot",api:"openai-completions"},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.76,output:10.56,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:65535,provider:"slingshot",api:"openai-completions"}];var Kb=t=>Math.round((t??0)*1e3*1e6)/1e6,Qbe=32768,Jbe=16384,Ybe=new Map(Td.map(t=>[t.id,t.maxTokens])),Xbe=new Map(Td.filter(t=>t.api==="anthropic-messages"&&t.thinkingLevelMap).map(t=>[t.id,t.thinkingLevelMap])),Zbe=new Set(["claude-opus-4","claude-sonnet-4","claude-opus-4-5","claude-sonnet-4-5","claude-haiku-4-5"]);function eSe(t){let e=t.replace(/(?:@|-)\d{8}$/,"");return!e.startsWith("claude-3-")&&!Zbe.has(e)}function YI(t){if(t.api!=="anthropic-messages")return t;let e={...t},n={...t.compat};eSe(t.id)?n.forceAdaptiveThinking=!0:delete n.forceAdaptiveThinking,Object.keys(n).length?e.compat=n:delete e.compat;let i=Xbe.get(t.id);return i&&(e.thinkingLevelMap={...i,...t.thinkingLevelMap}),e}async function sG(t,e){let n=await fetch(t,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!n.ok)throw new Error(`Slingshot models fetch failed: ${n.status}`);let i=await n.json();return tSe(Array.isArray(i)?i:i?.data??[])}function tSe(t){return t.filter(e=>e.model_type==="chat").map(e=>{let n=e.metadata??{},i=typeof n.family=="string"?n.family.trim():"",r=i==="smart",o=e.provider==="claude"||i==="anthropic",s=n.context_length??0,a=(n.supported_modalities??["text"]).filter(l=>l==="text"||l==="image");return YI({id:e.id,name:n.name||e.id,baseUrl:"",reasoning:r?!1:!!n.reasoning,input:a,cost:{input:Kb(e.inputCostPer1KTokens),output:Kb(e.outputCostPer1KTokens),cacheRead:Kb(e.cacheCostPer1KTokens?.read),cacheWrite:Kb(e.cacheCostPer1KTokens?.write)},contextWindow:s,maxTokens:Math.min(s,r?Jbe:Ybe.get(e.id)??Qbe),provider:"slingshot",api:r?"openai-completions":o?"anthropic-messages":e.supported_apis?.includes("responses")?"openai-responses":"openai-completions",...i===""?{}:{family:i}})}).sort((e,n)=>e.id.localeCompare(n.id))}import aG from"node:fs";function lG(t,e,n){try{aG.writeFileSync(t,JSON.stringify({baseUrl:e,fetchedAt:new Date().toISOString(),models:n}))}catch{}}function XI(t,e){try{let n=JSON.parse(aG.readFileSync(t,"utf-8"));return n?.baseUrl!==e||!Array.isArray(n.models)||n.models.length===0?null:n.models.map(YI)}catch{return null}}oi();import Vb from"node:fs";import cG from"node:path";import nSe from"proper-lockfile";var iSe=250;function rSe(){return cG.resolve(ke(),"settings.json")}function oSe(t){if(!Vb.existsSync(t))return{};try{let e=JSON.parse(Vb.readFileSync(t,"utf-8"));return e===null||typeof e!="object"||Array.isArray(e)?(Me(`default-model: refusing to write to non-object settings at ${t}`),null):e}catch(e){return Me(`default-model: could not parse ${t}, leaving it alone: ${ZI(e)}`),null}}async function sSe(t,e,n){let i;try{Vb.mkdirSync(cG.dirname(t),{recursive:!0}),i=await nSe.lock(t,{realpath:!1,retries:{retries:10,minTimeout:20,maxTimeout:200},onCompromised:o=>Me(`default-model: settings lock compromised: ${ZI(o)}`)});let r=oSe(t);return r===null?!1:(r.defaultProvider===e&&r.defaultModel===n||(r.defaultProvider=e,r.defaultModel=n,Vb.writeFileSync(t,`${JSON.stringify(r,null,2)}
572
+ `;Ba.appendFileSync(Rs,i)}catch{}}var Do=null,Vz=!1;function Abe(t){if(!t)return;let e=t.trim();if(e)return e.replace(/\/+$/,"")}var G=class t{static{this.BASE_URL="base_url"}static{this.ANALYTICS_DOMAIN="analytics_domain"}static{this.CLIENT_ID="client_id"}static{this.PROJECT_ID="project_id"}static{this.WORKSPACE_ID="workspace_id"}static{this.PROJECT_NAME="project_name"}static{this.WORKSPACE_NAME="workspace_name"}static{this.CLIENT_DISPLAY_NAME="client_name"}static{this.SCHEMA_VERSION="schema_version"}static{this.ACTIVE_CLIENT="active_client"}static{this.KNOWN_CLIENTS="known_clients"}static{this.ECG_ENABLED="ecg_enabled"}static{this.ECG_RESOURCES="ecg_resources"}static{this.ECG_DOMAIN="ecg_domain"}static{this.CURRENT_SCHEMA_VERSION=2}static{this.ANALYTICS_HOST_PREFIX="slingshot"}static{this.CACHE_CONTROL="cache_control"}static{this.APP_TOKEN_HOST_EXCEPTIONS={"sapientaiproducts.com":"https://slingshot.sapientaiproducts.com","uat.sapientaiproducts.com":"https://uat-slingshot.sapientaiproducts.com","dev.sapientaiproducts.com":"https://dev-slingshot.sapientaiproducts.com"}}static{this.defaultValues={[t.BASE_URL]:"https://sapientaiproducts.com",[t.ANALYTICS_DOMAIN]:"https://slingshot.sapientaiproducts.com",[t.CLIENT_ID]:"b97fbef7-cad9-4e56-9850-39e86c8fdf61",[t.PROJECT_ID]:"fa8121c4-e2fc-48f1-9478-8949c04e13cc",[t.WORKSPACE_ID]:"6e5756eb-d7e2-4d80-ad07-9d7a51600d85",[t.CACHE_CONTROL]:"5m"}}static defaultsFor(e){let n=String(e[this.BASE_URL]||this.defaultValues[this.BASE_URL]||"");if(this.makeClientKey(n)===this.getDefaultClientKey())return this.defaultValues;let i={...this.defaultValues};for(let r of[this.ANALYTICS_DOMAIN,this.CLIENT_ID,this.PROJECT_ID,this.WORKSPACE_ID])delete i[r];return i}static{this.LOGIN_PATH="/web/v1/studio-auth/login"}static{this.EXCHANGE_PATH="/api/v1/studio-auth/auth/desktop/exchange"}static{this.REFRESH_PATH="/api/v3/auth/refreshtoken"}static{this.QUERY_CLIENTS_PATH="/api/v2/projects/clients/queryClients"}static{this.API_BASE_PATH="/api/v1/llm"}static{this.SAGE_EVENTS_PATH="/api/v1/ai-portal/sage_events"}static{this.APP_TOKEN_PATH="/api/v1/ai-auth/token/app"}static{this.ECG_MCP_PATH="/api/v1/ecg/mcp"}static{this.USER_RESOURCES_PATH="/api/v1/ai-auth/auth/user"}static{this.SLINGSHOT_RAG_MCP="/api/v1/ai-prompt-lib/mcp/"}static{this.SAPI="/save/api/v1"}static{this.REFRESH_CLIENT_NAME="machine"}static{this.APP_TOKEN_REFRESH_BUFFER_MS=60*1e3}static{this.TOKEN_EXPIRY_BUFFER_MS=300*1e3}static{this.CLIENT_NAME="desktop"}static defaults(e){return this.defaultValues[e]}static deriveAnalyticsDomain(e){let n=(e||"").trim().replace(/\/+$/,"");if(!n)return"";let i;try{i=new URL(n)}catch{return""}return i.hostname?(i.hostname.startsWith(`${this.ANALYTICS_HOST_PREFIX}.`)||(i.hostname=`${this.ANALYTICS_HOST_PREFIX}.${i.hostname}`),`${i.protocol}//${i.host}`):""}static resolveAppTokenDomainForSave(e){let n=(e||"").trim().replace(/\/+$/,"");if(!n)return"";let i;try{i=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`)}catch{return n}if(!i.hostname)return n;let r=`${i.protocol}//${i.host}`;return this.APP_TOKEN_HOST_EXCEPTIONS[i.host.toLowerCase()]||r}static makeClientKey(e){try{return new URL((e||"").trim()).host}catch{return""}}static makeClientLabel(e){return this.makeClientKey(e)||e}static toKnownClient(e){let n=String(e[this.BASE_URL]||"");if(!this.makeClientKey(n))return null;let i=s=>String(e[s]||""),r=i(this.ANALYTICS_DOMAIN),o=i(this.CLIENT_DISPLAY_NAME);return{label:this.makeClientLabel(n),domain:n,client_id:i(this.CLIENT_ID),project_id:i(this.PROJECT_ID),project_name:i(this.PROJECT_NAME),workspace_id:i(this.WORKSPACE_ID),workspace_name:i(this.WORKSPACE_NAME),...r?{analytics_domain:r}:{},...o?{client_name:o}:{}}}static persist(e,n){let i=Ug.dirname(e);Fn.existsSync(i)||Fn.mkdirSync(i,{recursive:!0}),Fn.writeFileSync(e,JSON.stringify(n,null,2),"utf-8")}static migrate(e,n,i){if(e[this.SCHEMA_VERSION]===this.CURRENT_SCHEMA_VERSION)return e;let r=String(e[this.BASE_URL]||""),o=this.makeClientKey(r),s={...e[this.KNOWN_CLIENTS]||{}};if(o&&!s[o]){let l=this.toKnownClient(e);l&&(s[o]=l)}let a={[this.SCHEMA_VERSION]:this.CURRENT_SCHEMA_VERSION,[this.ACTIVE_CLIENT]:e[this.ACTIVE_CLIENT]||o,[this.KNOWN_CLIENTS]:s};if(n===this.getGlobalSettingsPath())try{this.persist(n,{...i,...a})}catch(l){ut("Error persisting sling.settings.json migration: ",l)}return{...e,...a}}static readGlobalSettings(){let e=this.getGlobalSettingsPath();try{let n=Fn.existsSync(e)?Fn.readFileSync(e,"utf-8"):"",i=n?JSON.parse(n)||{}:{};return this.migrate({...this.defaultsFor(i),...i},e,i)}catch(n){return ut("Error reading global sling.settings.json: ",n),{...this.defaultValues}}}static getClientRegistry(){let e=this.readGlobalSettings()[this.KNOWN_CLIENTS];return{activeKey:String(this.getSettings()[this.ACTIVE_CLIENT]||""),clients:e&&typeof e=="object"?e:{}}}static getKnownClients(){return this.getClientRegistry().clients}static getGlobalActiveClientKey(){return String(this.readGlobalSettings()[this.ACTIVE_CLIENT]||"")}static writeRegistry(e){this.updateSettings({[this.KNOWN_CLIENTS]:e},{scope:"global"})}static patchActiveClient(e){let{activeKey:n,clients:i}=this.getClientRegistry(),r=n?i[n]:void 0;r&&this.writeRegistry({...i,[n]:{...r,...e}})}static applyClient(e,n){let i=this.makeClientKey(e.domain),r=n?.scope??this.resolveWriteScope(),o=this.resolveAppTokenDomainForSave(e.domain),s={...this.getKnownClients()};s[i]={...e,analytics_domain:o,last_used:new Date().toISOString()},this.updateSettings({[this.BASE_URL]:e.domain,[this.ANALYTICS_DOMAIN]:o,[this.CLIENT_ID]:e.client_id||"",[this.PROJECT_ID]:e.project_id||"",[this.WORKSPACE_ID]:e.workspace_id||"",[this.PROJECT_NAME]:e.project_name||"",[this.WORKSPACE_NAME]:e.workspace_name||"",[this.CLIENT_DISPLAY_NAME]:e.client_name||"",[this.ACTIVE_CLIENT]:i,[this.SCHEMA_VERSION]:this.CURRENT_SCHEMA_VERSION},{scope:r}),this.writeRegistry(s)}static recordActiveClientId(e){let n=(e||"").trim();if(!n)return;let{activeKey:i,clients:r}=this.getClientRegistry();(i?r[i]:void 0)?.client_id===n&&this.getDefaultClientId()===n||(this.updateSettings({[this.CLIENT_ID]:n}),this.patchActiveClient({client_id:n}))}static recordActiveAppTokenOverride(e){let n=(e||"").trim();this.patchActiveClient({analytics_domain:n||void 0})}static recordActiveProjectSelection(e){this.patchActiveClient(e)}static hasProjectSelection(){return!!(this.getDefaultProjectId()&&this.getDefaultWorkspaceId())}static getDefaultClientKey(){return this.makeClientKey(String(this.defaultValues[this.BASE_URL]||""))}static removeKnownClient(e){if(!e||e===this.getDefaultClientKey())return!1;let{activeKey:n,clients:i}=this.getClientRegistry();if(e===n||e===this.getGlobalActiveClientKey()||!i[e])return!1;let r={...i};return delete r[e],this.writeRegistry(r),!0}static getLocalSettingsPath(){return Ug.resolve(process.cwd(),".sling","sling.settings.json")}static getGlobalSettingsPath(){return Ug.resolve(ke(),"sling.settings.json")}static getSettingsPath(e){return e==="local"?this.getLocalSettingsPath():e==="global"?this.getGlobalSettingsPath():this.getActivePinPath()??this.getGlobalSettingsPath()}static getActivePinPath(){if(Vz)return null;let e=this.getLocalSettingsPath();return Fn.existsSync(e)?e:null}static disableLocalSettingsForSession(){Vz=!0,Do=null}static getUntrustedPinDomain(){if(!this.getActivePinPath())return null;let e=String(this.getSettings()[this.BASE_URL]||""),n=this.makeClientKey(e);return n?this.getClientRegistry().clients[n]?null:e:null}static trustActivePin(){let e=this.toKnownClient(this.getSettings());if(!e)return!1;let n=this.makeClientKey(e.domain),{clients:i}=this.getClientRegistry();return i[n]||this.writeRegistry({...i,[n]:{...e,last_used:new Date().toISOString()}}),!0}static resolveWriteScope(){return this.getActivePinPath()?"local":"global"}static clearLocalSettings(){let e=this.getLocalSettingsPath();try{return Fn.existsSync(e)?(Fn.unlinkSync(e),Do=null,!0):!1}catch(n){return ut("Error removing local sling.settings.json: ",n),!1}}static loadSettingsFile(e){if(Fn.existsSync(e)){let i=Fn.readFileSync(e,"utf-8"),r=JSON.parse(i)||{};return this.migrate({...this.defaultsFor(r),...r},e,r)}let n=Ug.dirname(e);return Fn.existsSync(n)||Fn.mkdirSync(n,{recursive:!0}),this.migrate({...this.defaultValues},e,{...this.defaultValues})}static getSettings(){if(!Do)try{Do=this.loadSettingsFile(this.getSettingsPath())}catch(n){ut("Error reading/writing sling.settings.json: ",n);let i=this.getActivePinPath();if(i){ut("Ignoring unreadable local pin for this session: ",i),this.disableLocalSettingsForSession();try{Do=this.loadSettingsFile(this.getSettingsPath())}catch(r){ut("Error reading global sling.settings.json: ",r)}}Do||(Do={...this.defaultValues})}let e=Abe(process.env.SLINGSHOT_API_DOMAIN);return{...Do,[t.BASE_URL]:e||Do[t.BASE_URL]}}static updateSettings(e,n){let i=n?.scope??this.resolveWriteScope();if(i==="local"&&this.KNOWN_CLIENTS in e){let{[this.KNOWN_CLIENTS]:r,...o}=e;this.writeToScope({[this.KNOWN_CLIENTS]:r},"global"),Object.keys(o).length>0&&this.writeToScope(o,"local");return}this.writeToScope(e,i)}static writeToScope(e,n){let i=this.getSettingsPath(n);try{let r={};if(Fn.existsSync(i)){let l=Fn.readFileSync(i,"utf-8");r=JSON.parse(l)||{}}let o={...r,...e},s={...this.defaultsFor(o),...o},a=Ug.dirname(i);Fn.existsSync(a)||Fn.mkdirSync(a,{recursive:!0}),Fn.writeFileSync(i,JSON.stringify(s,null,2),"utf-8"),Do=null}catch(r){ut("Error updating sling.settings.json: ",r)}}static getLoginUrl(e){let n=this.getSettings(),i=new URLSearchParams({client:this.CLIENT_NAME,port:String(e.port),localState:e.localState});return e.clientId&&i.set("clientId",e.clientId),`${n[t.BASE_URL]}${this.LOGIN_PATH}?${i.toString()}`}static getExchangeUrl(){return`${this.getSettings()[t.BASE_URL]}${this.EXCHANGE_PATH}`}static getRefreshUrl(){let e=this.getSettings(),n=new URLSearchParams({client:this.REFRESH_CLIENT_NAME});return`${e[t.BASE_URL]}${this.REFRESH_PATH}?${n.toString()}`}static getApiBaseUrl(){return`${this.getSettings()[t.BASE_URL]}${this.API_BASE_PATH}`}static resolvePlatformDomain(){return this.deriveAnalyticsDomain(String(this.getSettings()[t.BASE_URL]||""))}static getAppTokenDomain(){let e=this.getSettings();return String(e[t.ANALYTICS_DOMAIN]||"").trim()||String(e[t.BASE_URL]||"").trim()}static getLegacyPlatformDomain(){return this.resolvePlatformDomain()}static getSageEventsUrl(){return`${this.getLegacyPlatformDomain()}${this.SAGE_EVENTS_PATH}`}static getSlingshotRAGMCPUrl(){return`${this.getLegacyPlatformDomain()}${this.SLINGSHOT_RAG_MCP}`}static getTokenExpiryBuffer(){return this.TOKEN_EXPIRY_BUFFER_MS}static getCacheControlForClaude(){let n=this.getSettings()[t.CACHE_CONTROL]||"5m";return!n||typeof n!="string"||!/^(5m|1h)$/.test(n)?(ut("Invalid cache control value in sling.settings.json, falling back to default: ",n),"5m"):n}static getDefaultProjectId(){let e=this.getSettings();return process.env.SLINGSHOT_PROJECT_ID||e[t.PROJECT_ID]||""}static getDefaultWorkspaceId(){let e=this.getSettings();return process.env.SLINGSHOT_WORKSPACE_ID||e[t.WORKSPACE_ID]||""}static getDefaultClientId(){let e=this.getSettings();return process.env.CLIENT_ID||e[t.CLIENT_ID]||""}static getClientName(){return String(this.getSettings()[t.CLIENT_DISPLAY_NAME]||"").trim()}static recordClientName(e){let n=(e||"").trim();if(!n)return;let{activeKey:i,clients:r}=this.getClientRegistry(),o=i?r[i]:void 0;this.getClientName()===n&&o?.client_name===n||(this.updateSettings({[t.CLIENT_DISPLAY_NAME]:n}),this.patchActiveClient({client_name:n}))}static getEcgResourceKey(){let e=this.getDefaultClientId().trim(),n=this.getDefaultProjectId().trim();return e&&n?`${e}:${n}`:""}static isEcgEnabled(){return this.getSettings()[t.ECG_ENABLED]===!0}static setEcgEnabled(e){this.updateSettings({[t.ECG_ENABLED]:e})}static getEcgSelection(){let e=this.getEcgResourceKey();if(!e)return null;let i=this.getSettings()[t.ECG_RESOURCES]?.[e];return!i||!Array.isArray(i.resources)||i.resources.length===0?null:i}static setEcgSelection(e){let n=this.getEcgResourceKey();if(!n)return;let i={...this.getSettings()[t.ECG_RESOURCES]||{}};!e||e.resources.length===0?delete i[n]:i[n]=e,this.updateSettings({[t.ECG_RESOURCES]:i})}static getQueryClientsUrl(){return`${this.getSettings()[t.BASE_URL]}${this.QUERY_CLIENTS_PATH}`}static getUserActivityUrl(){return`${this.getSettings()[t.BASE_URL]}${this.SAPI}/users/activity`}static getUserUrl(){return`${this.getSettings()[t.BASE_URL]}${this.SAPI}/users`}static getModelsUrl(){return`${this.getSettings()[t.BASE_URL]}${this.SAPI}/ai/models`}static getPrimaryAppTokenUrl(){return`${this.getSettings()[t.BASE_URL]||""}${this.SAPI}/ai-auth/token/app`}static getAppTokenUrl(){return`${this.getAppTokenDomain()}${this.APP_TOKEN_PATH}`}static getAppTokenRefreshBuffer(){return this.APP_TOKEN_REFRESH_BUFFER_MS}static getEcgDomain(){return String(this.getSettings()[t.ECG_DOMAIN]||"").trim().replace(/\/+$/,"")||this.getAppTokenDomain()}static getEcgMcpUrl(){return`${this.getEcgDomain()}${this.ECG_MCP_PATH}`}static getUserResourcesUrl(){return`${this.getEcgDomain()}${this.USER_RESOURCES_PATH}`}};function HI(t,e=!1){let n=t.split(".");if(!(n.length<2||!n[1])&&!(e&&n.length!==3))try{let i=n[1].replace(/-/g,"+").replace(/_/g,"/"),r=(4-(i.length%4||4))%4,o=`${i}${"=".repeat(r)}`,s=JSON.parse(Buffer.from(o,"base64").toString("utf8"));return s&&typeof s=="object"?s:void 0}catch{return}}function ac(t){let e=HI(t,!0)?.exp;return typeof e=="number"?e*1e3:0}function Qz(t){let e=HI(t,!0)?.iss;return typeof e=="string"?e:""}function Jz(t){let e=HI(t);if(!e)return;let n=e.UserInfo&&typeof e.UserInfo=="object"?e.UserInfo:void 0;return{sub:typeof e.sub=="string"?e.sub:void 0,user_id:typeof e.user_id=="string"?e.user_id:typeof n?.id=="string"?n.id:void 0,email:typeof e.email=="string"?e.email:typeof n?.email=="string"?n.email:void 0}}function zI(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}oi();import{randomUUID as Ebe}from"node:crypto";import Yz from"node:fs";import Ibe from"node:path";var Pbe="slingcli",_be=1e4,Lbe=2e3,Obe=1e3,Wbe=5e3,Dbe=6e4,Ube="sling.app-creds.json",lc=null,Fg=null,As=null,GI=0;function eG(){let t=Ibe.resolve(ke(),Ube);try{Yz.existsSync(t)&&(Yz.unlinkSync(t),Me(`app-token: removed legacy app credentials at ${t}`))}catch(e){ut("app-token: failed to remove legacy app credentials",e)}}function Fbe(){let t=uA("slingshot");return t?.type==="oauth"&&typeof t.access=="string"?t.access:void 0}function Bbe(t){As&&(clearTimeout(As),As=null);let e=G.getAppTokenRefreshBuffer(),i=t.realExpiry-Date.now()>e?t.realExpiry-e:t.realExpiry+Lbe;As=setTimeout(()=>{As=null,kn().catch(r=>{ut("app-token: scheduled refresh failed",r)})},Math.max(i-Date.now(),Obe)),As.unref?.()}async function $be(t,e){let n={accept:"application/json","x-app-name":Pbe,"trace-id":Ebe()};e&&(n.authorization=`Bearer ${e}`);try{return await fetch(t,{method:"GET",headers:n,signal:AbortSignal.timeout(Dbe)})}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(`Cannot reach app-token service: ${r}`)}}async function Xz(t){let e=`${t.status} ${t.statusText}`;try{let n=await t.text()||"";n&&(e=n)}catch{}return e}function Nbe(t){if(!t.app_token)throw new Error("App token response missing app_token");let e=typeof t.expires_in=="number"?Date.now()+t.expires_in*1e3:ac(t.app_token);if(!e)throw new Error("App token response missing expires_in and its JWT has no decodable exp claim");return Me(`app-token: minted, expires ${new Date(e).toISOString()}`),{token:t.app_token,usableUntil:e-_be,realExpiry:e}}async function Zz(t,e){let n=await $be(t,e);if(n.ok)return Nbe(await n.json());if(n.status===404)return{notFound:await Xz(n)};throw new Error(`App token request failed: ${await Xz(n)}`)}async function jbe(t){let e=G.getPrimaryAppTokenUrl(),n=t??Fbe();Me(`app-token: minting from ${e}`);let i=await Zz(e,n);if(!("notFound"in i))return i;let r=G.getAppTokenUrl();Me(`app-token: primary 404, falling back to ${r}`);let o=await Zz(r);if("notFound"in o)throw new Error(`App token request failed: ${o.notFound}`);return o}async function kn(t){let e=Date.now();if(lc&&(lc.usableUntil>e||lc.realExpiry>e&&e-GI<Wbe))return lc.token;if(Fg)return(await Fg).token;let n=jbe(t).then(r=>(lc=r,GI=Date.now(),Bbe(r),r)).finally(()=>{Fg=null});return Fg=n,(await n).token}function Bg(){lc=null,Fg=null,GI=0,As&&(clearTimeout(As),As=null)}var $g=null,qI=null;typeof process<"u"&&process.versions?.node&&(qI=import("node:http").then(t=>{$g=t.createServer}));async function Hbe(){if($g||(qI&&await qI,$g))return $g;throw new Error("Slingshot OAuth requires Node.js")}async function KI(t){let e=await Hbe(),n,i,r,o=!1,s=new Promise((u,p)=>{i=u,r=p}),a=u=>{if(!o){o=!0;try{n.close()}catch{}u()}};n=e((u,p)=>{let d=new URL(u.url||"","http://127.0.0.1"),m=d.searchParams.get("code"),g=d.searchParams.get("state"),h=d.searchParams.get("clientId"),f=d.searchParams.get("error"),y=d.searchParams.get("error_description");if(f){p.writeHead(400,{"Content-Type":"text/html"}),p.end(`<html><body><h1>Login Failed</h1><p>${y||f}</p><p>You can close this window.</p></body></html>`),a(()=>r(new Error(`Login failed: ${y||f}`)));return}if(!m||!g){p.writeHead(400,{"Content-Type":"text/html"}),p.end("<html><body><h1>Login Failed</h1><p>Missing code or state in callback.</p><p>You can close this window.</p></body></html>"),a(()=>r(new Error("Missing code or state in callback")));return}p.writeHead(200,{"Content-Type":"text/html"}),p.end("<html><body><h1>Login Successful</h1><p>You can close this window and return to your terminal.</p><script>setTimeout(()=>window.close(),3000)</script></body></html>"),a(()=>i({code:m,state:g,clientId:h||""}))}),n.on("error",u=>{a(()=>r(u))});let l=setTimeout(()=>{a(()=>r(new Error("Login timeout - no callback received within 5 minutes")))},300*1e3);return n.on("close",()=>clearTimeout(l)),t&&t.addEventListener("abort",()=>{a(()=>r(new Error("Login cancelled")))}),{port:await new Promise((u,p)=>{n.once("error",p),n.listen(0,"127.0.0.1",()=>{let d=n.address();d&&typeof d=="object"?u(d.port):p(new Error("Failed to obtain loopback server port"))})}),result:s}}async function VI(t,e){if(!t)throw new Error("Missing exchange code");if(!e)throw new Error("Missing clientId for exchange");let n=G.getExchangeUrl(),i;try{i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({code:t,clientId:e})})}catch(o){let s=o instanceof Error?o.message:String(o);throw new Error(`Cannot reach Studio Auth: ${s}`)}if(!i.ok){let o,s=`${i.status} ${i.statusText}`;try{let a=await i.json();o=a.error?.code,a.error?.message?s=a.error.message:a.message?s=a.message:o&&(s=o)}catch{}throw o==="INVALID_CALLBACK"?new Error("Login failed: exchange code is expired, already used, or bound to a different tenant. Please log in again."):new Error(`Code exchange failed: ${s}`)}let r=await i.json();if(!r.accessToken||!r.refreshToken)throw new Error("Exchange response missing accessToken or refreshToken");return r}function Gbe(){return zbe(16).toString("hex")}function qbe(t){let e=new URL(t),n=e.searchParams.get("code"),i=e.searchParams.get("state"),r=e.searchParams.get("clientId");if(!n||!i)throw new Error("Pasted URL is missing code or state");return{code:n,state:i,clientId:r||""}}async function QI(t){let e=process.env.SLINGSHOT_TOKEN;if(e){let u=ac(e);return Me("Using Slingshot token from SLINGSHOT_TOKEN environment variable"),Bg(),await kn(e),{refresh:"",access:e,expires:u>0?u-G.getTokenExpiryBuffer():Date.now()+10800*1e3,projectId:G.getDefaultProjectId(),workspaceId:G.getDefaultWorkspaceId()}}let{port:n,result:i}=await KI(t.signal),r=Gbe(),o=G.getDefaultClientId(),s=G.getLoginUrl({port:n,localState:r,clientId:o||void 0});t.onAuth({url:s});let a;if(t.onManualCodeInput){let u=t.onManualCodeInput().then(qbe);a=await Promise.race([i,u])}else a=await i;if(a.state!==r)throw new Error("CSRF check failed - state does not match localState");if(!a.clientId)throw new Error("Login callback did not include clientId");let l=await VI(a.code,a.clientId);G.recordActiveClientId(a.clientId);let c=ac(l.accessToken);return Bg(),await kn(l.accessToken),{refresh:l.refreshToken,access:l.accessToken,expires:c>0?c-G.getTokenExpiryBuffer():Date.now()+10800*1e3,projectId:G.getDefaultProjectId(),workspaceId:G.getDefaultWorkspaceId()}}import{randomUUID as Kbe}from"node:crypto";async function JI(t){if(!t.refresh)throw new Error("No refresh token available. Please login again.");let e;try{e=await kn(t.access)}catch(a){throw ut("auth/refresh: app token unavailable for refresh call",a),new Error(`Cannot refresh Slingshot token: app token unavailable (${a instanceof Error?a.message:String(a)}). Please /login slingshot.`)}let n=Kbe(),i={accept:"application/json",rt:t.refresh,"trace-id":n,Authorization:`Bearer ${e}`},r;try{let a=G.getRefreshUrl();r=await fetch(a,{headers:i})}catch(a){let l=a instanceof Error?a.message:String(a);throw new Error(`Cannot reach Slingshot server: ${l}`)}if(!r.ok){let a=`${r.status} ${r.statusText}`;try{let l=await r.json();l.message?a=String(l.message):l.error&&(a=String(l.error))}catch{}throw new Error(`Token refresh failed: ${a}`)}let o=await r.json();if(!o.accessToken)throw new Error("No access token in refresh response");let s=ac(o.accessToken);try{await kn(o.accessToken)}catch(a){throw ut("auth/refresh: app token refresh failed",a),a}return{refresh:o.refreshToken||t.refresh,access:o.accessToken,expires:s>0?s-G.getTokenExpiryBuffer():Date.now()+10800*1e3,projectId:t.projectId,workspaceId:t.workspaceId}}var Vbe=240*1e3,tG=6e4,Gb,qb=0;function nG(t,e){t!==qb&&(qb=t,iG(t,e,t-Vbe-Date.now()))}function iG(t,e,n){clearTimeout(Gb),Gb=setTimeout(async()=>{await e().catch(i=>{Me(`auth/user-token-timer: scheduled refresh failed: ${oG(i)}`)}),qb===t&&Date.now()+tG<t&&iG(t,e,tG)},n),Gb.unref?.()}function rG(){clearTimeout(Gb),qb=0}function oG(t){return t instanceof Error?t.cause===void 0?t.message:`${t.message}: ${oG(t.cause)}`:String(t)}var Td=[{id:"gpt-5.4-nano",name:"GPT-5.4 nano",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-4.1",name:"GPT-4.1",baseUrl:"",reasoning:!1,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:1047576,maxTokens:32768,provider:"slingshot",api:"openai-completions"},{id:"gpt-5",name:"GPT-5",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.125,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5-mini",name:"GPT-5 Mini",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5-nano",name:"GPT-5 Nano",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.05,output:.4,cacheRead:.005,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5.1",name:"GPT-5.1",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.25,output:10,cacheRead:.13,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5.2",name:"GPT-5.2",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"gpt-5.4-mini",name:"GPT-5.4 mini",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.4",name:"GPT-5.4",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0},contextWindow:272e3,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.5",name:"GPT-5.5",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0},contextWindow:272e3,maxTokens:128e3,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:.96,output:5.76,cacheRead:.096,cacheWrite:0},contextWindow:105e4,maxTokens:5e5,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:2.4,output:14.4,cacheRead:.24,cacheWrite:0},contextWindow:105e4,maxTokens:5e5,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh"},input:["text","image"],cost:{input:4.8,output:28.8,cacheRead:.48,cacheWrite:0},contextWindow:105e4,maxTokens:5e5,api:"openai-responses",provider:"slingshot"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,provider:"slingshot",api:"openai-responses"},{id:"claude-opus-4@20250514",name:"Claude Opus 4",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},contextWindow:2e5,maxTokens:32e3,provider:"slingshot",api:"anthropic-messages",compat:{supportsEagerToolInputStreaming:!1}},{id:"claude-sonnet-4@20250514",name:"Claude Sonnet 4",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages",compat:{supportsEagerToolInputStreaming:!1}},{id:"claude-sonnet-4-5@20250929",name:"Claude Sonnet 4.5",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:2e5,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages",compat:{supportsEagerToolInputStreaming:!1}},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",baseUrl:"",reasoning:!0,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-opus-4-6",name:"Claude Opus 4.6",baseUrl:"",reasoning:!0,thinkingLevelMap:{max:"max"},compat:{forceAdaptiveThinking:!0},input:["text","image"],cost:{input:5,output:25,cacheRead:.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:128e3,provider:"slingshot",api:"anthropic-messages"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",baseUrl:"",reasoning:!0,thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0},input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1e5,maxTokens:64e3,provider:"slingshot",api:"anthropic-messages"},{id:"Qwen/Qwen3.6-27B-FP8",name:"Qwen 3.6 27B FP8",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.2,output:3.6,cacheRead:.3,cacheWrite:3.75},contextWindow:64e3,maxTokens:56e3,provider:"slingshot",api:"openai-completions"},{id:"o3",name:"O3",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:2,output:8,cacheRead:.5,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,provider:"slingshot",api:"openai-completions"},{id:"o3-mini",name:"o3-mini",baseUrl:"",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,provider:"slingshot",api:"openai-completions"},{id:"o4-mini",name:"o4-mini",baseUrl:"",reasoning:!0,input:["text"],cost:{input:1.1,output:4.4,cacheRead:.28,cacheWrite:0},contextWindow:2e5,maxTokens:1e5,provider:"slingshot",api:"openai-completions"},{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:.44,output:1.32,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:65535,provider:"slingshot",api:"openai-completions"},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",baseUrl:"",reasoning:!0,input:["text","image"],cost:{input:1.76,output:10.56,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:65535,provider:"slingshot",api:"openai-completions"}];var Kb=t=>Math.round((t??0)*1e3*1e6)/1e6,Qbe=32768,Jbe=16384,Ybe=new Map(Td.map(t=>[t.id,t.maxTokens])),Xbe=new Map(Td.filter(t=>t.api==="anthropic-messages"&&t.thinkingLevelMap).map(t=>[t.id,t.thinkingLevelMap])),Zbe=[/claude-3[-_]/,/claude-(?:sonnet|opus|haiku)-4-5/,/claude-(?:sonnet|opus)-4(?!-[6-9])/];function eSe(t){let e=t.toLowerCase();return!Zbe.some(n=>n.test(e))}function YI(t){if(t.api!=="anthropic-messages")return t;let e={...t},n={...t.compat};eSe(t.id)?(n.forceAdaptiveThinking=!0,delete n.supportsEagerToolInputStreaming):(delete n.forceAdaptiveThinking,n.supportsEagerToolInputStreaming=!1),Object.keys(n).length?e.compat=n:delete e.compat;let i=Xbe.get(t.id);return i&&(e.thinkingLevelMap={...i,...t.thinkingLevelMap}),e}async function sG(t,e){let n=await fetch(t,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!n.ok)throw new Error(`Slingshot models fetch failed: ${n.status}`);let i=await n.json();return tSe(Array.isArray(i)?i:i?.data??[])}function tSe(t){return t.filter(e=>e.model_type==="chat").map(e=>{let n=e.metadata??{},i=typeof n.family=="string"?n.family.trim():"",r=i==="smart",o=e.provider==="claude"||i==="anthropic",s=n.context_length??0,a=(n.supported_modalities??["text"]).filter(l=>l==="text"||l==="image");return YI({id:e.id,name:n.name||e.id,baseUrl:"",reasoning:r?!1:!!n.reasoning,input:a,cost:{input:Kb(e.inputCostPer1KTokens),output:Kb(e.outputCostPer1KTokens),cacheRead:Kb(e.cacheCostPer1KTokens?.read),cacheWrite:Kb(e.cacheCostPer1KTokens?.write)},contextWindow:s,maxTokens:Math.min(s,r?Jbe:Ybe.get(e.id)??Qbe),provider:"slingshot",api:r?"openai-completions":o?"anthropic-messages":e.supported_apis?.includes("responses")?"openai-responses":"openai-completions",...i===""?{}:{family:i}})}).sort((e,n)=>e.id.localeCompare(n.id))}import aG from"node:fs";function lG(t,e,n){try{aG.writeFileSync(t,JSON.stringify({baseUrl:e,fetchedAt:new Date().toISOString(),models:n}))}catch{}}function XI(t,e){try{let n=JSON.parse(aG.readFileSync(t,"utf-8"));return n?.baseUrl!==e||!Array.isArray(n.models)||n.models.length===0?null:n.models.map(YI)}catch{return null}}oi();import Vb from"node:fs";import cG from"node:path";import nSe from"proper-lockfile";var iSe=250;function rSe(){return cG.resolve(ke(),"settings.json")}function oSe(t){if(!Vb.existsSync(t))return{};try{let e=JSON.parse(Vb.readFileSync(t,"utf-8"));return e===null||typeof e!="object"||Array.isArray(e)?(Me(`default-model: refusing to write to non-object settings at ${t}`),null):e}catch(e){return Me(`default-model: could not parse ${t}, leaving it alone: ${ZI(e)}`),null}}async function sSe(t,e,n){let i;try{Vb.mkdirSync(cG.dirname(t),{recursive:!0}),i=await nSe.lock(t,{realpath:!1,retries:{retries:10,minTimeout:20,maxTimeout:200},onCompromised:o=>Me(`default-model: settings lock compromised: ${ZI(o)}`)});let r=oSe(t);return r===null?!1:(r.defaultProvider===e&&r.defaultModel===n||(r.defaultProvider=e,r.defaultModel=n,Vb.writeFileSync(t,`${JSON.stringify(r,null,2)}
573
573
  `,"utf-8"),Me(`default-model: recorded ${e}/${n}`)),!0)}catch(r){return Me(`default-model: failed to record ${e}/${n}: ${ZI(r)}`),!1}finally{await i?.().catch(()=>{})}}function ZI(t){return t instanceof Error?t.message:String(t)}function eP(t){let e,n;async function i(){n=void 0;let r=e;e=void 0,r&&await sSe(rSe(),r.provider,r.modelId)}t.on("model_select",async r=>{r.source!=="restore"&&(e={provider:r.model.provider,modelId:r.model.id},n&&clearTimeout(n),n=setTimeout(()=>{i()},iSe),n.unref?.())}),t.on("session_shutdown",async()=>{n&&clearTimeout(n),await i()})}var tP="slingshot-smart-model-attribution";function Ng(t){return typeof t=="string"&&t.trim().length>0}function Qb(t){let e=new Set;for(let n of t)Ng(n.family)&&n.family==="smart"&&e.add(n.id);return e}function uG(t){return{smartModelIds:new Set(t),pendingResponseModel:void 0}}function nP(t,e){t.smartModelIds=new Set(e)}function pG(t){t.pendingResponseModel=void 0}function dG(t){return t===null||typeof t!="object"||Array.isArray(t)?null:t}function mG(t,e){let n=dG(e);if(n===null)return;let i,r,o,s;try{i=n.role,r=n.provider,o=n.model,s=n.responseModel}catch{return}i==="assistant"&&r==="slingshot"&&Ng(o)&&t.smartModelIds.has(o)&&Ng(s)&&(t.pendingResponseModel=s)}function hG(t,e){if(!Ng(t.pendingResponseModel))return;let n=t.pendingResponseModel;try{e({responseModel:n})}catch{}finally{t.pendingResponseModel=void 0}}function gG(t){let e=dG(t);return e===null?!1:Ng(e.responseModel)}se();function fG(t,e){let n;try{if(t===null||typeof t!="object")return;n=t.responseModel}catch{return}let i={responseModel:n};if(!gG(i))return;let r=i.responseModel.replace(/[\x00-\x1f\x7f-\x9f]/g,"").trim();if(r.length!==0)return new O(e.fg("dim",`Model used: ${r}`),0,0)}function iP(t,e){let n=new Headers(e.headers);return n.delete("content-length"),n.delete("content-encoding"),new Response(t,{status:e.status,statusText:e.statusText,headers:n})}function aSe(t){let e=new TextDecoder,n=new TextEncoder,i="";return new TransformStream({transform(r,o){i+=e.decode(r,{stream:!0});let s=i.split(`
574
574
  `);i=s.pop()??"",s.length>0&&o.enqueue(n.encode(`${s.map(t).join(`
575
575
  `)}
576
- `))},flush(r){i&&r.enqueue(n.encode(t(i)))}})}function Jb(t,e,n,i){return async(r,o)=>{let s=await t(r,o);if(!s.ok||!s.body)return s;let a=s.headers.get("content-type")??"";if(a.includes("event-stream"))return iP(s.body.pipeThrough(aSe(i)),s);if(!a.includes("json"))return s;let l=await s.text();if(!l.includes(e))return iP(l,s);let c=n(l);return iP(c??l,s)}}var xG="_input_tokens";function yG(t){if(!t)return!1;let e=t.prompt_tokens_details??{},n=e.cached_tokens??t.cache_read_input_tokens,i=e.cache_write_tokens??t.cache_creation_input_tokens;return n===e.cached_tokens&&i===e.cache_write_tokens?!1:(t.prompt_tokens_details={...e,cached_tokens:n??0,cache_write_tokens:i??0},!0)}function vG(t){let e=yG(t?.usage);for(let n of t?.choices??[])yG(n?.usage)&&(e=!0);return e}function lSe(t){if(!t.startsWith("data: ")||!t.includes(xG))return t;try{let e=JSON.parse(t.slice(6));return vG(e)?`data: ${JSON.stringify(e)}`:t}catch{return t}}function bG(t=globalThis.fetch){return Jb(t,xG,e=>{try{let n=JSON.parse(e);return vG(n)?JSON.stringify(n):null}catch{return null}},lSe)}var Yb=null,rP=null;function Cd(){return Yb}function SG(){Yb=null,rP=null}function cSe(t){Yb=(Yb??0)+t,rP=t}var wG='"usage"';function TG(t){if(!t||typeof t!="object")return;let n=t.usage;if(n&&typeof n=="object"){let i=n.cost;if(i&&typeof i=="object"){let r=i.totalCost;typeof r=="number"&&Number.isFinite(r)&&cSe(r)}}}function uSe(t){if(!t.startsWith("data: ")||!t.includes(wG))return t;try{TG(JSON.parse(t.slice(6)))}catch{}return t}function CG(t=globalThis.fetch){let e=Jb(t,wG,n=>{try{TG(JSON.parse(n))}catch{}return null},uSe);return async(n,i)=>(rP=null,e(n,i))}var pSe=["patternProperties"];function dSe(t){return typeof t=="string"&&t.toLowerCase().includes("gemini")}function oP(t){if(Array.isArray(t)){let i=!1;for(let r of t)oP(r)&&(i=!0);return i}if(typeof t!="object"||t===null)return!1;let e=!1,n=t;for(let i of pSe)i in n&&(delete n[i],e=!0);for(let i of Object.values(n))oP(i)&&(e=!0);return e}function MG(t){if(typeof t!="object"||t===null)return!1;let{model:e,tools:n}=t;return!dSe(e)||!Array.isArray(n)?!1:oP(n)}function kG(t,{api:e,userToken:n,appToken:i,appContext:r,claudeCacheControl:o}){if(t["X-App-Authorization"]=`Bearer ${i}`,t["x-app-context"]=Buffer.from(JSON.stringify(r)).toString("base64"),e==="anthropic-messages"){t.Authorization=`Bearer ${n}`,t["X-Api-Key"]=null;return}t["x-claude-cache-control"]=o}Um();oi();import cc from"node:fs";import mSe from"node:path";var hSe="auth.json",sP="slingshot",gSe=3e4,fSe=2e3,ySe=50,xSe=t=>new Promise(e=>setTimeout(e,t));async function vSe(t){let e=`${t}.lock`,n=Date.now()+fSe;for(;;)try{return cc.mkdirSync(e),()=>{try{cc.rmdirSync(e)}catch{}}}catch(i){if(i.code!=="EEXIST")throw i;try{if(Date.now()-cc.statSync(e).mtimeMs>gSe){cc.rmdirSync(e);continue}}catch{}if(Date.now()>=n)return null;await xSe(ySe)}}async function bSe(){let t=mSe.resolve(ke(),hSe),e=null;try{if(!cc.existsSync(t))return;if(e=await vSe(t),!e){Me(`client-state: could not lock ${t}; leaving stored credential in place`);return}let n=cc.readFileSync(t,"utf-8"),i=JSON.parse(n);if(!i||typeof i!="object"||Array.isArray(i)||!(sP in i))return;delete i[sP],cc.writeFileSync(t,JSON.stringify(i,null,2),"utf-8"),Me(`client-state: cleared "${sP}" credential from ${t}`)}catch(n){ut("client-state: failed to clear stored user credential",n)}finally{e?.()}}async function jg(){Bg(),await bSe(),Me("client-state: reset complete")}var Xb={name:"slingshot.cli",private:!0,type:"module",workspaces:["packages/*"],scripts:{clean:"npm run clean --workspaces",build:"cd packages/telemetry && npm run build && cd ../chord && npm run build && cd ../protocol && npm run build && cd ../client && npm run build && cd ../tui && npm run build && cd ../ai && npm run build && cd ../agent && npm run build && cd ../codemode && npm run build && cd ../mcp && npm run build && cd ../server && npm run build && cd ../coding-agent && npm run build","build:offline":"cd packages/telemetry && npm run build && cd ../chord && npm run build && cd ../protocol && npm run build && cd ../client && npm run build && cd ../tui && npm run build && cd ../ai && npm run build:offline && cd ../agent && npm run build && cd ../codemode && npm run build && cd ../mcp && npm run build && cd ../server && npm run build && cd ../coding-agent && npm run build",dev:'concurrently --names "ai,agent,coding-agent,web-ui,tui" --prefix-colors "cyan,yellow,red,white,green,magenta" "cd packages/ai && npm run dev" "cd packages/agent && npm run dev" "cd packages/coding-agent && npm run dev" "cd packages/server && npm run dev" "cd packages/tui && npm run dev"',"dev:tsc":'concurrently --names "ai,web-ui" --prefix-colors "cyan,green" "cd packages/ai && npm run dev:tsc" "cd packages/web-ui && npm run dev:tsc"',check:"","check:browser-smoke":"","test:models":"node scripts/test-models.mjs","profile:tui":"node scripts/profile-coding-agent-node.mjs --mode tui","profile:rpc":"node scripts/profile-coding-agent-node.mjs --mode rpc",test:"npm run test --workspaces --if-present","version:patch":"npm version patch -ws --no-git-tag-version && node scripts/sync-versions.js && shx rm -rf node_modules packages/*/node_modules package-lock.json && npm install","version:minor":"npm version minor -ws --no-git-tag-version && node scripts/sync-versions.js && shx rm -rf node_modules packages/*/node_modules package-lock.json && npm install","version:major":"npm version major -ws --no-git-tag-version && node scripts/sync-versions.js && shx rm -rf node_modules packages/*/node_modules package-lock.json && npm install","version:set":"npm version -ws",prepublishOnly:"npm run clean && npm run build && npm run check",publish:"npm run prepublishOnly && npm publish -ws --access public","publish:dry":"npm run prepublishOnly && npm publish -ws --access public --dry-run","release:patch":"node scripts/release.mjs patch","release:minor":"node scripts/release.mjs minor","release:major":"node scripts/release.mjs major",prepare:"husky"},devDependencies:{"@types/better-sqlite3":"^7.6.13","@types/lodash.mergewith":"^4.6.9","@types/turndown":"^5.0.6",concurrently:"^9.2.3","fast-xml-parser":"^5.9.3",jiti:"2.7.0",psadk:"^1.5.1",turbo:"^2.9.18",vitest:"^4.1.11","@anthropic-ai/sandbox-runtime":"0.0.26","@biomejs/biome":"2.3.5","@types/node":"22.19.19","@typescript/native-preview":"7.0.0-dev.20260120.1",esbuild:"0.28.2",husky:"9.1.7",shx:"0.4.0",tsx:"4.22.1",typescript:"5.9.3"},engines:{node:">=20.0.0"},slingVersion:"3.5.20261026-1",overrides:{rimraf:"6.1.2",gaxios:{rimraf:"6.1.2"},postcss:"8.5.28",next:{postcss:"8.5.28"},"ip-address":"10.7.4","fast-uri":"3.1.8","brace-expansion":"5.0.12","proxy-addr":"2.0.8",undici:"8.12.2","@modelcontextprotocol/sdk":"^1.32.0",ai:">=5.0.52","fast-xml-parser":"^5.9.3","@aws-sdk/xml-builder":{"fast-xml-parser":"^5.9.3"},"adaptivecards-templating":{"adaptive-expressions":{"fast-xml-parser":"^5.5.8"}},picomatch:"^4.0.4","path-to-regexp":"8.4.1",router:{"path-to-regexp":"8.4.1"},minimatch:"^10.2.3",tar:"7.5.22",react:"19.1.1","react-dom":"19.1.1","@types/react":"19","@types/react-dom":"19",tailwindcss:"4.1.12",lightningcss:"1.30.2",glob:{".":"13.0.6",minimatch:"10.2.3"},prismjs:"^1.30.0",qs:"6.16.1","shell-quote":"1.9.0","@hono/node-server":"1.19.15",protobufjs:"^8.8.0","@opentelemetry/otlp-transformer":{protobufjs:"^8.8.0"},langchain:{langsmith:">=0.7.0"},hono:"4.13.7",fsevents:"^2.3.3",swiper:"^12.1.2",lodash:"^4.18.0","lodash-es":"^4.18.1",axios:"^1.20.0","ibm-cloud-sdk-core":"^5.4.11",dompurify:">=3.4.15","react-markdown-mermaid":{mermaid:"10.9.8"}},dependencies:{"@modelcontextprotocol/sdk":"^1.32.0","@mozilla/readability":"^0.6.0","better-sqlite3":"^12.11.1","compound-engineering-pi":"^0.2.4","get-east-asian-width":"^1.4.0",linkedom:"^0.18.12",turndown:"^7.2.4",unpdf:"^1.6.2"}};import Hg from"chalk";function RG(t,e){return{render(n){let i=` \u26AC _______. __ __ .__ __. _______
576
+ `))},flush(r){i&&r.enqueue(n.encode(t(i)))}})}function Jb(t,e,n,i){return async(r,o)=>{let s=await t(r,o);if(!s.ok||!s.body)return s;let a=s.headers.get("content-type")??"";if(a.includes("event-stream"))return iP(s.body.pipeThrough(aSe(i)),s);if(!a.includes("json"))return s;let l=await s.text();if(!l.includes(e))return iP(l,s);let c=n(l);return iP(c??l,s)}}var xG="_input_tokens";function yG(t){if(!t)return!1;let e=t.prompt_tokens_details??{},n=e.cached_tokens??t.cache_read_input_tokens,i=e.cache_write_tokens??t.cache_creation_input_tokens;return n===e.cached_tokens&&i===e.cache_write_tokens?!1:(t.prompt_tokens_details={...e,cached_tokens:n??0,cache_write_tokens:i??0},!0)}function vG(t){let e=yG(t?.usage);for(let n of t?.choices??[])yG(n?.usage)&&(e=!0);return e}function lSe(t){if(!t.startsWith("data: ")||!t.includes(xG))return t;try{let e=JSON.parse(t.slice(6));return vG(e)?`data: ${JSON.stringify(e)}`:t}catch{return t}}function bG(t=globalThis.fetch){return Jb(t,xG,e=>{try{let n=JSON.parse(e);return vG(n)?JSON.stringify(n):null}catch{return null}},lSe)}var Yb=null,rP=null;function Cd(){return Yb}function SG(){Yb=null,rP=null}function cSe(t){Yb=(Yb??0)+t,rP=t}var wG='"usage"';function TG(t){if(!t||typeof t!="object")return;let n=t.usage;if(n&&typeof n=="object"){let i=n.cost;if(i&&typeof i=="object"){let r=i.totalCost;typeof r=="number"&&Number.isFinite(r)&&cSe(r)}}}function uSe(t){if(!t.startsWith("data: ")||!t.includes(wG))return t;try{TG(JSON.parse(t.slice(6)))}catch{}return t}function CG(t=globalThis.fetch){let e=Jb(t,wG,n=>{try{TG(JSON.parse(n))}catch{}return null},uSe);return async(n,i)=>(rP=null,e(n,i))}var pSe=["patternProperties"];function dSe(t){return typeof t=="string"&&t.toLowerCase().includes("gemini")}function oP(t){if(Array.isArray(t)){let i=!1;for(let r of t)oP(r)&&(i=!0);return i}if(typeof t!="object"||t===null)return!1;let e=!1,n=t;for(let i of pSe)i in n&&(delete n[i],e=!0);for(let i of Object.values(n))oP(i)&&(e=!0);return e}function MG(t){if(typeof t!="object"||t===null)return!1;let{model:e,tools:n}=t;return!dSe(e)||!Array.isArray(n)?!1:oP(n)}function kG(t,{api:e,userToken:n,appToken:i,appContext:r,claudeCacheControl:o}){if(t["X-App-Authorization"]=`Bearer ${i}`,t["x-app-context"]=Buffer.from(JSON.stringify(r)).toString("base64"),e==="anthropic-messages"){t.Authorization=`Bearer ${n}`,t["X-Api-Key"]=null;return}t["x-claude-cache-control"]=o}Um();oi();import cc from"node:fs";import mSe from"node:path";var hSe="auth.json",sP="slingshot",gSe=3e4,fSe=2e3,ySe=50,xSe=t=>new Promise(e=>setTimeout(e,t));async function vSe(t){let e=`${t}.lock`,n=Date.now()+fSe;for(;;)try{return cc.mkdirSync(e),()=>{try{cc.rmdirSync(e)}catch{}}}catch(i){if(i.code!=="EEXIST")throw i;try{if(Date.now()-cc.statSync(e).mtimeMs>gSe){cc.rmdirSync(e);continue}}catch{}if(Date.now()>=n)return null;await xSe(ySe)}}async function bSe(){let t=mSe.resolve(ke(),hSe),e=null;try{if(!cc.existsSync(t))return;if(e=await vSe(t),!e){Me(`client-state: could not lock ${t}; leaving stored credential in place`);return}let n=cc.readFileSync(t,"utf-8"),i=JSON.parse(n);if(!i||typeof i!="object"||Array.isArray(i)||!(sP in i))return;delete i[sP],cc.writeFileSync(t,JSON.stringify(i,null,2),"utf-8"),Me(`client-state: cleared "${sP}" credential from ${t}`)}catch(n){ut("client-state: failed to clear stored user credential",n)}finally{e?.()}}async function jg(){Bg(),await bSe(),Me("client-state: reset complete")}var Xb={name:"slingshot.cli",private:!0,type:"module",workspaces:["packages/*"],scripts:{clean:"npm run clean --workspaces",build:"cd packages/telemetry && npm run build && cd ../chord && npm run build && cd ../protocol && npm run build && cd ../client && npm run build && cd ../tui && npm run build && cd ../ai && npm run build && cd ../agent && npm run build && cd ../codemode && npm run build && cd ../mcp && npm run build && cd ../server && npm run build && cd ../coding-agent && npm run build","build:offline":"cd packages/telemetry && npm run build && cd ../chord && npm run build && cd ../protocol && npm run build && cd ../client && npm run build && cd ../tui && npm run build && cd ../ai && npm run build:offline && cd ../agent && npm run build && cd ../codemode && npm run build && cd ../mcp && npm run build && cd ../server && npm run build && cd ../coding-agent && npm run build",dev:'concurrently --names "ai,agent,coding-agent,web-ui,tui" --prefix-colors "cyan,yellow,red,white,green,magenta" "cd packages/ai && npm run dev" "cd packages/agent && npm run dev" "cd packages/coding-agent && npm run dev" "cd packages/server && npm run dev" "cd packages/tui && npm run dev"',"dev:tsc":'concurrently --names "ai,web-ui" --prefix-colors "cyan,green" "cd packages/ai && npm run dev:tsc" "cd packages/web-ui && npm run dev:tsc"',check:"","check:browser-smoke":"","test:models":"node scripts/test-models.mjs","profile:tui":"node scripts/profile-coding-agent-node.mjs --mode tui","profile:rpc":"node scripts/profile-coding-agent-node.mjs --mode rpc",test:"npm run test --workspaces --if-present","version:patch":"npm version patch -ws --no-git-tag-version && node scripts/sync-versions.js && shx rm -rf node_modules packages/*/node_modules package-lock.json && npm install","version:minor":"npm version minor -ws --no-git-tag-version && node scripts/sync-versions.js && shx rm -rf node_modules packages/*/node_modules package-lock.json && npm install","version:major":"npm version major -ws --no-git-tag-version && node scripts/sync-versions.js && shx rm -rf node_modules packages/*/node_modules package-lock.json && npm install","version:set":"npm version -ws",prepublishOnly:"npm run clean && npm run build && npm run check",publish:"npm run prepublishOnly && npm publish -ws --access public","publish:dry":"npm run prepublishOnly && npm publish -ws --access public --dry-run","release:patch":"node scripts/release.mjs patch","release:minor":"node scripts/release.mjs minor","release:major":"node scripts/release.mjs major",prepare:"husky"},devDependencies:{"@types/better-sqlite3":"^7.6.13","@types/lodash.mergewith":"^4.6.9","@types/turndown":"^5.0.6",concurrently:"^9.2.3","fast-xml-parser":"^5.9.3",jiti:"2.7.0",psadk:"^1.5.1",turbo:"^2.9.18",vitest:"^4.1.11","@anthropic-ai/sandbox-runtime":"0.0.26","@biomejs/biome":"2.3.5","@types/node":"22.19.19","@typescript/native-preview":"7.0.0-dev.20260120.1",esbuild:"0.28.2",husky:"9.1.7",shx:"0.4.0",tsx:"4.22.1",typescript:"5.9.3"},engines:{node:">=20.0.0"},slingVersion:"3.6.20261105-1",overrides:{rimraf:"6.1.2",gaxios:{rimraf:"6.1.2"},postcss:"8.5.28",next:{postcss:"8.5.28"},"ip-address":"10.7.4","fast-uri":"3.1.8","brace-expansion":"5.0.12","proxy-addr":"2.0.8",undici:"8.12.2","@modelcontextprotocol/sdk":"^1.32.0",ai:">=5.0.52","fast-xml-parser":"^5.9.3","@aws-sdk/xml-builder":{"fast-xml-parser":"^5.9.3"},"adaptivecards-templating":{"adaptive-expressions":{"fast-xml-parser":"^5.5.8"}},picomatch:"^4.0.4","path-to-regexp":"8.4.1",router:{"path-to-regexp":"8.4.1"},minimatch:"^10.2.3",tar:"7.5.22",react:"19.1.1","react-dom":"19.1.1","@types/react":"19","@types/react-dom":"19",tailwindcss:"4.1.12",lightningcss:"1.30.2",glob:{".":"13.0.6",minimatch:"10.2.3"},prismjs:"^1.30.0",qs:"6.16.1","shell-quote":"1.9.0","@hono/node-server":"1.19.15",protobufjs:"^8.8.0","@opentelemetry/otlp-transformer":{protobufjs:"^8.8.0"},langchain:{langsmith:">=0.7.0"},hono:"4.13.7",fsevents:"^2.3.3",swiper:"^12.1.2",lodash:"^4.18.0","lodash-es":"^4.18.1",axios:"^1.20.0","ibm-cloud-sdk-core":"^5.4.11",dompurify:">=3.4.15","react-markdown-mermaid":{mermaid:"10.9.8"}},dependencies:{"@modelcontextprotocol/sdk":"^1.32.0","@mozilla/readability":"^0.6.0","better-sqlite3":"^12.11.1","compound-engineering-pi":"^0.2.4","get-east-asian-width":"^1.4.0",linkedom:"^0.18.12",turndown:"^7.2.4",unpdf:"^1.6.2"}};import Hg from"chalk";function RG(t,e){return{render(n){let i=` \u26AC _______. __ __ .__ __. _______
577
577
  \u274D \xB7 \u274D / || | | | | \\ | | / _____|
578
578
  \u2726 \u26AC \u2726 | (----\`| | | | | \\| | | | __
579
579
  \u26AC \xB7 \u26AC \u26AC \xB7 \u26AC \\ \\ | | | | | . \` | | | |_ |