@psnext/slingcli 2.5.20260602-3 → 2.5.20260607-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/bin/sling.js +59 -17
  2. package/node_modules/@aws-sdk/core/dist-cjs/index.js +12 -6
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -6
  4. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +1 -0
  5. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +11 -6
  6. package/node_modules/@aws-sdk/core/package.json +7 -7
  7. package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
  8. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -4
  9. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +7 -6
  10. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +2 -1
  11. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  12. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  13. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +2 -2
  14. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  15. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  16. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  17. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +1 -1
  18. package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -8
  19. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  20. package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
  21. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  22. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  23. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +7 -7
  24. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  25. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  26. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +5 -5
  27. package/node_modules/@aws-sdk/middleware-eventstream/package.json +5 -5
  28. package/node_modules/@aws-sdk/middleware-websocket/package.json +8 -8
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +99 -106
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +62 -120
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +55 -86
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +73 -104
  33. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +102 -185
  34. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +4 -5
  35. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/bdd.js +21 -57
  36. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +1 -2
  37. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +2 -4
  38. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +73 -41
  39. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +4 -5
  40. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +20 -52
  41. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +1 -2
  42. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +2 -4
  43. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +36 -59
  44. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js +4 -5
  45. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js +17 -45
  46. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +1 -2
  47. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +2 -4
  48. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +32 -32
  49. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +4 -5
  50. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js +17 -45
  51. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +1 -2
  52. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +2 -4
  53. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +50 -50
  54. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js +4 -5
  55. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js +1 -1
  56. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js +34 -96
  57. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +1 -2
  58. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +3 -6
  59. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +63 -80
  60. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -4
  61. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +7 -6
  62. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +2 -1
  63. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  64. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  65. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +2 -2
  66. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  67. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  68. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  69. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +1 -1
  70. package/node_modules/@aws-sdk/nested-clients/package.json +9 -9
  71. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
  72. package/node_modules/@aws-sdk/types/package.json +3 -3
  73. package/node_modules/@aws-sdk/util-locate-window/package.json +2 -2
  74. package/node_modules/@aws-sdk/xml-builder/package.json +3 -3
  75. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  76. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +3 -0
  77. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +45 -0
  78. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +827 -140
  79. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +32 -12
  80. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +13 -1
  81. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +4 -2
  82. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +15 -2
  84. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +1 -0
  85. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +4 -3
  86. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +9 -3
  87. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +19 -6
  88. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +3 -0
  89. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +47 -13
  90. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +72 -0
  91. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js +3 -0
  92. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +28 -20
  93. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +2 -30
  94. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +71 -30
  95. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +1 -0
  96. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +1 -1
  97. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +1 -1
  98. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +1 -1
  99. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +1 -1
  100. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +1 -1
  101. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +1 -1
  102. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js +130 -0
  103. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +1 -0
  104. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +54 -2
  105. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +2 -2
  106. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  107. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +7 -0
  108. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js +1 -0
  109. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +3 -12
  110. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +22 -0
  111. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js +86 -0
  112. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +40 -0
  113. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +55 -8
  114. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js +54 -22
  115. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js +22 -0
  116. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
  117. package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -4
  118. package/node_modules/@earendil-works/pi-tui/dist/utils.js +3 -0
  119. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  120. package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js +2 -2
  121. package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js +2 -0
  122. package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts +1 -1
  123. package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/node-http.d.ts +2 -0
  124. package/node_modules/@smithy/credential-provider-imds/package.json +1 -1
  125. package/node_modules/@types/node/README.md +1 -1
  126. package/node_modules/@types/node/http2.d.ts +3 -0
  127. package/node_modules/@types/node/package.json +2 -2
  128. package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  129. package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
  130. package/node_modules/gaxios/package.json +7 -9
  131. package/node_modules/google-auth-library/build/src/auth/gdchclient.d.ts +47 -0
  132. package/node_modules/google-auth-library/build/src/auth/gdchclient.js +307 -0
  133. package/node_modules/google-auth-library/build/src/auth/googleauth.d.ts +5 -4
  134. package/node_modules/google-auth-library/build/src/auth/googleauth.js +18 -1
  135. package/node_modules/google-auth-library/build/src/index.d.ts +1 -0
  136. package/node_modules/google-auth-library/build/src/index.js +4 -1
  137. package/node_modules/google-auth-library/package.json +2 -4
  138. package/node_modules/semver/classes/semver.js +19 -2
  139. package/node_modules/semver/package.json +1 -1
  140. package/node_modules/undici/lib/global.js +1 -1
  141. package/node_modules/undici/lib/handler/unwrap-handler.js +6 -0
  142. package/node_modules/undici/package.json +1 -1
  143. package/node_modules/undici/types/dispatcher.d.ts +2 -0
  144. package/package.json +6 -6
  145. package/slingshot/index.js +275 -273
