@code-yeongyu/senpi 2026.8.23 → 2026.8.24

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 (165) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/core/agent-abort-provenance.d.ts +5 -5
  3. package/dist/core/agent-abort-provenance.d.ts.map +1 -1
  4. package/dist/core/agent-abort-provenance.js +3 -0
  5. package/dist/core/agent-abort-provenance.js.map +1 -1
  6. package/dist/core/agent-session.d.ts +3 -0
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js +4 -0
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/extensions/builtin/goal/agent-end-continuation.d.ts.map +1 -1
  11. package/dist/core/extensions/builtin/goal/agent-end-continuation.js +10 -0
  12. package/dist/core/extensions/builtin/goal/agent-end-continuation.js.map +1 -1
  13. package/dist/core/extensions/builtin/goal/continuation.d.ts +1 -1
  14. package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
  15. package/dist/core/extensions/builtin/goal/continuation.js +1 -1
  16. package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
  17. package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
  18. package/dist/core/extensions/builtin/goal/index.js +0 -8
  19. package/dist/core/extensions/builtin/goal/index.js.map +1 -1
  20. package/dist/core/extensions/builtin/goal/monitor-continuation-types.d.ts +1 -0
  21. package/dist/core/extensions/builtin/goal/monitor-continuation-types.d.ts.map +1 -1
  22. package/dist/core/extensions/builtin/goal/monitor-continuation-types.js.map +1 -1
  23. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +2 -1
  24. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  25. package/dist/core/extensions/builtin/goal/monitor-continuation.js +31 -3
  26. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  27. package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -1
  28. package/dist/core/extensions/builtin/goal/wait-ticker.js +14 -9
  29. package/dist/core/extensions/builtin/goal/wait-ticker.js.map +1 -1
  30. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.d.ts.map +1 -1
  31. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.js +5 -23
  32. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.js.map +1 -1
  33. package/dist/core/extensions/builtin/webfetch/webfetch/response-body.d.ts +11 -0
  34. package/dist/core/extensions/builtin/webfetch/webfetch/response-body.d.ts.map +1 -0
  35. package/dist/core/extensions/builtin/webfetch/webfetch/response-body.js +54 -0
  36. package/dist/core/extensions/builtin/webfetch/webfetch/response-body.js.map +1 -0
  37. package/dist/core/tools/read.d.ts.map +1 -1
  38. package/dist/core/tools/read.js +5 -0
  39. package/dist/core/tools/read.js.map +1 -1
  40. package/dist/modes/interactive/aborted-error-label.d.ts +2 -1
  41. package/dist/modes/interactive/aborted-error-label.d.ts.map +1 -1
  42. package/dist/modes/interactive/aborted-error-label.js +20 -5
  43. package/dist/modes/interactive/aborted-error-label.js.map +1 -1
  44. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  45. package/dist/modes/interactive/interactive-mode.js +11 -3
  46. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  47. package/dist/modes/interactive/streaming-reveal.d.ts +8 -0
  48. package/dist/modes/interactive/streaming-reveal.d.ts.map +1 -1
  49. package/dist/modes/interactive/streaming-reveal.js +12 -0
  50. package/dist/modes/interactive/streaming-reveal.js.map +1 -1
  51. package/docs/AGENTS.md +3 -1
  52. package/examples/AGENTS.md +21 -6
  53. package/examples/extensions/AGENTS.md +50 -0
  54. package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +90 -88
  55. package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +40 -40
  56. package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +20 -21
  57. package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +24 -25
  58. package/node_modules/@anthropic-ai/claude-agent-sdk/package.json +2 -2
  59. package/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +102 -5
  60. package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +31 -15
  61. package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +80 -78
  62. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -1
  63. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +13 -13
  64. package/node_modules/@aws-sdk/core/package.json +5 -5
  65. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  66. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  67. package/node_modules/@aws-sdk/credential-provider-ini/package.json +12 -12
  68. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  69. package/node_modules/@aws-sdk/credential-provider-node/package.json +10 -10
  70. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  71. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  72. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  73. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
  74. package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
  75. package/node_modules/@aws-sdk/middleware-websocket/package.json +6 -6
  76. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  77. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  78. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  79. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  80. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  81. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  82. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
  83. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  84. package/node_modules/@aws-sdk/types/package.json +2 -2
  85. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  86. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +14 -0
  87. package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
  88. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/AGENTS.md +40 -0
  89. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/AGENTS.md +40 -0
  90. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +1 -1
  91. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-notification.ts +3 -8
  92. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-notification-queue.ts +2 -6
  93. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  94. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  95. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  96. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
  97. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  98. package/node_modules/@earendil-works/pi-ai/package.json +4 -4
  99. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  100. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  101. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  102. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +7 -4
  103. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  104. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  105. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +19 -7
  106. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -1
  107. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +4 -1
  108. package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +4 -1
  109. package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +10 -3
  110. package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +4 -1
  111. package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +4 -1
  112. package/node_modules/@smithy/signature-v4/package.json +2 -2
  113. package/node_modules/typebox/build/format/email.mjs +1 -1
  114. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
  115. package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
  116. package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
  117. package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
  118. package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
  119. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  120. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  121. package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
  122. package/node_modules/typebox/build/system/memory/create.mjs +3 -4
  123. package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
  124. package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
  125. package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
  126. package/node_modules/typebox/build/system/memory/update.mjs +3 -2
  127. package/node_modules/typebox/package.json +1 -1
  128. package/package.json +36 -36
  129. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +0 -201
  130. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +0 -62
  131. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +0 -154
  132. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +0 -2
  133. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +0 -16
  134. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +0 -80
  135. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +0 -8
  136. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +0 -11
  137. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +0 -10
  138. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +0 -4
  139. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +0 -5
  140. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +0 -7
  141. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +0 -7
  142. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +0 -8
  143. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +0 -8
  144. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +0 -18
  145. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +0 -12
  146. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +0 -9
  147. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +0 -8
  148. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +0 -7
  149. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +0 -7
  150. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +0 -18
  151. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +0 -3
  152. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +0 -8
  153. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +0 -10
  154. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +0 -5
  155. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +0 -9
  156. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +0 -7
  157. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +0 -7
  158. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +0 -3
  159. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +0 -2
  160. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +0 -1
  161. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +0 -2
  162. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +0 -5
  163. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +0 -4
  164. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +0 -5
  165. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +0 -69
