@psnext/slingcli 2.5.20260623-1 → 2.5.20260705-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@aws/lambda-invoke-store/README.md +25 -1
- package/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +12 -0
- package/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +12 -0
- package/node_modules/@aws/lambda-invoke-store/dist-types/invoke-store.d.ts +6 -0
- package/node_modules/@aws/lambda-invoke-store/package.json +1 -1
- package/node_modules/@aws-sdk/core/account-id-endpoint.d.ts +1 -3
- package/node_modules/@aws-sdk/core/client.d.ts +1 -3
- package/node_modules/@aws-sdk/core/httpAuthSchemes.d.ts +1 -3
- package/node_modules/@aws-sdk/core/package.json +10 -17
- package/node_modules/@aws-sdk/core/protocols.d.ts +1 -3
- package/node_modules/@aws-sdk/core/util.d.ts +1 -3
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +172 -1
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +58 -3
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -8
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/cognito-identity.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +13 -25
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +13 -17
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +12 -15
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +12 -15
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +13 -25
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetIdCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commandBuilder.js +8 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +2 -17
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commands/GetIdCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commandBuilder.d.ts +46 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commands/GetIdCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commandBuilder.d.ts +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/commandBuilder.d.ts +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/commandBuilder.d.ts +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commandBuilder.d.ts +46 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commands/AssumeRoleCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/package.json +8 -10
- package/node_modules/@aws-sdk/nested-clients/signin.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/sso-oidc.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/sso.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/sts.d.ts +1 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +236 -3
- package/node_modules/@aws-sdk/xml-builder/package.json +3 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +10 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +9 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +20 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +51 -47
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +11 -17
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +25 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare.js +0 -18
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +8 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +8 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +68 -43
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +38 -29
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +189 -204
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +26 -35
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +4 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +11 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +19 -4
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +81 -7
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +60 -45
- package/node_modules/@earendil-works/pi-ai/dist/images-models.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +149 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +18 -34
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +39 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +85 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js +13 -13
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +1 -20
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +20 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js +72 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +23 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +16 -16
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +90 -17
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +390 -102
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +39 -20
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +389 -80
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +15 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +109 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +95 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +15 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +87 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -33
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +13 -25
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +50 -34
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +13 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +11 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +11 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +33 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +2 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +15 -18
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +96 -73
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +19 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/timings.js +24 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +20 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +12 -25
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +20 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +23 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +52 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +12 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +14 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +60 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +19 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +180 -155
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +14 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/rpc-entry.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-convert.js +21 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-process.js +83 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/mime.js +41 -0
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
- package/node_modules/@earendil-works/pi-coding-agent/package.json +8 -5
- package/node_modules/@earendil-works/pi-orchestrator/dist/cli.js +136 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/config.js +55 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/handler.js +105 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/index.js +11 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/client.js +56 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/protocol.js +12 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/server.js +145 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/radius.js +365 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/rpc-process.js +168 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/serve.js +70 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/storage.js +58 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/supervisor.js +290 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-orchestrator/package.json +45 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -0
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +358 -145
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +462 -142
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +358 -145
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +18 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +108 -63
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +11 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +5 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +30 -36
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +85 -137
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +30 -36
- package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js +30 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js +24 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/index.browser.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/checksum/index.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/checksum/index.native.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Js.js +92 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Node.js +29 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Js.js +179 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js +59 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256WebCrypto.js +71 -0
- package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client-command-builder.js +17 -0
- package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js +6 -1
- package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.js +92 -0
- package/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js +3 -56
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js +5 -3
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js +7 -6
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js +15 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.js +35 -27
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js +12 -38
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js +18 -33
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.browser.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Js.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Node.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/index.browser.d.ts +7 -1
- package/node_modules/@smithy/core/dist-types/submodules/checksum/index.d.ts +7 -1
- package/node_modules/@smithy/core/dist-types/submodules/checksum/index.native.d.ts +7 -1
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Js.d.ts +19 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Node.d.ts +17 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Js.d.ts +28 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Node.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256WebCrypto.d.ts +22 -0
- package/node_modules/@smithy/core/dist-types/submodules/client/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/client-command-builder.d.ts +22 -0
- package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/command.d.ts +5 -6
- package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/config/defaults-mode/constants.d.ts +12 -0
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.browser.d.ts +4 -5
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +4 -5
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.d.ts +3 -4
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/endpointMiddleware.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/getEndpointPlugin.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/submodules/serde/concatBytes.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/checksum/ChecksumStream.d.ts +29 -12
- package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.browser.d.ts +8 -2
- package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.d.ts +4 -1
- package/node_modules/@smithy/core/package.json +5 -5
- package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -55
- package/node_modules/@smithy/fetch-http-handler/dist-es/index.js +2 -2
- package/node_modules/@smithy/fetch-http-handler/dist-types/index.d.ts +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
- package/node_modules/@smithy/signature-v4/package.json +3 -4
- package/node_modules/@smithy/types/dist-types/index.d.ts +1 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +64 -25
- package/node_modules/@types/node/crypto.d.ts +18 -5
- package/node_modules/@types/node/diagnostics_channel.d.ts +254 -23
- package/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +3 -0
- package/node_modules/@types/node/fs.d.ts +21 -6
- package/node_modules/@types/node/http.d.ts +25 -0
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/process.d.ts +14 -1
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/sqlite.d.ts +55 -0
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream.d.ts +32 -0
- package/node_modules/@types/node/test.d.ts +112 -2
- package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
- package/node_modules/@types/node/util.d.ts +19 -2
- package/node_modules/@types/node/v8.d.ts +84 -2
- package/node_modules/@types/node/worker_threads.d.ts +8 -7
- package/node_modules/brace-expansion/dist/commonjs/index.js +24 -14
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +24 -14
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -2
- package/node_modules/google-auth-library/build/src/auth/googleauth.js +1 -1
- package/node_modules/google-auth-library/package.json +4 -4
- package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +5 -2
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/parse.js +3 -0
- package/package.json +7 -6
- package/slingshot/index.js +293 -295
- package/node_modules/@aws-crypto/crc32/CHANGELOG.md +0 -100
- package/node_modules/@aws-crypto/crc32/LICENSE +0 -201
- package/node_modules/@aws-crypto/crc32/README.md +0 -16
- package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js +0 -31
- package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/main/index.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/main/index.js +0 -108
- package/node_modules/@aws-crypto/crc32/build/main/index.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js +0 -28
- package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/module/index.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/module/index.js +0 -103
- package/node_modules/@aws-crypto/crc32/build/module/index.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/package.json +0 -32
- package/node_modules/@aws-crypto/crc32/src/aws_crc32.ts +0 -24
- package/node_modules/@aws-crypto/crc32/src/index.ts +0 -92
- package/node_modules/@aws-crypto/crc32/tsconfig.json +0 -9
- package/node_modules/@aws-crypto/crc32/tsconfig.module.json +0 -7
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +0 -869
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +0 -862
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +0 -42
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +0 -27
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +0 -71
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +0 -49
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +0 -13
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +0 -2
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +0 -29
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +0 -25
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +0 -57
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +0 -234
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +0 -44
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/constants.js +0 -3
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/md5.js +0 -168
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/constants.d.ts +0 -12
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/md5.d.ts +0 -16
- package/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js +0 -53
- package/node_modules/@smithy/fetch-http-handler/dist-types/stream-collector.d.ts +0 -2
- /package/node_modules/@smithy/{core/dist-es/submodules/endpoints/middleware-endpoint/types.js → types/dist-es/endpoints/EndpointParameterInstructions.js} +0 -0
- /package/node_modules/@smithy/{core/dist-types/submodules/endpoints/middleware-endpoint/types.d.ts → types/dist-types/endpoints/EndpointParameterInstructions.d.ts} +0 -0
|
@@ -2,7 +2,7 @@ const { createHmac, createHash, getRandomValues } = require("node:crypto");
|
|
|
2
2
|
const { ReadStream, lstatSync, fstatSync } = require("node:fs");
|
|
3
3
|
const { HttpResponse } = require("@smithy/core/transport");
|
|
4
4
|
const { toEndpointV1 } = require("@smithy/core/endpoints");
|
|
5
|
-
const {
|
|
5
|
+
const { Readable, Writable, PassThrough } = require("node:stream");
|
|
6
6
|
|
|
7
7
|
const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) ||
|
|
8
8
|
Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
|
|
@@ -21,7 +21,7 @@ const fromString = (input, encoding) => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
24
|
-
const fromBase64
|
|
24
|
+
const fromBase64 = (input) => {
|
|
25
25
|
if ((input.length * 3) % 4 !== 0) {
|
|
26
26
|
throw new TypeError(`Incorrect padding on base64 string.`);
|
|
27
27
|
}
|
|
@@ -831,6 +831,9 @@ const calculateBodyLength = (body) => {
|
|
|
831
831
|
};
|
|
832
832
|
|
|
833
833
|
const toUint8Array = (data) => {
|
|
834
|
+
if (data instanceof Uint8Array) {
|
|
835
|
+
return data;
|
|
836
|
+
}
|
|
834
837
|
if (typeof data === "string") {
|
|
835
838
|
return fromUtf8$1(data);
|
|
836
839
|
}
|
|
@@ -840,6 +843,22 @@ const toUint8Array = (data) => {
|
|
|
840
843
|
return new Uint8Array(data);
|
|
841
844
|
};
|
|
842
845
|
|
|
846
|
+
function concatBytes(arrays, length) {
|
|
847
|
+
if (length === undefined) {
|
|
848
|
+
length = 0;
|
|
849
|
+
for (const bytes of arrays) {
|
|
850
|
+
length += bytes.byteLength;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
const result = new Uint8Array(length);
|
|
854
|
+
let offset = 0;
|
|
855
|
+
for (const buf of arrays) {
|
|
856
|
+
result.set(buf, offset);
|
|
857
|
+
offset += buf.byteLength;
|
|
858
|
+
}
|
|
859
|
+
return result;
|
|
860
|
+
}
|
|
861
|
+
|
|
843
862
|
const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
|
|
844
863
|
const { response } = await next(args);
|
|
845
864
|
try {
|
|
@@ -968,62 +987,70 @@ function castSourceData(toCast, encoding) {
|
|
|
968
987
|
return fromArrayBuffer(toCast);
|
|
969
988
|
}
|
|
970
989
|
|
|
971
|
-
let ChecksumStream$1 = class ChecksumStream extends
|
|
990
|
+
let ChecksumStream$1 = class ChecksumStream extends Readable {
|
|
972
991
|
expectedChecksum;
|
|
973
992
|
checksumSourceLocation;
|
|
974
993
|
checksum;
|
|
975
994
|
source;
|
|
976
995
|
base64Encoder;
|
|
977
|
-
pendingCallback = null;
|
|
978
996
|
constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }) {
|
|
979
997
|
super();
|
|
980
|
-
if (typeof source.pipe
|
|
981
|
-
this.source = source;
|
|
982
|
-
}
|
|
983
|
-
else {
|
|
998
|
+
if (typeof source.pipe !== "function") {
|
|
984
999
|
throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
|
|
985
1000
|
}
|
|
1001
|
+
this.source = source;
|
|
986
1002
|
this.base64Encoder = base64Encoder ?? toBase64$1;
|
|
987
1003
|
this.expectedChecksum = expectedChecksum;
|
|
988
1004
|
this.checksum = checksum;
|
|
989
1005
|
this.checksumSourceLocation = checksumSourceLocation;
|
|
990
|
-
this.source.
|
|
1006
|
+
this.source.on("data", this.onSourceData);
|
|
1007
|
+
this.source.on("end", this.onSourceEnd);
|
|
1008
|
+
this.source.on("error", this.onSourceError);
|
|
1009
|
+
this.source.pause();
|
|
991
1010
|
}
|
|
992
|
-
|
|
993
|
-
if (this.
|
|
994
|
-
|
|
995
|
-
this.pendingCallback = null;
|
|
996
|
-
callback();
|
|
1011
|
+
onSourceData = (chunk) => {
|
|
1012
|
+
if (this.destroyed) {
|
|
1013
|
+
return;
|
|
997
1014
|
}
|
|
998
|
-
}
|
|
999
|
-
_write(chunk, encoding, callback) {
|
|
1000
1015
|
try {
|
|
1001
1016
|
this.checksum.update(chunk);
|
|
1002
|
-
const canPushMore = this.push(chunk);
|
|
1003
|
-
if (!canPushMore) {
|
|
1004
|
-
this.pendingCallback = callback;
|
|
1005
|
-
return;
|
|
1006
|
-
}
|
|
1007
1017
|
}
|
|
1008
1018
|
catch (e) {
|
|
1009
|
-
|
|
1019
|
+
this.destroy(e);
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
if (!this.push(chunk)) {
|
|
1023
|
+
this.source.pause();
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
onSourceEnd = async () => {
|
|
1027
|
+
if (this.destroyed) {
|
|
1028
|
+
return;
|
|
1010
1029
|
}
|
|
1011
|
-
return callback();
|
|
1012
|
-
}
|
|
1013
|
-
async _final(callback) {
|
|
1014
1030
|
try {
|
|
1015
1031
|
const digest = await this.checksum.digest();
|
|
1016
1032
|
const received = this.base64Encoder(digest);
|
|
1017
1033
|
if (this.expectedChecksum !== received) {
|
|
1018
|
-
|
|
1034
|
+
this.destroy(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}"` +
|
|
1019
1035
|
` in response header "${this.checksumSourceLocation}".`));
|
|
1036
|
+
return;
|
|
1020
1037
|
}
|
|
1021
1038
|
}
|
|
1022
1039
|
catch (e) {
|
|
1023
|
-
|
|
1040
|
+
this.destroy(e);
|
|
1041
|
+
return;
|
|
1024
1042
|
}
|
|
1025
1043
|
this.push(null);
|
|
1026
|
-
|
|
1044
|
+
};
|
|
1045
|
+
onSourceError = (error) => {
|
|
1046
|
+
this.destroy(error);
|
|
1047
|
+
};
|
|
1048
|
+
_read(size) {
|
|
1049
|
+
this.source.resume();
|
|
1050
|
+
}
|
|
1051
|
+
_destroy(error, callback) {
|
|
1052
|
+
this.source?.destroy();
|
|
1053
|
+
callback(error);
|
|
1027
1054
|
}
|
|
1028
1055
|
};
|
|
1029
1056
|
|
|
@@ -1036,7 +1063,7 @@ const isBlob = (blob) => {
|
|
|
1036
1063
|
const fromUtf8 = (input) => new TextEncoder().encode(input);
|
|
1037
1064
|
|
|
1038
1065
|
const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
|
|
1039
|
-
|
|
1066
|
+
Object.entries(chars).reduce((acc, [i, c]) => {
|
|
1040
1067
|
acc[c] = Number(i);
|
|
1041
1068
|
return acc;
|
|
1042
1069
|
}, {});
|
|
@@ -1414,7 +1441,7 @@ const headStream = (stream, bytes) => {
|
|
|
1414
1441
|
});
|
|
1415
1442
|
collector.on("error", reject);
|
|
1416
1443
|
collector.on("finish", function () {
|
|
1417
|
-
const bytes =
|
|
1444
|
+
const bytes = concatBytes(this.buffers);
|
|
1418
1445
|
resolve(bytes);
|
|
1419
1446
|
});
|
|
1420
1447
|
});
|
|
@@ -1446,93 +1473,30 @@ const toUtf8 = (input) => {
|
|
|
1446
1473
|
return new TextDecoder("utf-8").decode(input);
|
|
1447
1474
|
};
|
|
1448
1475
|
|
|
1449
|
-
const fromBase64 = (input) => {
|
|
1450
|
-
let totalByteLength = (input.length / 4) * 3;
|
|
1451
|
-
if (input.slice(-2) === "==") {
|
|
1452
|
-
totalByteLength -= 2;
|
|
1453
|
-
}
|
|
1454
|
-
else if (input.slice(-1) === "=") {
|
|
1455
|
-
totalByteLength--;
|
|
1456
|
-
}
|
|
1457
|
-
const out = new ArrayBuffer(totalByteLength);
|
|
1458
|
-
const dataView = new DataView(out);
|
|
1459
|
-
for (let i = 0; i < input.length; i += 4) {
|
|
1460
|
-
let bits = 0;
|
|
1461
|
-
let bitLength = 0;
|
|
1462
|
-
for (let j = i, limit = i + 3; j <= limit; j++) {
|
|
1463
|
-
if (input[j] !== "=") {
|
|
1464
|
-
if (!(input[j] in alphabetByEncoding)) {
|
|
1465
|
-
throw new TypeError(`Invalid character ${input[j]} in base64 string.`);
|
|
1466
|
-
}
|
|
1467
|
-
bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);
|
|
1468
|
-
bitLength += bitsPerLetter;
|
|
1469
|
-
}
|
|
1470
|
-
else {
|
|
1471
|
-
bits >>= bitsPerLetter;
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
const chunkOffset = (i / 4) * 3;
|
|
1475
|
-
bits >>= bitLength % bitsPerByte;
|
|
1476
|
-
const byteLength = Math.floor(bitLength / bitsPerByte);
|
|
1477
|
-
for (let k = 0; k < byteLength; k++) {
|
|
1478
|
-
const offset = (byteLength - k - 1) * bitsPerByte;
|
|
1479
|
-
dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
return new Uint8Array(out);
|
|
1483
|
-
};
|
|
1484
|
-
|
|
1485
1476
|
const streamCollector$1 = async (stream) => {
|
|
1486
|
-
if ((
|
|
1487
|
-
if (Blob.prototype.arrayBuffer !== undefined) {
|
|
1488
|
-
return new Uint8Array(await stream.arrayBuffer());
|
|
1489
|
-
}
|
|
1477
|
+
if (isBlob(stream)) {
|
|
1490
1478
|
return collectBlob(stream);
|
|
1491
1479
|
}
|
|
1492
|
-
return
|
|
1480
|
+
return collectReadableStream(stream);
|
|
1493
1481
|
};
|
|
1494
1482
|
async function collectBlob(blob) {
|
|
1495
|
-
|
|
1496
|
-
const arrayBuffer = fromBase64(base64);
|
|
1497
|
-
return new Uint8Array(arrayBuffer);
|
|
1483
|
+
return blob.arrayBuffer().then((ab) => new Uint8Array(ab));
|
|
1498
1484
|
}
|
|
1499
|
-
async function
|
|
1485
|
+
async function collectReadableStream(stream) {
|
|
1500
1486
|
const chunks = [];
|
|
1501
1487
|
const reader = stream.getReader();
|
|
1502
|
-
let isDone = false;
|
|
1503
1488
|
let length = 0;
|
|
1504
|
-
while (
|
|
1489
|
+
while (true) {
|
|
1505
1490
|
const { done, value } = await reader.read();
|
|
1506
1491
|
if (value) {
|
|
1507
1492
|
chunks.push(value);
|
|
1508
1493
|
length += value.length;
|
|
1509
1494
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
let offset = 0;
|
|
1514
|
-
for (const chunk of chunks) {
|
|
1515
|
-
collected.set(chunk, offset);
|
|
1516
|
-
offset += chunk.length;
|
|
1495
|
+
if (done) {
|
|
1496
|
+
break;
|
|
1497
|
+
}
|
|
1517
1498
|
}
|
|
1518
|
-
return
|
|
1519
|
-
}
|
|
1520
|
-
function readToBase64(blob) {
|
|
1521
|
-
return new Promise((resolve, reject) => {
|
|
1522
|
-
const reader = new FileReader();
|
|
1523
|
-
reader.onloadend = () => {
|
|
1524
|
-
if (reader.readyState !== 2) {
|
|
1525
|
-
return reject(new Error("Reader aborted too early"));
|
|
1526
|
-
}
|
|
1527
|
-
const result = (reader.result ?? "");
|
|
1528
|
-
const commaIndex = result.indexOf(",");
|
|
1529
|
-
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
|
|
1530
|
-
resolve(result.substring(dataOffset));
|
|
1531
|
-
};
|
|
1532
|
-
reader.onabort = () => reject(new Error("Read aborted"));
|
|
1533
|
-
reader.onerror = () => reject(reader.error);
|
|
1534
|
-
reader.readAsDataURL(blob);
|
|
1535
|
-
});
|
|
1499
|
+
return concatBytes(chunks, length);
|
|
1536
1500
|
}
|
|
1537
1501
|
|
|
1538
1502
|
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1 = "The stream has already been transformed.";
|
|
@@ -1595,53 +1559,35 @@ const sdkStreamMixin$1 = (stream) => {
|
|
|
1595
1559
|
};
|
|
1596
1560
|
const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
|
|
1597
1561
|
|
|
1598
|
-
class Collector extends Writable {
|
|
1599
|
-
bufferedBytes = [];
|
|
1600
|
-
_write(chunk, encoding, callback) {
|
|
1601
|
-
this.bufferedBytes.push(chunk);
|
|
1602
|
-
callback();
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
|
|
1606
|
-
async function collectReadableStream(stream) {
|
|
1607
|
-
const chunks = [];
|
|
1608
|
-
const reader = stream.getReader();
|
|
1609
|
-
let isDone = false;
|
|
1610
|
-
let length = 0;
|
|
1611
|
-
while (!isDone) {
|
|
1612
|
-
const { done, value } = await reader.read();
|
|
1613
|
-
if (value) {
|
|
1614
|
-
chunks.push(value);
|
|
1615
|
-
length += value.length;
|
|
1616
|
-
}
|
|
1617
|
-
isDone = done;
|
|
1618
|
-
}
|
|
1619
|
-
const collected = new Uint8Array(length);
|
|
1620
|
-
let offset = 0;
|
|
1621
|
-
for (const chunk of chunks) {
|
|
1622
|
-
collected.set(chunk, offset);
|
|
1623
|
-
offset += chunk.length;
|
|
1624
|
-
}
|
|
1625
|
-
return collected;
|
|
1626
|
-
}
|
|
1627
1562
|
const streamCollector = (stream) => {
|
|
1628
|
-
if (
|
|
1563
|
+
if (isBlob(stream)) {
|
|
1564
|
+
return collectBlob(stream);
|
|
1565
|
+
}
|
|
1566
|
+
if (isReadableStream(stream)) {
|
|
1629
1567
|
return collectReadableStream(stream);
|
|
1630
1568
|
}
|
|
1631
1569
|
return new Promise((resolve, reject) => {
|
|
1632
1570
|
const collector = new Collector();
|
|
1633
|
-
stream
|
|
1634
|
-
|
|
1571
|
+
const nodeStream = stream;
|
|
1572
|
+
nodeStream.pipe(collector);
|
|
1573
|
+
nodeStream.on("error", (err) => {
|
|
1635
1574
|
collector.end();
|
|
1636
1575
|
reject(err);
|
|
1637
1576
|
});
|
|
1638
1577
|
collector.on("error", reject);
|
|
1639
1578
|
collector.on("finish", function () {
|
|
1640
|
-
const bytes =
|
|
1579
|
+
const bytes = concatBytes(this.bufferedBytes);
|
|
1641
1580
|
resolve(bytes);
|
|
1642
1581
|
});
|
|
1643
1582
|
});
|
|
1644
1583
|
};
|
|
1584
|
+
class Collector extends Writable {
|
|
1585
|
+
bufferedBytes = [];
|
|
1586
|
+
_write(chunk, encoding, callback) {
|
|
1587
|
+
this.bufferedBytes.push(chunk);
|
|
1588
|
+
callback();
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1645
1591
|
|
|
1646
1592
|
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
1647
1593
|
const sdkStreamMixin = (stream) => {
|
|
@@ -1709,7 +1655,7 @@ async function splitStream(stream) {
|
|
|
1709
1655
|
return [stream1, stream2];
|
|
1710
1656
|
}
|
|
1711
1657
|
|
|
1712
|
-
class Uint8ArrayBlobAdapter extends bindUint8ArrayBlobAdapter(toUtf8$1, fromUtf8$1, toBase64$1, fromBase64
|
|
1658
|
+
class Uint8ArrayBlobAdapter extends bindUint8ArrayBlobAdapter(toUtf8$1, fromUtf8$1, toBase64$1, fromBase64) {
|
|
1713
1659
|
}
|
|
1714
1660
|
const _getRandomValues = getRandomValues;
|
|
1715
1661
|
const v4 = bindV4(_getRandomValues);
|
|
@@ -1724,6 +1670,7 @@ exports._parseEpochTimestamp = _parseEpochTimestamp;
|
|
|
1724
1670
|
exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset;
|
|
1725
1671
|
exports._parseRfc7231DateTime = _parseRfc7231DateTime;
|
|
1726
1672
|
exports.calculateBodyLength = calculateBodyLength;
|
|
1673
|
+
exports.concatBytes = concatBytes;
|
|
1727
1674
|
exports.copyDocumentWithTransform = copyDocumentWithTransform;
|
|
1728
1675
|
exports.createBufferedReadable = createBufferedReadable;
|
|
1729
1676
|
exports.createChecksumStream = createChecksumStream;
|
|
@@ -1743,7 +1690,7 @@ exports.expectShort = expectShort;
|
|
|
1743
1690
|
exports.expectString = expectString;
|
|
1744
1691
|
exports.expectUnion = expectUnion;
|
|
1745
1692
|
exports.fromArrayBuffer = fromArrayBuffer;
|
|
1746
|
-
exports.fromBase64 = fromBase64
|
|
1693
|
+
exports.fromBase64 = fromBase64;
|
|
1747
1694
|
exports.fromHex = fromHex;
|
|
1748
1695
|
exports.fromString = fromString;
|
|
1749
1696
|
exports.fromUtf8 = fromUtf8$1;
|
|
@@ -1772,6 +1719,7 @@ exports.serializerMiddlewareOption = serializerMiddlewareOption;
|
|
|
1772
1719
|
exports.splitEvery = splitEvery;
|
|
1773
1720
|
exports.splitHeader = splitHeader;
|
|
1774
1721
|
exports.splitStream = splitStream;
|
|
1722
|
+
exports.streamCollector = streamCollector;
|
|
1775
1723
|
exports.strictParseByte = strictParseByte;
|
|
1776
1724
|
exports.strictParseDouble = strictParseDouble;
|
|
1777
1725
|
exports.strictParseFloat = strictParseFloat;
|
|
@@ -863,6 +863,9 @@ const calculateBodyLength = (body) => {
|
|
|
863
863
|
};
|
|
864
864
|
|
|
865
865
|
const toUint8Array = (data) => {
|
|
866
|
+
if (data instanceof Uint8Array) {
|
|
867
|
+
return data;
|
|
868
|
+
}
|
|
866
869
|
if (typeof data === "string") {
|
|
867
870
|
return fromUtf8(data);
|
|
868
871
|
}
|
|
@@ -872,6 +875,22 @@ const toUint8Array = (data) => {
|
|
|
872
875
|
return new Uint8Array(data);
|
|
873
876
|
};
|
|
874
877
|
|
|
878
|
+
function concatBytes(arrays, length) {
|
|
879
|
+
if (length === undefined) {
|
|
880
|
+
length = 0;
|
|
881
|
+
for (const bytes of arrays) {
|
|
882
|
+
length += bytes.byteLength;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
const result = new Uint8Array(length);
|
|
886
|
+
let offset = 0;
|
|
887
|
+
for (const buf of arrays) {
|
|
888
|
+
result.set(buf, offset);
|
|
889
|
+
offset += buf.byteLength;
|
|
890
|
+
}
|
|
891
|
+
return result;
|
|
892
|
+
}
|
|
893
|
+
|
|
875
894
|
const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) ||
|
|
876
895
|
Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
|
|
877
896
|
|
|
@@ -1201,56 +1220,29 @@ async function headStream(stream, bytes) {
|
|
|
1201
1220
|
}
|
|
1202
1221
|
|
|
1203
1222
|
const streamCollector = async (stream) => {
|
|
1204
|
-
if ((
|
|
1205
|
-
if (Blob.prototype.arrayBuffer !== undefined) {
|
|
1206
|
-
return new Uint8Array(await stream.arrayBuffer());
|
|
1207
|
-
}
|
|
1223
|
+
if (isBlob(stream)) {
|
|
1208
1224
|
return collectBlob(stream);
|
|
1209
1225
|
}
|
|
1210
|
-
return
|
|
1226
|
+
return collectReadableStream(stream);
|
|
1211
1227
|
};
|
|
1212
1228
|
async function collectBlob(blob) {
|
|
1213
|
-
|
|
1214
|
-
const arrayBuffer = fromBase64(base64);
|
|
1215
|
-
return new Uint8Array(arrayBuffer);
|
|
1229
|
+
return blob.arrayBuffer().then((ab) => new Uint8Array(ab));
|
|
1216
1230
|
}
|
|
1217
|
-
async function
|
|
1231
|
+
async function collectReadableStream(stream) {
|
|
1218
1232
|
const chunks = [];
|
|
1219
1233
|
const reader = stream.getReader();
|
|
1220
|
-
let isDone = false;
|
|
1221
1234
|
let length = 0;
|
|
1222
|
-
while (
|
|
1235
|
+
while (true) {
|
|
1223
1236
|
const { done, value } = await reader.read();
|
|
1224
1237
|
if (value) {
|
|
1225
1238
|
chunks.push(value);
|
|
1226
1239
|
length += value.length;
|
|
1227
1240
|
}
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
let offset = 0;
|
|
1232
|
-
for (const chunk of chunks) {
|
|
1233
|
-
collected.set(chunk, offset);
|
|
1234
|
-
offset += chunk.length;
|
|
1241
|
+
if (done) {
|
|
1242
|
+
break;
|
|
1243
|
+
}
|
|
1235
1244
|
}
|
|
1236
|
-
return
|
|
1237
|
-
}
|
|
1238
|
-
function readToBase64(blob) {
|
|
1239
|
-
return new Promise((resolve, reject) => {
|
|
1240
|
-
const reader = new FileReader();
|
|
1241
|
-
reader.onloadend = () => {
|
|
1242
|
-
if (reader.readyState !== 2) {
|
|
1243
|
-
return reject(new Error("Reader aborted too early"));
|
|
1244
|
-
}
|
|
1245
|
-
const result = (reader.result ?? "");
|
|
1246
|
-
const commaIndex = result.indexOf(",");
|
|
1247
|
-
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
|
|
1248
|
-
resolve(result.substring(dataOffset));
|
|
1249
|
-
};
|
|
1250
|
-
reader.onabort = () => reject(new Error("Read aborted"));
|
|
1251
|
-
reader.onerror = () => reject(reader.error);
|
|
1252
|
-
reader.readAsDataURL(blob);
|
|
1253
|
-
});
|
|
1245
|
+
return concatBytes(chunks, length);
|
|
1254
1246
|
}
|
|
1255
1247
|
|
|
1256
1248
|
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
@@ -1340,6 +1332,7 @@ exports._parseEpochTimestamp = _parseEpochTimestamp;
|
|
|
1340
1332
|
exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset;
|
|
1341
1333
|
exports._parseRfc7231DateTime = _parseRfc7231DateTime;
|
|
1342
1334
|
exports.calculateBodyLength = calculateBodyLength;
|
|
1335
|
+
exports.concatBytes = concatBytes;
|
|
1343
1336
|
exports.copyDocumentWithTransform = copyDocumentWithTransform;
|
|
1344
1337
|
exports.createBufferedReadable = createBufferedReadable;
|
|
1345
1338
|
exports.createChecksumStream = createChecksumStream;
|
|
@@ -1388,6 +1381,7 @@ exports.serializerMiddlewareOption = serializerMiddlewareOption;
|
|
|
1388
1381
|
exports.splitEvery = splitEvery;
|
|
1389
1382
|
exports.splitHeader = splitHeader;
|
|
1390
1383
|
exports.splitStream = splitStream;
|
|
1384
|
+
exports.streamCollector = streamCollector;
|
|
1391
1385
|
exports.strictParseByte = strictParseByte;
|
|
1392
1386
|
exports.strictParseDouble = strictParseDouble;
|
|
1393
1387
|
exports.strictParseFloat = strictParseFloat;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const CRC32_TABLE = new Uint32Array(256);
|
|
2
|
+
for (let i = 0; i < 256; ++i) {
|
|
3
|
+
let c = i;
|
|
4
|
+
for (let j = 0; j < 8; ++j) {
|
|
5
|
+
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
6
|
+
}
|
|
7
|
+
CRC32_TABLE[i] = c >>> 0;
|
|
8
|
+
}
|
|
9
|
+
const ONES = 0xffff_ffff;
|
|
10
|
+
export class Crc32Js {
|
|
11
|
+
digestLength = 4;
|
|
12
|
+
checksum = ONES;
|
|
13
|
+
update(data) {
|
|
14
|
+
for (let i = 0; i < data.length; ++i) {
|
|
15
|
+
this.checksum = (this.checksum >>> 8) ^ CRC32_TABLE[(this.checksum ^ data[i]) & 0xff];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
digestSync() {
|
|
19
|
+
return (this.checksum ^ ONES) >>> 0;
|
|
20
|
+
}
|
|
21
|
+
async digest() {
|
|
22
|
+
const value = this.digestSync();
|
|
23
|
+
const out = new Uint8Array(4);
|
|
24
|
+
new DataView(out.buffer).setUint32(0, value, false);
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
reset() {
|
|
28
|
+
this.checksum = ONES;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as zlib from "node:zlib";
|
|
2
|
+
import { Crc32Js } from "./Crc32Js";
|
|
3
|
+
const zlibCrc32 = typeof zlib.crc32 === "function" ? zlib.crc32 : undefined;
|
|
4
|
+
export const Crc32Node = zlibCrc32 ? buildNativeClass(zlibCrc32) : Crc32Js;
|
|
5
|
+
function buildNativeClass(nativeCrc32) {
|
|
6
|
+
return class Crc32Node {
|
|
7
|
+
digestLength = 4;
|
|
8
|
+
value = 0;
|
|
9
|
+
update(data) {
|
|
10
|
+
this.value = nativeCrc32(data, this.value);
|
|
11
|
+
}
|
|
12
|
+
digestSync() {
|
|
13
|
+
return this.value >>> 0;
|
|
14
|
+
}
|
|
15
|
+
async digest() {
|
|
16
|
+
const out = new Uint8Array(4);
|
|
17
|
+
new DataView(out.buffer).setUint32(0, this.digestSync(), false);
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
reset() {
|
|
21
|
+
this.value = 0;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -2,5 +2,11 @@ const no = Symbol.for("node-only");
|
|
|
2
2
|
export { blobHasher } from "./hash-blob-browser/blobHasher";
|
|
3
3
|
export const fileStreamHasher = no;
|
|
4
4
|
export const readableStreamHasher = no;
|
|
5
|
-
export { Md5 } from "./md5
|
|
5
|
+
export { Md5Js, Md5Js as Md5 } from "./md5/Md5Js";
|
|
6
|
+
export const Md5Node = no;
|
|
7
|
+
export { Crc32Js, Crc32Js as Crc32 } from "./crc32/Crc32Js";
|
|
8
|
+
export const Crc32Node = no;
|
|
9
|
+
export { Sha256Js } from "./sha256/Sha256Js";
|
|
10
|
+
export { Sha256WebCrypto, Sha256WebCrypto as Sha256 } from "./sha256/Sha256WebCrypto";
|
|
11
|
+
export const Sha256Node = no;
|
|
6
12
|
export { blobReader } from "./chunked-blob-reader/chunked-blob-reader";
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { blobHasher } from "./hash-blob-browser/blobHasher";
|
|
2
2
|
export { fileStreamHasher } from "./hash-stream-node/fileStreamHasher";
|
|
3
3
|
export { readableStreamHasher } from "./hash-stream-node/readableStreamHasher";
|
|
4
|
-
export {
|
|
4
|
+
export { Md5Js } from "./md5/Md5Js";
|
|
5
|
+
export { Md5Node, Md5Node as Md5 } from "./md5/Md5Node";
|
|
6
|
+
export { Crc32Js } from "./crc32/Crc32Js";
|
|
7
|
+
export { Crc32Node, Crc32Node as Crc32 } from "./crc32/Crc32Node";
|
|
8
|
+
export { Sha256Js } from "./sha256/Sha256Js";
|
|
9
|
+
export { Sha256Node, Sha256Node as Sha256 } from "./sha256/Sha256Node";
|
|
10
|
+
export { Sha256WebCrypto } from "./sha256/Sha256WebCrypto";
|
|
5
11
|
export { blobReader } from "./chunked-blob-reader/chunked-blob-reader";
|
|
@@ -2,5 +2,11 @@ const no = Symbol.for("node-only");
|
|
|
2
2
|
export { blobHasher } from "./hash-blob-browser/blobHasher";
|
|
3
3
|
export const fileStreamHasher = no;
|
|
4
4
|
export const readableStreamHasher = no;
|
|
5
|
-
export { Md5 } from "./md5
|
|
5
|
+
export { Md5Js, Md5Js as Md5 } from "./md5/Md5Js";
|
|
6
|
+
export const Md5Node = no;
|
|
7
|
+
export { Crc32Js, Crc32Js as Crc32 } from "./crc32/Crc32Js";
|
|
8
|
+
export const Crc32Node = no;
|
|
9
|
+
export { Sha256Js } from "./sha256/Sha256Js";
|
|
10
|
+
export { Sha256WebCrypto, Sha256WebCrypto as Sha256 } from "./sha256/Sha256WebCrypto";
|
|
11
|
+
export const Sha256Node = no;
|
|
6
12
|
export { blobReader } from "./chunked-blob-reader/chunked-blob-reader.native";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { toUint8Array } from "@smithy/core/serde";
|
|
2
|
+
export class Md5Js {
|
|
3
|
+
digestLength = 16;
|
|
4
|
+
state = Uint32Array.from(INIT);
|
|
5
|
+
writeBuffer = new DataView(new ArrayBuffer(64));
|
|
6
|
+
bufferLength = 0;
|
|
7
|
+
bytesHashed = 0;
|
|
8
|
+
update(sourceData) {
|
|
9
|
+
const data = toUint8Array(sourceData);
|
|
10
|
+
let pos = 0;
|
|
11
|
+
let len = data.byteLength;
|
|
12
|
+
this.bytesHashed += len;
|
|
13
|
+
while (len > 0) {
|
|
14
|
+
this.writeBuffer.setUint8(this.bufferLength++, data[pos++]);
|
|
15
|
+
--len;
|
|
16
|
+
if (this.bufferLength === 64) {
|
|
17
|
+
compress(this.state, this.writeBuffer);
|
|
18
|
+
this.bufferLength = 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async digest() {
|
|
23
|
+
const state = Uint32Array.from(this.state);
|
|
24
|
+
const buf = new DataView(this.writeBuffer.buffer.slice(0));
|
|
25
|
+
let bufLen = this.bufferLength;
|
|
26
|
+
const bits = this.bytesHashed * 8;
|
|
27
|
+
buf.setUint8(bufLen++, 0x80);
|
|
28
|
+
if (this.bufferLength % 64 >= 56) {
|
|
29
|
+
for (let i = bufLen; i < 64; ++i) {
|
|
30
|
+
buf.setUint8(i, 0);
|
|
31
|
+
}
|
|
32
|
+
compress(state, buf);
|
|
33
|
+
bufLen = 0;
|
|
34
|
+
}
|
|
35
|
+
for (let i = bufLen; i < 56; ++i) {
|
|
36
|
+
buf.setUint8(i, 0);
|
|
37
|
+
}
|
|
38
|
+
buf.setUint32(56, bits >>> 0, true);
|
|
39
|
+
buf.setUint32(60, Math.floor(bits / 2 ** 32), true);
|
|
40
|
+
compress(state, buf);
|
|
41
|
+
const out = new Uint8Array(16);
|
|
42
|
+
const view = new DataView(out.buffer);
|
|
43
|
+
for (let i = 0; i < 4; ++i) {
|
|
44
|
+
view.setUint32(i * 4, state[i], true);
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
reset() {
|
|
49
|
+
this.state.set(INIT);
|
|
50
|
+
this.writeBuffer = new DataView(new ArrayBuffer(64));
|
|
51
|
+
this.bufferLength = 0;
|
|
52
|
+
this.bytesHashed = 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const INIT = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476];
|
|
56
|
+
const M = 0xffffffff;
|
|
57
|
+
const S = Uint8Array.of(7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21);
|
|
58
|
+
const T = Array.from({ length: 64 }, (_, i) => (Math.abs(Math.sin(i + 1)) * 2 ** 32) >>> 0);
|
|
59
|
+
function compress(state, block) {
|
|
60
|
+
let a = state[0], b = state[1], c = state[2], d = state[3];
|
|
61
|
+
for (let i = 0; i < 64; ++i) {
|
|
62
|
+
let f, g;
|
|
63
|
+
if (i < 16) {
|
|
64
|
+
f = (b & c) | (~b & d);
|
|
65
|
+
g = i;
|
|
66
|
+
}
|
|
67
|
+
else if (i < 32) {
|
|
68
|
+
f = (d & b) | (c & ~d);
|
|
69
|
+
g = (5 * i + 1) % 16;
|
|
70
|
+
}
|
|
71
|
+
else if (i < 48) {
|
|
72
|
+
f = b ^ c ^ d;
|
|
73
|
+
g = (3 * i + 5) % 16;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
f = c ^ (b | ~d);
|
|
77
|
+
g = (7 * i) % 16;
|
|
78
|
+
}
|
|
79
|
+
const x = block.getUint32(g * 4, true);
|
|
80
|
+
const tmp = d;
|
|
81
|
+
d = c;
|
|
82
|
+
c = b;
|
|
83
|
+
const s = S[(i >> 4) * 4 + (i & 3)];
|
|
84
|
+
const sum = (((a + f) & M) + ((x + T[i]) & M)) & M;
|
|
85
|
+
b = (b + (((sum << s) | (sum >>> (32 - s))) >>> 0)) & M;
|
|
86
|
+
a = tmp;
|
|
87
|
+
}
|
|
88
|
+
state[0] = (state[0] + a) & M;
|
|
89
|
+
state[1] = (state[1] + b) & M;
|
|
90
|
+
state[2] = (state[2] + c) & M;
|
|
91
|
+
state[3] = (state[3] + d) & M;
|
|
92
|
+
}
|