package/bin/sling.js CHANGED
@@ -128,6 +128,47 @@ function stripUpdateRequestFlags(argv) {
128
128
  return argv.filter((arg) => arg !== "-y" && arg !== "--yes");
129
129
  }
130
130
 
131
+ async function fetchLatestNpmVersion() {
132
+ try {
133
+ const res = await fetch("https://registry.npmjs.org/@psnext/slingcli/latest", {
134
+ signal: AbortSignal.timeout(10000),
135
+ headers: { accept: "application/json" },
136
+ });
137
+ if (!res.ok) return null;
138
+ const data = await res.json();
139
+ return typeof data?.version === "string" ? data.version : null;
140
+ } catch {
141
+ return null;
142
+ }
143
+ }
144
+
145
+ async function fetchRemoteAppConfig() {
146
+ try {
147
+ const res = await fetch(
148
+ "https://raw.githubusercontent.com/psnext/slingcli/main/sling-app-config.json",
149
+ {
150
+ signal: AbortSignal.timeout(5000),
151
+ headers: { accept: "application/json" },
152
+ },
153
+ );
154
+ if (!res.ok) return null;
155
+ const data = await res.json();
156
+ if (!data || typeof data !== "object") return null;
157
+
158
+ const minVersion = typeof data.minVersion === "string" ? data.minVersion : null;
159
+ const updateMessage = typeof data.updateMessage === "string" ? data.updateMessage : null;
160
+
161
+ if (!minVersion || !semver.valid(minVersion)) return null;
162
+
163
+ return {
164
+ minVersion,
165
+ updateMessage,
166
+ };
167
+ } catch {
168
+ return null;
169
+ }
170
+ }
171
+
131
172
  function stripSlingWrapperFlags(argv) {
132
173
  // Wrapper-only flags. They should not be forwarded to pi-coding-agent,
133
174
  // which does not recognize them.
@@ -246,27 +287,27 @@ async function checkForUpdate(args) {
246
287
 
247
288
  const autoYes = hasUpdateRequest(args);
248
289
 
249
- if (!autoYes && (!process.stdin.isTTY || !process.stdout.isTTY)) return;
250
-
251
- let latestVersion;
252
- try {
253
- const res = await fetch("https://registry.npmjs.org/@psnext/slingcli/latest", {
254
- signal: AbortSignal.timeout(10000),
255
- headers: { accept: "application/json" },
256
- });
257
- if (!res.ok) return;
258
- const data = await res.json();
259
- latestVersion = data.version;
260
- } catch {
261
- return;
262
- }
290
+ const [latestVersion, remoteConfig] = await Promise.all([
291
+ fetchLatestNpmVersion(),
292
+ fetchRemoteAppConfig(),
293
+ ]);
263
294
 
264
295
  if (!latestVersion || !semver.gt(latestVersion, SLING_VERSION)) return;
265
296
 
266
- console.log(`A new version ${latestVersion} is available (current ${SLING_VERSION}).`);
297
+ // Gate 2: force if current < minVersion (user is below the minimum required)
298
+ const shouldForceUpdate = remoteConfig && semver.lt(SLING_VERSION, remoteConfig.minVersion);
299
+
300
+ if (!shouldForceUpdate && !autoYes && (!process.stdin.isTTY || !process.stdout.isTTY)) return;
301
+
302
+ if (shouldForceUpdate) {
303
+ if (remoteConfig?.updateMessage) console.log(remoteConfig.updateMessage);
304
+ console.log(`Required version ${latestVersion} detected. Updating now...`);
305
+ } else {
306
+ console.log(`A new version ${latestVersion} is available (current ${SLING_VERSION}).`);
307
+ }
267
308
 
268
- let shouldUpdate = autoYes;
269
- if (!autoYes) {
309
+ let shouldUpdate = autoYes || shouldForceUpdate;
310
+ if (!shouldUpdate) {
270
311
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
271
312
  let answer;
272
313
  try {
@@ -286,6 +327,7 @@ async function checkForUpdate(args) {
286
327
  console.error("✗ Auto-update failed. Run manually:");
287
328
  console.error(" npm install -g @psnext/slingcli@latest");
288
329
  console.error(" (you may need sudo)");
330
+ if (shouldForceUpdate) process.exit(1);
289
331
  return;
290
332
  }
291
333
 
@@ -135,6 +135,7 @@ class AwsSdkSigV4Signer {
135
135
  signingName = second?.signingName ?? signingName;
136
136
  }
137
137
  }
138
+ signingProperties._preRequestSystemClockOffset = config.systemClockOffset;
138
139
  const signedRequest = await signer.sign(httpRequest, {
139
140
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
140
141
  signingRegion: signingRegion,
@@ -144,14 +145,18 @@ class AwsSdkSigV4Signer {
144
145
  }
145
146
  errorHandler(signingProperties) {
146
147
  return (error) => {
147
- const serverTime = error.ServerTime ?? getDateHeader(error.$response);
148
+ const errorException = error;
149
+ const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response);
148
150
  if (serverTime) {
149
151
  const config = throwSigningPropertyError("config", signingProperties.config);
150
- const initialSystemClockOffset = config.systemClockOffset;
151
- config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
152
- const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
153
- if (clockSkewCorrected && error.$metadata) {
154
- error.$metadata.clockSkewCorrected = true;
152
+ const preRequestOffset = signingProperties._preRequestSystemClockOffset;
153
+ const newOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
154
+ const isLocalCorrection = newOffset !== config.systemClockOffset;
155
+ const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset;
156
+ const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection;
157
+ if (clockSkewCorrected && errorException.$metadata) {
158
+ config.systemClockOffset = newOffset;
159
+ errorException.$metadata.clockSkewCorrected = true;
155
160
  }
156
161
  }
157
162
  throw error;
@@ -175,6 +180,7 @@ class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
175
180
  const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
176
181
  const multiRegionOverride = (configResolvedSigningRegionSet ??
177
182
  signingRegionSet ?? [signingRegion]).join(",");
183
+ signingProperties._preRequestSystemClockOffset = config.systemClockOffset;
178
184
  const signedRequest = await signer.sign(httpRequest, {
179
185
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
180
186
  signingRegion: multiRegionOverride,
@@ -59,6 +59,7 @@ class AwsSdkSigV4Signer {
59
59
  signingName = second?.signingName ?? signingName;
60
60
  }
61
61
  }
62
+ signingProperties._preRequestSystemClockOffset = config.systemClockOffset;
62
63
  const signedRequest = await signer.sign(httpRequest, {
63
64
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
64
65
  signingRegion: signingRegion,
@@ -68,14 +69,18 @@ class AwsSdkSigV4Signer {
68
69
  }
69
70
  errorHandler(signingProperties) {
70
71
  return (error) => {
71
- const serverTime = error.ServerTime ?? getDateHeader(error.$response);
72
+ const errorException = error;
73
+ const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response);
72
74
  if (serverTime) {
73
75
  const config = throwSigningPropertyError("config", signingProperties.config);
74
- const initialSystemClockOffset = config.systemClockOffset;
75
- config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
76
- const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
77
- if (clockSkewCorrected && error.$metadata) {
78
- error.$metadata.clockSkewCorrected = true;
76
+ const preRequestOffset = signingProperties._preRequestSystemClockOffset;
77
+ const newOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
78
+ const isLocalCorrection = newOffset !== config.systemClockOffset;
79
+ const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset;
80
+ const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection;
81
+ if (clockSkewCorrected && errorException.$metadata) {
82
+ config.systemClockOffset = newOffset;
83
+ errorException.$metadata.clockSkewCorrected = true;
79
84
  }
80
85
  }
81
86
  throw error;
@@ -100,6 +105,7 @@ class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
100
105
  const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
101
106
  const multiRegionOverride = (configResolvedSigningRegionSet ??
102
107
  signingRegionSet ?? [signingRegion]).join(",");
108
+ signingProperties._preRequestSystemClockOffset = config.systemClockOffset;
103
109
  const signedRequest = await signer.sign(httpRequest, {
104
110
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
105
111
  signingRegion: multiRegionOverride,
@@ -10,6 +10,7 @@ export class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
10
10
  const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
11
11
  const multiRegionOverride = (configResolvedSigningRegionSet ??
12
12
  signingRegionSet ?? [signingRegion]).join(",");
13
+ signingProperties._preRequestSystemClockOffset = config.systemClockOffset;
13
14
  const signedRequest = await signer.sign(httpRequest, {
14
15
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
15
16
  signingRegion: multiRegionOverride,
@@ -39,6 +39,7 @@ export class AwsSdkSigV4Signer {
39
39
  signingName = second?.signingName ?? signingName;
40
40
  }
41
41
  }
42
+ signingProperties._preRequestSystemClockOffset = config.systemClockOffset;
42
43
  const signedRequest = await signer.sign(httpRequest, {
43
44
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
44
45
  signingRegion: signingRegion,
@@ -48,14 +49,18 @@ export class AwsSdkSigV4Signer {
48
49
  }
49
50
  errorHandler(signingProperties) {
50
51
  return (error) => {
51
- const serverTime = error.ServerTime ?? getDateHeader(error.$response);
52
+ const errorException = error;
53
+ const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response);
52
54
  if (serverTime) {
53
55
  const config = throwSigningPropertyError("config", signingProperties.config);
54
- const initialSystemClockOffset = config.systemClockOffset;
55
- config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
56
- const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
57
- if (clockSkewCorrected && error.$metadata) {
58
- error.$metadata.clockSkewCorrected = true;
56
+ const preRequestOffset = signingProperties._preRequestSystemClockOffset;
57
+ const newOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
58
+ const isLocalCorrection = newOffset !== config.systemClockOffset;
59
+ const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset;
60
+ const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection;
61
+ if (clockSkewCorrected && errorException.$metadata) {
62
+ config.systemClockOffset = newOffset;
63
+ errorException.$metadata.clockSkewCorrected = true;
59
64
  }
60
65
  }
61
66
  throw error;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.974.15",
3
+ "version": "3.974.18",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "scripts": {
6
6
  "build": "yarn prebuild && yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
@@ -106,16 +106,16 @@
106
106
  ],
107
107
  "author": {
108
108
  "name": "AWS SDK for JavaScript Team",
109
- "url": "https://aws.amazon.com/javascript/"
109
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
110
110
  },
111
111
  "license": "Apache-2.0",
112
112
  "dependencies": {
113
- "@aws-sdk/types": "^3.973.9",
114
- "@aws-sdk/xml-builder": "^3.972.26",
113
+ "@aws-sdk/types": "^3.973.11",
114
+ "@aws-sdk/xml-builder": "^3.972.28",
115
115
  "@aws/lambda-invoke-store": "^0.2.2",
116
- "@smithy/core": "^3.24.5",
117
- "@smithy/signature-v4": "^5.4.5",
118
- "@smithy/types": "^4.14.2",
116
+ "@smithy/core": "^3.24.6",
117
+ "@smithy/signature-v4": "^5.4.6",
118
+ "@smithy/types": "^4.14.3",
119
119
  "bowser": "^2.11.0",
120
120
  "tslib": "^2.6.2"
121
121
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-env",
3
- "version": "3.972.41",
3
+ "version": "3.972.44",
4
4
  "description": "AWS credential provider that sources credentials from known environment variables",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -22,14 +22,14 @@
22
22
  "sideEffects": false,
23
23
  "author": {
24
24
  "name": "AWS SDK for JavaScript Team",
25
- "url": "https://aws.amazon.com/javascript/"
25
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/core": "^3.974.15",
30
- "@aws-sdk/types": "^3.973.9",
31
- "@smithy/core": "^3.24.5",
32
- "@smithy/types": "^4.14.2",
29
+ "@aws-sdk/core": "^3.974.18",
30
+ "@aws-sdk/types": "^3.973.11",
31
+ "@smithy/core": "^3.24.6",
32
+ "@smithy/types": "^4.14.3",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var node_https = require('node:https');
4
3
  var protocols = require('@smithy/core/protocols');
4
+ var node_https = require('node:https');
5
5
  var node_stream = require('node:stream');
6
6
  var http2 = require('node:http2');
7
7
 
@@ -414,7 +414,8 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
414
414
  socketAcquisitionWarningTimeout,
415
415
  throwOnRequestTimeout,
416
416
  httpAgentProvider: async () => {
417
- const { Agent, request } = await import('node:http');
417
+ const node_http = await import('node:http');
418
+ const { Agent, request } = node_http.default ?? node_http;
418
419
  hRequest = request;
419
420
  hAgent = Agent;
420
421
  if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") {
@@ -666,6 +667,7 @@ class NodeHttp2ConnectionManager {
666
667
  }
667
668
  }
668
669
 
670
+ const { constants } = http2;
669
671
  class NodeHttp2Handler {
670
672
  config;
671
673
  configProvider;
@@ -760,8 +762,8 @@ class NodeHttp2Handler {
760
762
  }
761
763
  const clientHttp2Stream = session.request({
762
764
  ...request.headers,
763
- [http2.constants.HTTP2_HEADER_PATH]: path,
764
- [http2.constants.HTTP2_HEADER_METHOD]: method,
765
+ [constants.HTTP2_HEADER_PATH]: path,
766
+ [constants.HTTP2_HEADER_METHOD]: method,
765
767
  });
766
768
  if (effectiveRequestTimeout) {
767
769
  clientHttp2Stream.setTimeout(effectiveRequestTimeout, () => {
@@ -1,8 +1,8 @@
1
- import { Agent as hsAgent, request as hsRequest } from "node:https";
2
1
  import { HttpResponse, buildQueryString } from "@smithy/core/protocols";
3
2
  import { buildAbortError } from "./build-abort-error";
4
3
  import { NODEJS_TIMEOUT_ERROR_CODES } from "./constants";
5
4
  import { getTransformedHeaders } from "./get-transformed-headers";
5
+ import { node_https } from "./node-https";
6
6
  import { setConnectionTimeout } from "./set-connection-timeout";
7
7
  import { setRequestTimeout } from "./set-request-timeout";
8
8
  import { setSocketKeepAlive } from "./set-socket-keep-alive";
@@ -107,7 +107,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
107
107
  const expectContinue = headers ? (headers.Expect ?? headers.expect) === "100-continue" : false;
108
108
  let agent = isSSL ? config.httpsAgent : config.httpAgent;
109
109
  if (expectContinue && !this.externalAgent) {
110
- agent = new (isSSL ? hsAgent : hAgent)({
110
+ agent = new (isSSL ? node_https.Agent : hAgent)({
111
111
  keepAlive: false,
112
112
  maxSockets: Infinity,
113
113
  });
@@ -145,7 +145,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
145
145
  agent,
146
146
  auth,
147
147
  };
148
- const requestFunc = isSSL ? hsRequest : hRequest;
148
+ const requestFunc = isSSL ? node_https.request : hRequest;
149
149
  const req = requestFunc(nodeHttpsOptions, (res) => {
150
150
  const httpResponse = new HttpResponse({
151
151
  statusCode: res.statusCode || -1,
@@ -218,7 +218,8 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
218
218
  socketAcquisitionWarningTimeout,
219
219
  throwOnRequestTimeout,
220
220
  httpAgentProvider: async () => {
221
- const { Agent, request } = await import("node:http");
221
+ const node_http = await import("node:http");
222
+ const { Agent, request } = node_http.default ?? node_http;
222
223
  hRequest = request;
223
224
  hAgent = Agent;
224
225
  if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") {
@@ -228,11 +229,11 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
228
229
  return new hAgent({ keepAlive, maxSockets, ...httpAgent });
229
230
  },
230
231
  httpsAgent: (() => {
231
- if (httpsAgent instanceof hsAgent || typeof httpsAgent?.destroy === "function") {
232
+ if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") {
232
233
  this.externalAgent = true;
233
234
  return httpsAgent;
234
235
  }
235
- return new hsAgent({ keepAlive, maxSockets, ...httpsAgent });
236
+ return new node_https.Agent({ keepAlive, maxSockets, ...httpsAgent });
236
237
  })(),
237
238
  logger,
238
239
  };
@@ -1,9 +1,10 @@
1
- import { constants } from "node:http2";
2
1
  import { HttpResponse, buildQueryString } from "@smithy/core/protocols";
3
2
  import { buildAbortError } from "./build-abort-error";
4
3
  import { getTransformedHeaders } from "./get-transformed-headers";
4
+ import { node_http2 } from "./node-http2";
5
5
  import { NodeHttp2ConnectionManager } from "./node-http2-connection-manager";
6
6
  import { writeRequestBody } from "./write-request-body";
7
+ const { constants } = node_http2;
7
8
  export class NodeHttp2Handler {
8
9
  config;
9
10
  configProvider;
@@ -0,0 +1,2 @@
1
+ import node_http2 from "node:http2";
2
+ export { node_http2 };
@@ -0,0 +1,2 @@
1
+ import node_https from "node:https";
2
+ export { node_https };
@@ -1,5 +1,5 @@
1
1
  import type { Agent as hAgentType } from "node:http";
2
- import { Agent as hsAgent } from "node:https";
2
+ import type { Agent as hsAgentType } from "node:https";
3
3
  import { HttpResponse, type HttpHandler, type HttpRequest } from "@smithy/core/protocols";
4
4
  import type { HttpHandlerOptions, Logger, NodeHttpHandlerOptions, Provider } from "@smithy/types";
5
5
  export { NodeHttpHandlerOptions };
@@ -35,7 +35,7 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
35
35
  * @param logger - channel for the warning.
36
36
  * @returns timestamp of last emitted warning.
37
37
  */
38
- static checkSocketUsage(agent: hAgentType | hsAgent, socketWarningTimestamp: number, logger?: Logger): number;
38
+ static checkSocketUsage(agent: hAgentType | hsAgentType, socketWarningTimestamp: number, logger?: Logger): number;
39
39
  constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
40
40
  destroy(): void;
41
41
  handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
@@ -1,4 +1,4 @@
1
- import { type ClientSessionOptions, type SecureClientSessionOptions } from "node:http2";
1
+ import type { ClientSessionOptions, SecureClientSessionOptions } from "node:http2";
2
2
  import { HttpResponse, type HttpHandler, type HttpRequest } from "@smithy/core/protocols";
3
3
  import type { HttpHandlerOptions, Provider } from "@smithy/types";
4
4
  /**
@@ -0,0 +1,2 @@
1
+ import node_http2 from "node:http2";
2
+ export { node_http2 };
@@ -0,0 +1,2 @@
1
+ import node_https from "node:https";
2
+ export { node_https };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.7.6",
3
+ "version": "4.7.7",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-http",
3
- "version": "3.972.43",
3
+ "version": "3.972.46",
4
4
  "description": "AWS credential provider for containers and HTTP sources",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -33,16 +33,16 @@
33
33
  "sideEffects": false,
34
34
  "author": {
35
35
  "name": "AWS SDK for JavaScript Team",
36
- "url": "https://aws.amazon.com/javascript/"
36
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
37
37
  },
38
38
  "license": "Apache-2.0",
39
39
  "dependencies": {
40
- "@aws-sdk/core": "^3.974.15",
41
- "@aws-sdk/types": "^3.973.9",
42
- "@smithy/core": "^3.24.5",
43
- "@smithy/fetch-http-handler": "^5.4.5",
44
- "@smithy/node-http-handler": "^4.7.5",
45
- "@smithy/types": "^4.14.2",
40
+ "@aws-sdk/core": "^3.974.18",
41
+ "@aws-sdk/types": "^3.973.11",
42
+ "@smithy/core": "^3.24.6",
43
+ "@smithy/fetch-http-handler": "^5.4.6",
44
+ "@smithy/node-http-handler": "^4.7.6",
45
+ "@smithy/types": "^4.14.3",
46
46
  "tslib": "^2.6.2"
47
47
  },
48
48
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-ini",
3
- "version": "3.972.46",
3
+ "version": "3.972.50",
4
4
  "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -24,22 +24,22 @@
24
24
  "sideEffects": false,
25
25
  "author": {
26
26
  "name": "AWS SDK for JavaScript Team",
27
- "url": "https://aws.amazon.com/javascript/"
27
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@aws-sdk/core": "^3.974.15",
32
- "@aws-sdk/credential-provider-env": "^3.972.41",
33
- "@aws-sdk/credential-provider-http": "^3.972.43",
34
- "@aws-sdk/credential-provider-login": "^3.972.45",
35
- "@aws-sdk/credential-provider-process": "^3.972.41",
36
- "@aws-sdk/credential-provider-sso": "^3.972.45",
37
- "@aws-sdk/credential-provider-web-identity": "^3.972.45",
38
- "@aws-sdk/nested-clients": "^3.997.13",
39
- "@aws-sdk/types": "^3.973.9",
40
- "@smithy/core": "^3.24.5",
41
- "@smithy/credential-provider-imds": "^4.3.6",
42
- "@smithy/types": "^4.14.2",
31
+ "@aws-sdk/core": "^3.974.18",
32
+ "@aws-sdk/credential-provider-env": "^3.972.44",
33
+ "@aws-sdk/credential-provider-http": "^3.972.46",
34
+ "@aws-sdk/credential-provider-login": "^3.972.49",
35
+ "@aws-sdk/credential-provider-process": "^3.972.44",
36
+ "@aws-sdk/credential-provider-sso": "^3.972.49",
37
+ "@aws-sdk/credential-provider-web-identity": "^3.972.49",
38
+ "@aws-sdk/nested-clients": "^3.997.17",
39
+ "@aws-sdk/types": "^3.973.11",
40
+ "@smithy/core": "^3.24.6",
41
+ "@smithy/credential-provider-imds": "^4.3.7",
42
+ "@smithy/types": "^4.14.3",
43
43
  "tslib": "^2.6.2"
44
44
  },
45
45
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-login",
3
- "version": "3.972.45",
3
+ "version": "3.972.49",
4
4
  "description": "AWS credential provider that sources credentials from aws login cached tokens",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -24,15 +24,15 @@
24
24
  "sideEffects": false,
25
25
  "author": {
26
26
  "name": "AWS SDK for JavaScript Team",
27
- "url": "https://aws.amazon.com/javascript/"
27
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@aws-sdk/core": "^3.974.15",
32
- "@aws-sdk/nested-clients": "^3.997.13",
33
- "@aws-sdk/types": "^3.973.9",
34
- "@smithy/core": "^3.24.5",
35
- "@smithy/types": "^4.14.2",
31
+ "@aws-sdk/core": "^3.974.18",
32
+ "@aws-sdk/nested-clients": "^3.997.17",
33
+ "@aws-sdk/types": "^3.973.11",
34
+ "@smithy/core": "^3.24.6",
35
+ "@smithy/types": "^4.14.3",
36
36
  "tslib": "^2.6.2"
37
37
  },
38
38
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-node",
3
- "version": "3.972.48",
3
+ "version": "3.972.52",
4
4
  "description": "AWS credential provider that sources credentials from a Node.JS environment. ",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -27,20 +27,20 @@
27
27
  "sideEffects": false,
28
28
  "author": {
29
29
  "name": "AWS SDK for JavaScript Team",
30
- "url": "https://aws.amazon.com/javascript/"
30
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
31
31
  },
32
32
  "license": "Apache-2.0",
33
33
  "dependencies": {
34
- "@aws-sdk/credential-provider-env": "^3.972.41",
35
- "@aws-sdk/credential-provider-http": "^3.972.43",
36
- "@aws-sdk/credential-provider-ini": "^3.972.46",
37
- "@aws-sdk/credential-provider-process": "^3.972.41",
38
- "@aws-sdk/credential-provider-sso": "^3.972.45",
39
- "@aws-sdk/credential-provider-web-identity": "^3.972.45",
40
- "@aws-sdk/types": "^3.973.9",
41
- "@smithy/core": "^3.24.5",
42
- "@smithy/credential-provider-imds": "^4.3.6",
43
- "@smithy/types": "^4.14.2",
34
+ "@aws-sdk/credential-provider-env": "^3.972.44",
35
+ "@aws-sdk/credential-provider-http": "^3.972.46",
36
+ "@aws-sdk/credential-provider-ini": "^3.972.50",
37
+ "@aws-sdk/credential-provider-process": "^3.972.44",
38
+ "@aws-sdk/credential-provider-sso": "^3.972.49",
39
+ "@aws-sdk/credential-provider-web-identity": "^3.972.49",
40
+ "@aws-sdk/types": "^3.973.11",
41
+ "@smithy/core": "^3.24.6",
42
+ "@smithy/credential-provider-imds": "^4.3.7",
43
+ "@smithy/types": "^4.14.3",
44
44
  "tslib": "^2.6.2"
45
45
  },
46
46
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-process",
3
- "version": "3.972.41",
3
+ "version": "3.972.44",
4
4
  "description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -22,14 +22,14 @@
22
22
  "sideEffects": false,
23
23
  "author": {
24
24
  "name": "AWS SDK for JavaScript Team",
25
- "url": "https://aws.amazon.com/javascript/"
25
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/core": "^3.974.15",
30
- "@aws-sdk/types": "^3.973.9",
31
- "@smithy/core": "^3.24.5",
32
- "@smithy/types": "^4.14.2",
29
+ "@aws-sdk/core": "^3.974.18",
30
+ "@aws-sdk/types": "^3.973.11",
31
+ "@smithy/core": "^3.24.6",
32
+ "@smithy/types": "^4.14.3",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {