@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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { toUint8Array } from "@smithy/core/serde";
|
|
3
|
+
import { Md5Js } from "./Md5Js";
|
|
4
|
+
const hasNativeCrypto = (() => {
|
|
5
|
+
try {
|
|
6
|
+
createHash("md5");
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
export const Md5Node = hasNativeCrypto ? buildNativeClass() : Md5Js;
|
|
14
|
+
function buildNativeClass() {
|
|
15
|
+
return class Md5Node {
|
|
16
|
+
digestLength = 16;
|
|
17
|
+
hash = createHash("md5");
|
|
18
|
+
update(data) {
|
|
19
|
+
this.hash.update(toUint8Array(data));
|
|
20
|
+
}
|
|
21
|
+
async digest() {
|
|
22
|
+
const buf = this.hash.copy().digest();
|
|
23
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
24
|
+
}
|
|
25
|
+
reset() {
|
|
26
|
+
this.hash = createHash("md5");
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { toUint8Array } from "@smithy/core/serde";
|
|
2
|
+
const BLOCK = 64;
|
|
3
|
+
const DIGEST_LENGTH = 32;
|
|
4
|
+
const MAX_HASHABLE_LENGTH = 2 ** 53 - 1;
|
|
5
|
+
export class Sha256Js {
|
|
6
|
+
digestLength = DIGEST_LENGTH;
|
|
7
|
+
state = Int32Array.from(INIT);
|
|
8
|
+
w;
|
|
9
|
+
buffer = new Uint8Array(64);
|
|
10
|
+
bufferLength = 0;
|
|
11
|
+
bytesHashed = 0;
|
|
12
|
+
finished = false;
|
|
13
|
+
inner;
|
|
14
|
+
outer;
|
|
15
|
+
constructor(secret) {
|
|
16
|
+
if (secret) {
|
|
17
|
+
const key = Sha256Js.normalizeKey(secret);
|
|
18
|
+
this.inner = new Sha256Js();
|
|
19
|
+
this.outer = new Sha256Js();
|
|
20
|
+
const { inner, outer } = this;
|
|
21
|
+
const pad = new Uint8Array(BLOCK * 2);
|
|
22
|
+
for (let i = 0; i < BLOCK; ++i) {
|
|
23
|
+
pad[i] = 0x36 ^ key[i];
|
|
24
|
+
pad[i + BLOCK] = 0x5c ^ key[i];
|
|
25
|
+
}
|
|
26
|
+
inner.update(pad.subarray(0, BLOCK));
|
|
27
|
+
outer.update(pad.subarray(BLOCK));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
update(data) {
|
|
31
|
+
if (this.finished) {
|
|
32
|
+
throw new Error("Attempted to update an already finished HMAC.");
|
|
33
|
+
}
|
|
34
|
+
if (this.inner) {
|
|
35
|
+
this.inner.update(data);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const chunk = toUint8Array(data);
|
|
39
|
+
let position = 0;
|
|
40
|
+
let { byteLength } = chunk;
|
|
41
|
+
this.bytesHashed += byteLength;
|
|
42
|
+
if (this.bytesHashed * 8 > MAX_HASHABLE_LENGTH) {
|
|
43
|
+
throw new Error("Cannot hash more than 2^53 - 1 bits");
|
|
44
|
+
}
|
|
45
|
+
while (byteLength > 0) {
|
|
46
|
+
this.buffer[this.bufferLength++] = chunk[position++];
|
|
47
|
+
byteLength--;
|
|
48
|
+
if (this.bufferLength === BLOCK) {
|
|
49
|
+
this.hashBuffer();
|
|
50
|
+
this.bufferLength = 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async digest() {
|
|
55
|
+
const { inner, outer } = this;
|
|
56
|
+
if (inner && outer) {
|
|
57
|
+
if (this.finished) {
|
|
58
|
+
throw new Error("Attempted to digest an already finished HMAC.");
|
|
59
|
+
}
|
|
60
|
+
this.finished = true;
|
|
61
|
+
const innerDigest = inner.digestSync();
|
|
62
|
+
outer.update(innerDigest);
|
|
63
|
+
return outer.digestSync();
|
|
64
|
+
}
|
|
65
|
+
return this.digestSync();
|
|
66
|
+
}
|
|
67
|
+
reset() {
|
|
68
|
+
this.state = Int32Array.from(INIT);
|
|
69
|
+
this.buffer = new Uint8Array(64);
|
|
70
|
+
this.bufferLength = 0;
|
|
71
|
+
this.bytesHashed = 0;
|
|
72
|
+
}
|
|
73
|
+
digestSync() {
|
|
74
|
+
const state = this.state.slice();
|
|
75
|
+
const buffer = this.buffer.slice();
|
|
76
|
+
let bufferLength = this.bufferLength;
|
|
77
|
+
const bitsHashed = this.bytesHashed * 8;
|
|
78
|
+
const bufferView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
79
|
+
bufferView.setUint8(bufferLength++, 0x80);
|
|
80
|
+
if ((bufferLength - 1) % BLOCK >= BLOCK - 8) {
|
|
81
|
+
for (let i = bufferLength; i < BLOCK; ++i) {
|
|
82
|
+
bufferView.setUint8(i, 0);
|
|
83
|
+
}
|
|
84
|
+
this.hashBufferWith(state, buffer);
|
|
85
|
+
bufferLength = 0;
|
|
86
|
+
}
|
|
87
|
+
for (let i = bufferLength; i < BLOCK - 8; ++i) {
|
|
88
|
+
bufferView.setUint8(i, 0);
|
|
89
|
+
}
|
|
90
|
+
bufferView.setUint32(BLOCK - 8, Math.floor(bitsHashed / 0x100000000), false);
|
|
91
|
+
bufferView.setUint32(BLOCK - 4, bitsHashed, false);
|
|
92
|
+
this.hashBufferWith(state, buffer);
|
|
93
|
+
const out = new Uint8Array(DIGEST_LENGTH);
|
|
94
|
+
for (let i = 0; i < 8; ++i) {
|
|
95
|
+
out[i * 4] = (state[i] >>> 24) & 0xff;
|
|
96
|
+
out[i * 4 + 1] = (state[i] >>> 16) & 0xff;
|
|
97
|
+
out[i * 4 + 2] = (state[i] >>> 8) & 0xff;
|
|
98
|
+
out[i * 4 + 3] = (state[i] >>> 0) & 0xff;
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
static normalizeKey(secret) {
|
|
103
|
+
const key = toUint8Array(secret);
|
|
104
|
+
if (key.byteLength > BLOCK) {
|
|
105
|
+
const h = new Sha256Js();
|
|
106
|
+
h.update(key);
|
|
107
|
+
const out = h.digestSync();
|
|
108
|
+
const padded = new Uint8Array(BLOCK);
|
|
109
|
+
padded.set(out);
|
|
110
|
+
return padded;
|
|
111
|
+
}
|
|
112
|
+
if (key.byteLength < BLOCK) {
|
|
113
|
+
const padded = new Uint8Array(BLOCK);
|
|
114
|
+
padded.set(key);
|
|
115
|
+
return padded;
|
|
116
|
+
}
|
|
117
|
+
return key;
|
|
118
|
+
}
|
|
119
|
+
hashBuffer() {
|
|
120
|
+
this.hashBufferWith(this.state, this.buffer);
|
|
121
|
+
}
|
|
122
|
+
hashBufferWith(state, buffer) {
|
|
123
|
+
const w = (this.w ??= new Int32Array(64));
|
|
124
|
+
let s0 = state[0], s1 = state[1], s2 = state[2], s3 = state[3], s4 = state[4], s5 = state[5], s6 = state[6], s7 = state[7];
|
|
125
|
+
for (let i = 0; i < BLOCK; ++i) {
|
|
126
|
+
if (i < 16) {
|
|
127
|
+
w[i] =
|
|
128
|
+
((buffer[i * 4] & 0xff) << 24) |
|
|
129
|
+
((buffer[i * 4 + 1] & 0xff) << 16) |
|
|
130
|
+
((buffer[i * 4 + 2] & 0xff) << 8) |
|
|
131
|
+
(buffer[i * 4 + 3] & 0xff);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
let u = w[i - 2];
|
|
135
|
+
const t1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);
|
|
136
|
+
u = w[i - 15];
|
|
137
|
+
const t2 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);
|
|
138
|
+
w[i] = ((t1 + w[i - 7]) | 0) + ((t2 + w[i - 16]) | 0);
|
|
139
|
+
}
|
|
140
|
+
const t1 = ((((((s4 >>> 6) | (s4 << 26)) ^ ((s4 >>> 11) | (s4 << 21)) ^ ((s4 >>> 25) | (s4 << 7))) +
|
|
141
|
+
((s4 & s5) ^ (~s4 & s6))) |
|
|
142
|
+
0) +
|
|
143
|
+
((s7 + ((K[i] + w[i]) | 0)) | 0)) |
|
|
144
|
+
0;
|
|
145
|
+
const t2 = ((((s0 >>> 2) | (s0 << 30)) ^ ((s0 >>> 13) | (s0 << 19)) ^ ((s0 >>> 22) | (s0 << 10))) +
|
|
146
|
+
((s0 & s1) ^ (s0 & s2) ^ (s1 & s2))) |
|
|
147
|
+
0;
|
|
148
|
+
s7 = s6;
|
|
149
|
+
s6 = s5;
|
|
150
|
+
s5 = s4;
|
|
151
|
+
s4 = (s3 + t1) | 0;
|
|
152
|
+
s3 = s2;
|
|
153
|
+
s2 = s1;
|
|
154
|
+
s1 = s0;
|
|
155
|
+
s0 = (t1 + t2) | 0;
|
|
156
|
+
}
|
|
157
|
+
state[0] += s0;
|
|
158
|
+
state[1] += s1;
|
|
159
|
+
state[2] += s2;
|
|
160
|
+
state[3] += s3;
|
|
161
|
+
state[4] += s4;
|
|
162
|
+
state[5] += s5;
|
|
163
|
+
state[6] += s6;
|
|
164
|
+
state[7] += s7;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const INIT = new Int32Array([
|
|
168
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
|
169
|
+
]);
|
|
170
|
+
const K = new Int32Array([
|
|
171
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
172
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
173
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
174
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
175
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
176
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
177
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
178
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
179
|
+
]);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createHash, createHmac } from "node:crypto";
|
|
2
|
+
import { Sha256Js } from "./Sha256Js";
|
|
3
|
+
const hasNativeCrypto = (() => {
|
|
4
|
+
try {
|
|
5
|
+
createHash("sha256");
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
})();
|
|
12
|
+
export const Sha256Node = hasNativeCrypto ? buildNativeClass() : Sha256Js;
|
|
13
|
+
function buildNativeClass() {
|
|
14
|
+
return class Sha256Node {
|
|
15
|
+
digestLength = 32;
|
|
16
|
+
secret;
|
|
17
|
+
hash;
|
|
18
|
+
isHmac;
|
|
19
|
+
finished = false;
|
|
20
|
+
constructor(secret) {
|
|
21
|
+
this.secret = secret;
|
|
22
|
+
this.isHmac = !!secret;
|
|
23
|
+
this.hash = this.createHash();
|
|
24
|
+
}
|
|
25
|
+
update(data) {
|
|
26
|
+
if (this.finished) {
|
|
27
|
+
throw new Error("Attempted to update an already finished hash.");
|
|
28
|
+
}
|
|
29
|
+
this.hash.update(data);
|
|
30
|
+
}
|
|
31
|
+
async digest() {
|
|
32
|
+
let buf;
|
|
33
|
+
if (this.isHmac) {
|
|
34
|
+
this.finished = true;
|
|
35
|
+
buf = this.hash.digest();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
buf = this.hash.copy().digest();
|
|
39
|
+
}
|
|
40
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
41
|
+
}
|
|
42
|
+
reset() {
|
|
43
|
+
this.hash = this.createHash();
|
|
44
|
+
this.finished = false;
|
|
45
|
+
}
|
|
46
|
+
createHash() {
|
|
47
|
+
return this.secret ? createHmac("sha256", toBuffer(this.secret)) : createHash("sha256");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function toBuffer(data) {
|
|
52
|
+
if (typeof data === "string") {
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
if (ArrayBuffer.isView(data)) {
|
|
56
|
+
return Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
57
|
+
}
|
|
58
|
+
return Buffer.from(data);
|
|
59
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { concatBytes, toUint8Array } from "@smithy/core/serde";
|
|
2
|
+
import { Sha256Js } from "./Sha256Js";
|
|
3
|
+
const { digest, sign, importKey } = globalThis?.crypto?.subtle ?? {};
|
|
4
|
+
const subtle = typeof digest === "function" && typeof sign === "function" && typeof importKey === "function"
|
|
5
|
+
? globalThis.crypto.subtle
|
|
6
|
+
: undefined;
|
|
7
|
+
const MAX_PENDING_BYTES = 8 * 1024 * 1024;
|
|
8
|
+
export class Sha256WebCrypto {
|
|
9
|
+
digestLength = 32;
|
|
10
|
+
secret;
|
|
11
|
+
pending = [];
|
|
12
|
+
pendingBytes = 0;
|
|
13
|
+
fallback;
|
|
14
|
+
finished = false;
|
|
15
|
+
constructor(secret) {
|
|
16
|
+
if (secret) {
|
|
17
|
+
this.secret = toUint8Array(secret);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
update(data) {
|
|
21
|
+
if (this.finished) {
|
|
22
|
+
throw new Error("Attempted to update an already finished HMAC.");
|
|
23
|
+
}
|
|
24
|
+
if (this.fallback) {
|
|
25
|
+
this.fallback.update(data);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.pending.push(data.slice());
|
|
29
|
+
this.pendingBytes += data.byteLength;
|
|
30
|
+
if (this.pendingBytes >= MAX_PENDING_BYTES) {
|
|
31
|
+
this.switchToFallback();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async digest() {
|
|
35
|
+
if (this.fallback) {
|
|
36
|
+
return this.fallback.digest();
|
|
37
|
+
}
|
|
38
|
+
if (this.secret && this.finished) {
|
|
39
|
+
throw new Error("Attempted to digest an already finished HMAC.");
|
|
40
|
+
}
|
|
41
|
+
const data = concatBytes(this.pending);
|
|
42
|
+
if (subtle) {
|
|
43
|
+
if (this.secret) {
|
|
44
|
+
this.finished = true;
|
|
45
|
+
const key = await subtle.importKey("raw", this.secret, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
46
|
+
const sig = await subtle.sign("HMAC", key, data);
|
|
47
|
+
return new Uint8Array(sig);
|
|
48
|
+
}
|
|
49
|
+
const hash = await subtle.digest("SHA-256", data);
|
|
50
|
+
return new Uint8Array(hash);
|
|
51
|
+
}
|
|
52
|
+
const sha256 = new Sha256Js(this.secret);
|
|
53
|
+
sha256.update(data);
|
|
54
|
+
return sha256.digest();
|
|
55
|
+
}
|
|
56
|
+
reset() {
|
|
57
|
+
this.pending = [];
|
|
58
|
+
this.pendingBytes = 0;
|
|
59
|
+
this.fallback = undefined;
|
|
60
|
+
this.finished = false;
|
|
61
|
+
}
|
|
62
|
+
switchToFallback() {
|
|
63
|
+
const sha256Js = new Sha256Js(this.secret);
|
|
64
|
+
for (const chunk of this.pending) {
|
|
65
|
+
sha256Js.update(chunk);
|
|
66
|
+
}
|
|
67
|
+
this.fallback = sha256Js;
|
|
68
|
+
this.pending = [];
|
|
69
|
+
this.pendingBytes = 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -24,3 +24,4 @@ export { map, convertMap, take, } from "./smithy-client/object-mapping";
|
|
|
24
24
|
export { schemaLogFilter } from "./smithy-client/schemaLogFilter";
|
|
25
25
|
export { serializeFloat, serializeDateTime } from "./smithy-client/ser-utils";
|
|
26
26
|
export { _json } from "./smithy-client/serde-json";
|
|
27
|
+
export { makeBuilder } from "./smithy-client/client-command-builder";
|
package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client-command-builder.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from "./command";
|
|
2
|
+
export function makeBuilder(common, service, name, ep) {
|
|
3
|
+
return function makeCommand(added, plugins, op, $, smithyContext = {}) {
|
|
4
|
+
const epMerged = Object.assign({}, common, added);
|
|
5
|
+
return Command.classBuilder()
|
|
6
|
+
.ep(epMerged)
|
|
7
|
+
.m(function (CommandCtor, clientStack, config, options) {
|
|
8
|
+
const list = plugins.call(this, CommandCtor, clientStack, config, options);
|
|
9
|
+
list.unshift(ep(config, CommandCtor.getEndpointParameterInstructions()));
|
|
10
|
+
return list;
|
|
11
|
+
})
|
|
12
|
+
.s(service, op, smithyContext)
|
|
13
|
+
.n(name, op.charAt(0).toUpperCase() + op.slice(1) + "Command")
|
|
14
|
+
.sc($)
|
|
15
|
+
.build();
|
|
16
|
+
};
|
|
17
|
+
}
|
package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { getInstanceMetadataRegion } from "./getInstanceMetadataRegion";
|
|
1
2
|
export const REGION_ENV_NAME = "AWS_REGION";
|
|
2
3
|
export const REGION_INI_NAME = "region";
|
|
3
4
|
export const NODE_REGION_CONFIG_OPTIONS = {
|
|
4
5
|
environmentVariableSelector: (env) => env[REGION_ENV_NAME],
|
|
5
6
|
configFileSelector: (profile) => profile[REGION_INI_NAME],
|
|
6
|
-
default: () => {
|
|
7
|
+
default: async () => {
|
|
8
|
+
const region = await getInstanceMetadataRegion();
|
|
9
|
+
if (region) {
|
|
10
|
+
return region;
|
|
11
|
+
}
|
|
7
12
|
throw new Error("Region is missing");
|
|
8
13
|
},
|
|
9
14
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ENV_IMDS_DISABLED, IMDS_REGION_PATH, IMDS_TOKEN_PATH, X_AWS_EC2_METADATA_TOKEN, X_AWS_EC2_METADATA_TOKEN_TTL, } from "../../defaults-mode/constants";
|
|
2
|
+
const TIMEOUT_MS = 1000;
|
|
3
|
+
const NEG_CACHE_TTL_MS = 60_000;
|
|
4
|
+
let negativeCacheUntil = 0;
|
|
5
|
+
export const getInstanceMetadataRegion = async () => {
|
|
6
|
+
if (process.env[ENV_IMDS_DISABLED]) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (Date.now() < negativeCacheUntil) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const endpoint = resolveImdsEndpoint();
|
|
14
|
+
const token = (await imdsRequest({
|
|
15
|
+
...endpoint,
|
|
16
|
+
path: IMDS_TOKEN_PATH,
|
|
17
|
+
method: "PUT",
|
|
18
|
+
headers: {
|
|
19
|
+
[X_AWS_EC2_METADATA_TOKEN_TTL]: "21600",
|
|
20
|
+
},
|
|
21
|
+
})).toString();
|
|
22
|
+
const region = (await imdsRequest({
|
|
23
|
+
...endpoint,
|
|
24
|
+
path: IMDS_REGION_PATH,
|
|
25
|
+
method: "GET",
|
|
26
|
+
headers: {
|
|
27
|
+
[X_AWS_EC2_METADATA_TOKEN]: token,
|
|
28
|
+
},
|
|
29
|
+
}))
|
|
30
|
+
.toString()
|
|
31
|
+
.trim();
|
|
32
|
+
return region || cacheNegativeAndReturnUndefined();
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return cacheNegativeAndReturnUndefined();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const cacheNegativeAndReturnUndefined = () => {
|
|
39
|
+
negativeCacheUntil = Date.now() + NEG_CACHE_TTL_MS;
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
42
|
+
const resolveImdsEndpoint = () => {
|
|
43
|
+
const envEndpoint = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;
|
|
44
|
+
if (envEndpoint) {
|
|
45
|
+
const url = new URL(envEndpoint);
|
|
46
|
+
return {
|
|
47
|
+
hostname: url.hostname.replace(/^\[(.+)]$/, "$1"),
|
|
48
|
+
port: url.port ? Number(url.port) : undefined,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE === "IPv6") {
|
|
52
|
+
return { hostname: "fd00:ec2::254" };
|
|
53
|
+
}
|
|
54
|
+
return { hostname: "169.254.169.254" };
|
|
55
|
+
};
|
|
56
|
+
const imdsRequest = async (options) => {
|
|
57
|
+
const { request } = await import("node:http");
|
|
58
|
+
return new Promise((resolve, reject) => {
|
|
59
|
+
const req = request({
|
|
60
|
+
hostname: options.hostname,
|
|
61
|
+
port: options.port,
|
|
62
|
+
path: options.path,
|
|
63
|
+
method: options.method,
|
|
64
|
+
headers: options.headers,
|
|
65
|
+
timeout: TIMEOUT_MS,
|
|
66
|
+
signal: AbortSignal.timeout(TIMEOUT_MS),
|
|
67
|
+
});
|
|
68
|
+
req.on("error", (err) => {
|
|
69
|
+
reject(err);
|
|
70
|
+
req.destroy();
|
|
71
|
+
});
|
|
72
|
+
req.on("timeout", () => {
|
|
73
|
+
reject(new Error("TimeoutError from instance metadata service"));
|
|
74
|
+
req.destroy();
|
|
75
|
+
});
|
|
76
|
+
req.on("response", (res) => {
|
|
77
|
+
const { statusCode = 400 } = res;
|
|
78
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
79
|
+
reject(Object.assign(new Error("Error response received from instance metadata service"), { statusCode }));
|
|
80
|
+
req.destroy();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const chunks = [];
|
|
84
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
85
|
+
res.on("end", () => {
|
|
86
|
+
resolve(Buffer.concat(chunks));
|
|
87
|
+
req.destroy();
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
req.end();
|
|
91
|
+
});
|
|
92
|
+
};
|
|
@@ -4,3 +4,6 @@ export const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
|
|
|
4
4
|
export const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
|
|
5
5
|
export const DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
|
|
6
6
|
export const IMDS_REGION_PATH = "/latest/meta-data/placement/region";
|
|
7
|
+
export const IMDS_TOKEN_PATH = "/latest/api/token";
|
|
8
|
+
export const X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
|
|
9
|
+
export const X_AWS_EC2_METADATA_TOKEN_TTL = "x-aws-ec2-metadata-token-ttl-seconds";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NODE_REGION_CONFIG_OPTIONS } from "../config-resolver/regionConfig/config";
|
|
2
|
+
import { getInstanceMetadataRegion } from "../config-resolver/regionConfig/getInstanceMetadataRegion";
|
|
2
3
|
import { loadConfig } from "../node-config-provider/configLoader";
|
|
3
4
|
import { memoize } from "../property-provider/memoize";
|
|
4
|
-
import { AWS_DEFAULT_REGION_ENV, AWS_EXECUTION_ENV, AWS_REGION_ENV, DEFAULTS_MODE_OPTIONS
|
|
5
|
+
import { AWS_DEFAULT_REGION_ENV, AWS_EXECUTION_ENV, AWS_REGION_ENV, DEFAULTS_MODE_OPTIONS } from "./constants";
|
|
5
6
|
import { NODE_DEFAULTS_MODE_CONFIG_OPTIONS } from "./defaultsModeConfig";
|
|
6
7
|
export const resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => memoize(async () => {
|
|
7
8
|
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
|
|
@@ -40,59 +41,5 @@ const inferPhysicalRegion = async () => {
|
|
|
40
41
|
if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
|
|
41
42
|
return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const endpoint = await getImdsEndpoint();
|
|
46
|
-
return (await imdsHttpGet({ hostname: endpoint.hostname, path: IMDS_REGION_PATH })).toString();
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const getImdsEndpoint = async () => {
|
|
53
|
-
const envEndpoint = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;
|
|
54
|
-
if (envEndpoint) {
|
|
55
|
-
const url = new URL(envEndpoint);
|
|
56
|
-
return { hostname: url.hostname, path: url.pathname };
|
|
57
|
-
}
|
|
58
|
-
const envMode = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE;
|
|
59
|
-
if (envMode === "IPv6") {
|
|
60
|
-
return { hostname: "fd00:ec2::254", path: "/" };
|
|
61
|
-
}
|
|
62
|
-
return { hostname: "169.254.169.254", path: "/" };
|
|
63
|
-
};
|
|
64
|
-
const imdsHttpGet = async ({ hostname, path }) => {
|
|
65
|
-
const { request } = await import("node:http");
|
|
66
|
-
return new Promise((resolve, reject) => {
|
|
67
|
-
const req = request({
|
|
68
|
-
method: "GET",
|
|
69
|
-
hostname: hostname.replace(/^\[(.+)]$/, "$1"),
|
|
70
|
-
path,
|
|
71
|
-
timeout: 1000,
|
|
72
|
-
signal: AbortSignal.timeout(1000),
|
|
73
|
-
});
|
|
74
|
-
req.on("error", (err) => {
|
|
75
|
-
reject(err);
|
|
76
|
-
req.destroy();
|
|
77
|
-
});
|
|
78
|
-
req.on("timeout", () => {
|
|
79
|
-
reject(new Error("TimeoutError from instance metadata service"));
|
|
80
|
-
req.destroy();
|
|
81
|
-
});
|
|
82
|
-
req.on("response", (res) => {
|
|
83
|
-
const { statusCode = 400 } = res;
|
|
84
|
-
if (statusCode < 200 || 300 <= statusCode) {
|
|
85
|
-
reject(Object.assign(new Error("Error response received from instance metadata service"), { statusCode }));
|
|
86
|
-
req.destroy();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const chunks = [];
|
|
90
|
-
res.on("data", (chunk) => chunks.push(chunk));
|
|
91
|
-
res.on("end", () => {
|
|
92
|
-
resolve(Buffer.concat(chunks));
|
|
93
|
-
req.destroy();
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
req.end();
|
|
97
|
-
});
|
|
44
|
+
return getInstanceMetadataRegion();
|
|
98
45
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Crc32 } from "@
|
|
1
|
+
import { Crc32 } from "@smithy/core/checksum";
|
|
2
2
|
import { HeaderMarshaller } from "./HeaderMarshaller";
|
|
3
3
|
import { splitMessage } from "./splitMessage";
|
|
4
4
|
export class EventStreamCodec {
|
|
@@ -49,10 +49,12 @@ export class EventStreamCodec {
|
|
|
49
49
|
const checksum = new Crc32();
|
|
50
50
|
view.setUint32(0, length, false);
|
|
51
51
|
view.setUint32(4, headers.byteLength, false);
|
|
52
|
-
|
|
52
|
+
checksum.update(out.subarray(0, 8));
|
|
53
|
+
view.setUint32(8, checksum.digestSync(), false);
|
|
53
54
|
out.set(headers, 12);
|
|
54
55
|
out.set(body, headers.byteLength + 12);
|
|
55
|
-
|
|
56
|
+
checksum.update(out.subarray(8, length - 4));
|
|
57
|
+
view.setUint32(length - 4, checksum.digestSync(), false);
|
|
56
58
|
return out;
|
|
57
59
|
}
|
|
58
60
|
decode(message) {
|
package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Crc32 } from "@
|
|
1
|
+
import { Crc32 } from "@smithy/core/checksum";
|
|
2
2
|
const PRELUDE_MEMBER_LENGTH = 4;
|
|
3
3
|
const PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;
|
|
4
4
|
const CHECKSUM_LENGTH = 4;
|
|
@@ -15,13 +15,14 @@ export function splitMessage({ byteLength, byteOffset, buffer }) {
|
|
|
15
15
|
const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);
|
|
16
16
|
const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);
|
|
17
17
|
const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);
|
|
18
|
-
const checksummer = new Crc32()
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const checksummer = new Crc32();
|
|
19
|
+
checksummer.update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
|
|
20
|
+
if (expectedPreludeChecksum !== checksummer.digestSync()) {
|
|
21
|
+
throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digestSync()})`);
|
|
21
22
|
}
|
|
22
23
|
checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));
|
|
23
|
-
if (expectedMessageChecksum !== checksummer.
|
|
24
|
-
throw new Error(`The message checksum (${checksummer.
|
|
24
|
+
if (expectedMessageChecksum !== checksummer.digestSync()) {
|
|
25
|
+
throw new Error(`The message checksum (${checksummer.digestSync()}) did not match the expected value of ${expectedMessageChecksum}`);
|
|
25
26
|
}
|
|
26
27
|
return {
|
|
27
28
|
headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NormalizedSchema, TypeRegistry, translateTraits } from "@smithy/core/schema";
|
|
2
|
-
import { HttpRequest, HttpResponse } from "@smithy/core/transport";
|
|
2
|
+
import { HttpRequest, HttpResponse, isValidHostname } from "@smithy/core/transport";
|
|
3
3
|
import { SerdeContext } from "./SerdeContext";
|
|
4
4
|
export class HttpProtocol extends SerdeContext {
|
|
5
5
|
options;
|
|
@@ -84,6 +84,9 @@ export class HttpProtocol extends SerdeContext {
|
|
|
84
84
|
hostPrefix = hostPrefix.replace(`{${name}}`, replacement);
|
|
85
85
|
}
|
|
86
86
|
request.hostname = hostPrefix + request.hostname;
|
|
87
|
+
if (!isValidHostname(request.hostname)) {
|
|
88
|
+
throw new Error(`[${request.hostname}] is not a valid hostname.`);
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function concatBytes(arrays, length) {
|
|
2
|
+
if (length === undefined) {
|
|
3
|
+
length = 0;
|
|
4
|
+
for (const bytes of arrays) {
|
|
5
|
+
length += bytes.byteLength;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const result = new Uint8Array(length);
|
|
9
|
+
let offset = 0;
|
|
10
|
+
for (const buf of arrays) {
|
|
11
|
+
result.set(buf, offset);
|
|
12
|
+
offset += buf.byteLength;
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
@@ -19,6 +19,7 @@ export { toBase64, fromBase64 };
|
|
|
19
19
|
export { calculateBodyLength } from "./util-body-length/calculateBodyLength.browser";
|
|
20
20
|
export { toUint8Array } from "./util-utf8/toUint8Array.browser";
|
|
21
21
|
export { toUtf8, fromUtf8 };
|
|
22
|
+
export { concatBytes } from "./concatBytes";
|
|
22
23
|
export const fromArrayBuffer = no;
|
|
23
24
|
export const fromString = no;
|
|
24
25
|
export { isArrayBuffer } from "./is-array-buffer/is-array-buffer";
|
|
@@ -36,6 +37,7 @@ export { headStream } from "./util-stream/headStream.browser";
|
|
|
36
37
|
export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin.browser";
|
|
37
38
|
export { splitStream } from "./util-stream/splitStream.browser";
|
|
38
39
|
export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
40
|
+
export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
39
41
|
const _getRandomValues = (array) => crypto.getRandomValues(array);
|
|
40
42
|
export const v4 = bindV4(_getRandomValues);
|
|
41
43
|
export const generateIdempotencyToken = v4;
|
|
@@ -19,6 +19,7 @@ export { toBase64, fromBase64 };
|
|
|
19
19
|
export { calculateBodyLength } from "./util-body-length/calculateBodyLength";
|
|
20
20
|
export { toUint8Array } from "./util-utf8/toUint8Array";
|
|
21
21
|
export { toUtf8, fromUtf8 };
|
|
22
|
+
export { concatBytes } from "./concatBytes";
|
|
22
23
|
export { fromArrayBuffer, fromString } from "./util-buffer-from/buffer-from";
|
|
23
24
|
export { isArrayBuffer } from "./is-array-buffer/is-array-buffer";
|
|
24
25
|
export { deserializerMiddleware } from "./middleware-serde/deserializerMiddleware";
|
|
@@ -35,6 +36,7 @@ export { headStream } from "./util-stream/headStream";
|
|
|
35
36
|
export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin";
|
|
36
37
|
export { splitStream } from "./util-stream/splitStream";
|
|
37
38
|
export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
39
|
+
export { streamCollector } from "./util-stream/stream-collector";
|
|
38
40
|
const _getRandomValues = getRandomValues;
|
|
39
41
|
export const v4 = bindV4(_getRandomValues);
|
|
40
42
|
export const generateIdempotencyToken = v4;
|