@@ -1,80 +0,0 @@
1
- import { getProfileName, getSSOTokenFromFile, loadSsoSessionData, parseKnownFiles, TokenProviderError, } from "@smithy/core/config";
2
- import { EXPIRE_WINDOW_MS, REFRESH_MESSAGE } from "./constants";
3
- import { getNewSsoOidcToken } from "./getNewSsoOidcToken";
4
- import { validateTokenExpiry } from "./validateTokenExpiry";
5
- import { validateTokenKey } from "./validateTokenKey";
6
- import { writeSSOTokenToFile } from "./writeSSOTokenToFile";
7
- const lastRefreshAttemptTime = new Date(0);
8
- export const fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
9
- init.logger?.debug("@aws-sdk/token-providers - fromSso");
10
- const profiles = await parseKnownFiles(init);
11
- const profileName = getProfileName({
12
- profile: init.profile ?? callerClientConfig?.profile,
13
- });
14
- const profile = profiles[profileName];
15
- if (!profile) {
16
- throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
17
- }
18
- else if (!profile["sso_session"]) {
19
- throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
20
- }
21
- const ssoSessionName = profile["sso_session"];
22
- const ssoSessions = await loadSsoSessionData(init);
23
- const ssoSession = ssoSessions[ssoSessionName];
24
- if (!ssoSession) {
25
- throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
26
- }
27
- for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
28
- if (!ssoSession[ssoSessionRequiredKey]) {
29
- throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
30
- }
31
- }
32
- const ssoStartUrl = ssoSession["sso_start_url"];
33
- const ssoRegion = ssoSession["sso_region"];
34
- let ssoToken;
35
- try {
36
- ssoToken = await getSSOTokenFromFile(ssoSessionName);
37
- }
38
- catch (e) {
39
- throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
40
- }
41
- validateTokenKey("accessToken", ssoToken.accessToken);
42
- validateTokenKey("expiresAt", ssoToken.expiresAt);
43
- const { accessToken, expiresAt } = ssoToken;
44
- const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
45
- if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
46
- return existingToken;
47
- }
48
- if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {
49
- validateTokenExpiry(existingToken);
50
- return existingToken;
51
- }
52
- validateTokenKey("clientId", ssoToken.clientId, true);
53
- validateTokenKey("clientSecret", ssoToken.clientSecret, true);
54
- validateTokenKey("refreshToken", ssoToken.refreshToken, true);
55
- try {
56
- lastRefreshAttemptTime.setTime(Date.now());
57
- const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);
58
- validateTokenKey("accessToken", newSsoOidcToken.accessToken);
59
- validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
60
- const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);
61
- try {
62
- await writeSSOTokenToFile(ssoSessionName, {
63
- ...ssoToken,
64
- accessToken: newSsoOidcToken.accessToken,
65
- expiresAt: newTokenExpiration.toISOString(),
66
- refreshToken: newSsoOidcToken.refreshToken,
67
- });
68
- }
69
- catch (error) {
70
- }
71
- return {
72
- token: newSsoOidcToken.accessToken,
73
- expiration: newTokenExpiration,
74
- };
75
- }
76
- catch (error) {
77
- validateTokenExpiry(existingToken);
78
- return existingToken;
79
- }
80
- };
@@ -1,8 +0,0 @@
1
- import { TokenProviderError } from "@smithy/core/config";
2
- export const fromStatic = ({ token, logger }) => async () => {
3
- logger?.debug("@aws-sdk/token-providers - fromStatic");
4
- if (!token || !token.token) {
5
- throw new TokenProviderError(`Please pass a valid token to fromStatic`, false);
6
- }
7
- return token;
8
- };
@@ -1,11 +0,0 @@
1
- import { getSsoOidcClient } from "./getSsoOidcClient";
2
- export const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
3
- const { CreateTokenCommand } = await import("@aws-sdk/nested-clients/sso-oidc");
4
- const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
5
- return ssoOidcClient.send(new CreateTokenCommand({
6
- clientId: ssoToken.clientId,
7
- clientSecret: ssoToken.clientSecret,
8
- refreshToken: ssoToken.refreshToken,
9
- grantType: "refresh_token",
10
- }));
11
- };
@@ -1,10 +0,0 @@
1
- export const getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
2
- const { SSOOIDCClient } = await import("@aws-sdk/nested-clients/sso-oidc");
3
- const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
4
- const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
5
- region: ssoRegion ?? init.clientConfig?.region,
6
- logger: coalesce("logger"),
7
- userAgentAppId: coalesce("userAgentAppId"),
8
- }));
9
- return ssoOidcClient;
10
- };
@@ -1,4 +0,0 @@
1
- export { fromEnvSigningName } from "./fromEnvSigningName";
2
- export { fromSso } from "./fromSso";
3
- export { fromStatic } from "./fromStatic";
4
- export { nodeProvider } from "./nodeProvider";
@@ -1,5 +0,0 @@
1
- import { chain, memoize, TokenProviderError } from "@smithy/core/config";
2
- import { fromSso } from "./fromSso";
3
- export const nodeProvider = (init = {}) => memoize(chain(fromSso(init), async () => {
4
- throw new TokenProviderError("Could not load token from any providers", false);
5
- }), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);
@@ -1,7 +0,0 @@
1
- import { TokenProviderError } from "@smithy/core/config";
2
- import { REFRESH_MESSAGE } from "./constants";
3
- export const validateTokenExpiry = (token) => {
4
- if (token.expiration && token.expiration.getTime() < Date.now()) {
5
- throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
6
- }
7
- };
@@ -1,7 +0,0 @@
1
- import { TokenProviderError } from "@smithy/core/config";
2
- import { REFRESH_MESSAGE } from "./constants";
3
- export const validateTokenKey = (key, value, forRefresh = false) => {
4
- if (typeof value === "undefined") {
5
- throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
6
- }
7
- };
@@ -1,8 +0,0 @@
1
- import { getSSOTokenFilepath } from "@smithy/core/config";
2
- import { promises as fsPromises } from "node:fs";
3
- const { writeFile } = fsPromises;
4
- export const writeSSOTokenToFile = (id, ssoToken) => {
5
- const tokenFilepath = getSSOTokenFilepath(id);
6
- const tokenString = JSON.stringify(ssoToken, null, 2);
7
- return writeFile(tokenFilepath, tokenString);
8
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * The time window (5 mins) that SDK will treat the SSO token expires in before the defined expiration date in token.
3
- * This is needed because server side may have invalidated the token before the defined expiration date.
4
- *
5
- * @internal
6
- */
7
- export declare const EXPIRE_WINDOW_MS: number;
8
- export declare const REFRESH_MESSAGE = "To refresh this SSO session run 'aws sso login' with the corresponding profile.";
@@ -1,18 +0,0 @@
1
- import type { CredentialProviderOptions, TokenIdentityProvider } from "@aws-sdk/types";
2
- /**
3
- * @public
4
- */
5
- export interface FromEnvSigningNameInit extends CredentialProviderOptions {
6
- signingName?: string;
7
- }
8
- /**
9
- * Creates a TokenIdentityProvider that retrieves bearer token from environment variable
10
- *
11
- * @param options - Configuration options for the token provider
12
- * @param options.logger - Optional logger for debug messages
13
- * @param options.signingName - Service signing name used to determine environment variable key
14
- * @returns TokenIdentityProvider that provides bearer token from environment variable
15
- *
16
- * @public
17
- */
18
- export declare const fromEnvSigningName: ({ logger, signingName }?: FromEnvSigningNameInit) => TokenIdentityProvider;
@@ -1,12 +0,0 @@
1
- import type { CredentialProviderOptions, RuntimeConfigIdentityProvider, TokenIdentity } from "@aws-sdk/types";
2
- import type { SourceProfileInit } from "@smithy/core/config";
3
- export interface FromSsoInit extends SourceProfileInit, CredentialProviderOptions {
4
- /**
5
- * @see SSOOIDCClientConfig in \@aws-sdk/client-sso-oidc.
6
- */
7
- clientConfig?: any;
8
- }
9
- /**
10
- * Creates a token provider that will read from SSO token cache or ssoOidc.createToken() call.
11
- */
12
- export declare const fromSso: (init?: FromSsoInit) => RuntimeConfigIdentityProvider<TokenIdentity>;
@@ -1,9 +0,0 @@
1
- import type { CredentialProviderOptions, TokenIdentity, TokenIdentityProvider } from "@aws-sdk/types";
2
- export interface FromStaticInit extends CredentialProviderOptions {
3
- token?: TokenIdentity;
4
- }
5
- /**
6
- * Creates a token provider that will read from static token.
7
- * @public
8
- */
9
- export declare const fromStatic: ({ token, logger }: FromStaticInit) => TokenIdentityProvider;
@@ -1,8 +0,0 @@
1
- import type { AwsIdentityProperties } from "@aws-sdk/types";
2
- import type { SSOToken } from "@smithy/core/config";
3
- import type { FromSsoInit } from "./fromSso";
4
- /**
5
- * Returns a new SSO OIDC token from SSOOIDC::createToken() API call.
6
- * @internal
7
- */
8
- export declare const getNewSsoOidcToken: (ssoToken: SSOToken, ssoRegion: string, init?: FromSsoInit, callerClientConfig?: AwsIdentityProperties["callerClientConfig"]) => Promise<import("@aws-sdk/nested-clients/sso-oidc").CreateTokenCommandOutput>;
@@ -1,7 +0,0 @@
1
- import type { AwsIdentityProperties } from "@aws-sdk/types";
2
- import type { FromSsoInit } from "./fromSso";
3
- /**
4
- * Returns a SSOOIDC client for the given region.
5
- * @internal
6
- */
7
- export declare const getSsoOidcClient: (ssoRegion: string, init?: FromSsoInit, callerClientConfig?: AwsIdentityProperties["callerClientConfig"]) => Promise<import("@aws-sdk/nested-clients/sso-oidc").SSOOIDCClient>;
@@ -1,7 +0,0 @@
1
- export { fromEnvSigningName } from "./fromEnvSigningName";
2
- export type { FromEnvSigningNameInit } from "./fromEnvSigningName";
3
- export { fromSso } from "./fromSso";
4
- export type { FromSsoInit } from "./fromSso";
5
- export { fromStatic } from "./fromStatic";
6
- export type { FromStaticInit } from "./fromStatic";
7
- export { nodeProvider } from "./nodeProvider";
@@ -1,18 +0,0 @@
1
- import type { TokenIdentityProvider } from "@aws-sdk/types";
2
- import type { FromSsoInit } from "./fromSso";
3
- /**
4
- * Creates a token provider that will attempt to find token from the
5
- * following sources (listed in order of precedence):
6
- * * SSO token from SSO cache or ssoOidc.createToken() call
7
- *
8
- * The default token provider is designed to invoke one provider at a time and only
9
- * continue to the next if no token has been located. It currently has only SSO
10
- * Token Provider in the chain.
11
- *
12
- * @param init Configuration that is passed to each individual
13
- * provider
14
- *
15
- * @see fromSso The function used to source credentials from
16
- * SSO cache or ssoOidc.createToken() call
17
- */
18
- export declare const nodeProvider: (init?: FromSsoInit) => TokenIdentityProvider;
@@ -1,3 +0,0 @@
1
- export declare const EXPIRE_WINDOW_MS: number;
2
- export declare const REFRESH_MESSAGE =
3
- "To refresh this SSO session run 'aws sso login' with the corresponding profile.";
@@ -1,8 +0,0 @@
1
- import { CredentialProviderOptions, TokenIdentityProvider } from "@aws-sdk/types";
2
- export interface FromEnvSigningNameInit extends CredentialProviderOptions {
3
- signingName?: string;
4
- }
5
- export declare const fromEnvSigningName: ({
6
- logger,
7
- signingName,
8
- }?: FromEnvSigningNameInit) => TokenIdentityProvider;
@@ -1,10 +0,0 @@
1
- import {
2
- CredentialProviderOptions,
3
- RuntimeConfigIdentityProvider,
4
- TokenIdentity,
5
- } from "@aws-sdk/types";
6
- import { SourceProfileInit } from "@smithy/core/config";
7
- export interface FromSsoInit extends SourceProfileInit, CredentialProviderOptions {
8
- clientConfig?: any;
9
- }
10
- export declare const fromSso: (init?: FromSsoInit) => RuntimeConfigIdentityProvider<TokenIdentity>;
@@ -1,5 +0,0 @@
1
- import { CredentialProviderOptions, TokenIdentity, TokenIdentityProvider } from "@aws-sdk/types";
2
- export interface FromStaticInit extends CredentialProviderOptions {
3
- token?: TokenIdentity;
4
- }
5
- export declare const fromStatic: ({ token, logger }: FromStaticInit) => TokenIdentityProvider;
@@ -1,9 +0,0 @@
1
- import { AwsIdentityProperties } from "@aws-sdk/types";
2
- import { SSOToken } from "@smithy/core/config";
3
- import { FromSsoInit } from "./fromSso";
4
- export declare const getNewSsoOidcToken: (
5
- ssoToken: SSOToken,
6
- ssoRegion: string,
7
- init?: FromSsoInit,
8
- callerClientConfig?: AwsIdentityProperties["callerClientConfig"],
9
- ) => Promise<import("@aws-sdk/nested-clients/sso-oidc").CreateTokenCommandOutput>;
@@ -1,7 +0,0 @@
1
- import { AwsIdentityProperties } from "@aws-sdk/types";
2
- import { FromSsoInit } from "./fromSso";
3
- export declare const getSsoOidcClient: (
4
- ssoRegion: string,
5
- init?: FromSsoInit,
6
- callerClientConfig?: AwsIdentityProperties["callerClientConfig"],
7
- ) => Promise<import("@aws-sdk/nested-clients/sso-oidc").SSOOIDCClient>;
@@ -1,7 +0,0 @@
1
- export { fromEnvSigningName } from "./fromEnvSigningName";
2
- export { FromEnvSigningNameInit } from "./fromEnvSigningName";
3
- export { fromSso } from "./fromSso";
4
- export { FromSsoInit } from "./fromSso";
5
- export { fromStatic } from "./fromStatic";
6
- export { FromStaticInit } from "./fromStatic";
7
- export { nodeProvider } from "./nodeProvider";
@@ -1,3 +0,0 @@
1
- import { TokenIdentityProvider } from "@aws-sdk/types";
2
- import { FromSsoInit } from "./fromSso";
3
- export declare const nodeProvider: (init?: FromSsoInit) => TokenIdentityProvider;
@@ -1,2 +0,0 @@
1
- import { TokenIdentity } from "@aws-sdk/types";
2
- export declare const validateTokenExpiry: (token: TokenIdentity) => void;
@@ -1 +0,0 @@
1
- export declare const validateTokenKey: (key: string, value: unknown, forRefresh?: boolean) => void;
@@ -1,2 +0,0 @@
1
- import { SSOToken } from "@smithy/core/config";
2
- export declare const writeSSOTokenToFile: (id: string, ssoToken: SSOToken) => Promise<void>;
@@ -1,5 +0,0 @@
1
- import type { TokenIdentity } from "@aws-sdk/types";
2
- /**
3
- * Throws TokenProviderError is token is expired.
4
- */
5
- export declare const validateTokenExpiry: (token: TokenIdentity) => void;
@@ -1,4 +0,0 @@
1
- /**
2
- * Throws TokenProviderError if value is undefined for key.
3
- */
4
- export declare const validateTokenKey: (key: string, value: unknown, forRefresh?: boolean) => void;
@@ -1,5 +0,0 @@
1
- import type { SSOToken } from "@smithy/core/config";
2
- /**
3
- * Writes SSO token to file based on filepath computed from ssoStartUrl or session name.
4
- */
5
- export declare const writeSSOTokenToFile: (id: string, ssoToken: SSOToken) => Promise<void>;
@@ -1,69 +0,0 @@
1
- {
2
- "name": "@aws-sdk/token-providers",
3
- "version": "3.1111.0",
4
- "description": "A collection of token providers",
5
- "keywords": [
6
- "aws",
7
- "token"
8
- ],
9
- "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/token-providers",
10
- "license": "Apache-2.0",
11
- "author": {
12
- "name": "AWS SDK for JavaScript Team",
13
- "url": "https://aws.amazon.com/sdk-for-javascript/"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/aws/aws-sdk-js-v3.git",
18
- "directory": "packages/token-providers"
19
- },
20
- "files": [
21
- "dist-*/**"
22
- ],
23
- "sideEffects": false,
24
- "main": "./dist-cjs/index.js",
25
- "module": "./dist-es/index.js",
26
- "browser": {},
27
- "types": "./dist-types/index.d.ts",
28
- "typesVersions": {
29
- "<4.5": {
30
- "dist-types/*": [
31
- "dist-types/ts3.4/*"
32
- ]
33
- }
34
- },
35
- "react-native": {},
36
- "scripts": {
37
- "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
38
- "build:cjs": "node ../../scripts/compilation/inline",
39
- "build:es": "premove dist-es && tsc -p tsconfig.es.json",
40
- "build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
41
- "build:types": "premove dist-types && tsc -p tsconfig.types.json",
42
- "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
43
- "clean": "premove dist-cjs dist-es dist-types",
44
- "extract:docs": "api-extractor run --local",
45
- "test": "yarn g:vitest run",
46
- "test:watch": "yarn g:vitest watch",
47
- "test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
48
- "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
49
- },
50
- "dependencies": {
51
- "@aws-sdk/core": "^3.977.8",
52
- "@aws-sdk/nested-clients": "^3.997.43",
53
- "@aws-sdk/types": "^3.974.4",
54
- "@smithy/core": "^3.31.1",
55
- "@smithy/types": "^4.16.1",
56
- "tslib": "^2.6.2"
57
- },
58
- "devDependencies": {
59
- "@tsconfig/recommended": "1.0.1",
60
- "@types/node": "^20.14.8",
61
- "concurrently": "7.0.0",
62
- "downlevel-dts": "0.10.1",
63
- "premove": "4.0.0",
64
- "typescript": "~7.0.2"
65
- },
66
- "engines": {
67
- "node": ">=20.0.0"
68
- }
69
- }