skill-tree 0.2.1 → 0.3.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 (57) hide show
  1. package/dist/{chunk-P5GJJ4JB.mjs → chunk-GPN6UQVR.mjs} +4 -3
  2. package/dist/{chunk-4TFMKAVC.mjs → chunk-MBF2MJS5.mjs} +5 -0
  3. package/dist/cli/index.js +6 -1
  4. package/dist/cli/index.mjs +2 -2
  5. package/dist/index.d.mts +116 -2
  6. package/dist/index.d.ts +116 -2
  7. package/dist/index.js +8 -1
  8. package/dist/index.mjs +4 -2
  9. package/dist/{sqlite-RR2SJ3SR.mjs → sqlite-V6GFGHTD.mjs} +1 -1
  10. package/package.json +1 -1
  11. package/dist/chunk-3SRB47JW.mjs +0 -8344
  12. package/dist/chunk-43YOKLZP.mjs +0 -6081
  13. package/dist/chunk-4AGZU52D.mjs +0 -7918
  14. package/dist/chunk-4HXHCEFH.mjs +0 -9157
  15. package/dist/chunk-4OC5QFIF.mjs +0 -11267
  16. package/dist/chunk-55SMGVTP.mjs +0 -7126
  17. package/dist/chunk-6FX4IK4Z.mjs +0 -5368
  18. package/dist/chunk-6UPDN5QM.mjs +0 -163
  19. package/dist/chunk-7EGDKOHV.mjs +0 -9439
  20. package/dist/chunk-7LMOQW5H.mjs +0 -4893
  21. package/dist/chunk-7QIQJVNP.mjs +0 -14206
  22. package/dist/chunk-7VB4ZRZO.mjs +0 -7127
  23. package/dist/chunk-A3SILZYX.mjs +0 -8360
  24. package/dist/chunk-BPVRW25O.mjs +0 -6089
  25. package/dist/chunk-CI4476KM.mjs +0 -6607
  26. package/dist/chunk-DDXYQ74I.mjs +0 -13969
  27. package/dist/chunk-DQOFJXBX.mjs +0 -6595
  28. package/dist/chunk-E2CVK23F.mjs +0 -8751
  29. package/dist/chunk-F3YEUQAP.mjs +0 -654
  30. package/dist/chunk-FKJJ4RJG.mjs +0 -13874
  31. package/dist/chunk-II7DECZQ.mjs +0 -9111
  32. package/dist/chunk-INKVOZXK.mjs +0 -15898
  33. package/dist/chunk-J2JM7HAK.mjs +0 -8787
  34. package/dist/chunk-K6NRCSAZ.mjs +0 -4355
  35. package/dist/chunk-OYHYXKXO.mjs +0 -7297
  36. package/dist/chunk-PDPN7FW7.mjs +0 -1045
  37. package/dist/chunk-QNK3WYNA.mjs +0 -8971
  38. package/dist/chunk-T4PVQW5O.mjs +0 -124
  39. package/dist/chunk-TEUB6DZR.mjs +0 -6453
  40. package/dist/chunk-TWPEHDW4.mjs +0 -1067
  41. package/dist/chunk-VHFTX33A.mjs +0 -6724
  42. package/dist/chunk-Y54UK2J3.mjs +0 -13071
  43. package/dist/chunk-ZQVS7MQK.mjs +0 -6081
  44. package/dist/dist-es-2JG6ZWFR.mjs +0 -69
  45. package/dist/dist-es-FIVW7BUZ.mjs +0 -317
  46. package/dist/dist-es-HRBPKDMR.mjs +0 -935
  47. package/dist/dist-es-LHPJ63IO.mjs +0 -4437
  48. package/dist/dist-es-ZYHLY2E6.mjs +0 -487
  49. package/dist/loadSso-OYKG6ZRE.mjs +0 -579
  50. package/dist/signin-LMFNL434.mjs +0 -665
  51. package/dist/sqlite-MG45OOTV.mjs +0 -6
  52. package/dist/sqlite-OLU72GHB.mjs +0 -6
  53. package/dist/sqlite-XJRPMNAJ.mjs +0 -6
  54. package/dist/sso-oidc-NNH6SQIH.mjs +0 -832
  55. package/dist/sts-EF755UBF.mjs +0 -6290
  56. package/dist/sync-BSWMMDA6.mjs +0 -14
  57. package/dist/sync-WHIIDHML.mjs +0 -14
@@ -1,69 +0,0 @@
1
- import {
2
- setCredentialFeature
3
- } from "./chunk-2NL4MXNX.mjs";
4
- import {
5
- CredentialsProviderError,
6
- externalDataInterceptor
7
- } from "./chunk-YDVZIFIU.mjs";
8
- import "./chunk-BZ2JKJ54.mjs";
9
- import "./chunk-QZ7TP4HQ.mjs";
10
-
11
- // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
12
- import { readFileSync } from "fs";
13
-
14
- // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
15
- var fromWebToken = (init) => async (awsIdentityProperties) => {
16
- init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
17
- const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
18
- let { roleAssumerWithWebIdentity } = init;
19
- if (!roleAssumerWithWebIdentity) {
20
- const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-EF755UBF.mjs");
21
- roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
22
- ...init.clientConfig,
23
- credentialProviderLogger: init.logger,
24
- parentClientConfig: {
25
- ...awsIdentityProperties?.callerClientConfig,
26
- ...init.parentClientConfig
27
- }
28
- }, init.clientPlugins);
29
- }
30
- return roleAssumerWithWebIdentity({
31
- RoleArn: roleArn,
32
- RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
33
- WebIdentityToken: webIdentityToken,
34
- ProviderId: providerId,
35
- PolicyArns: policyArns,
36
- Policy: policy,
37
- DurationSeconds: durationSeconds
38
- });
39
- };
40
-
41
- // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
42
- var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
43
- var ENV_ROLE_ARN = "AWS_ROLE_ARN";
44
- var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
45
- var fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
46
- init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
47
- const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
48
- const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
49
- const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
50
- if (!webIdentityTokenFile || !roleArn) {
51
- throw new CredentialsProviderError("Web identity configuration not specified", {
52
- logger: init.logger
53
- });
54
- }
55
- const credentials = await fromWebToken({
56
- ...init,
57
- webIdentityToken: externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
58
- roleArn,
59
- roleSessionName
60
- })(awsIdentityProperties);
61
- if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
62
- setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
63
- }
64
- return credentials;
65
- };
66
- export {
67
- fromTokenFile,
68
- fromWebToken
69
- };
@@ -1,317 +0,0 @@
1
- import {
2
- setCredentialFeature
3
- } from "./chunk-2NL4MXNX.mjs";
4
- import {
5
- CredentialsProviderError,
6
- TokenProviderError,
7
- getProfileName,
8
- getSSOTokenFilepath,
9
- getSSOTokenFromFile,
10
- loadSsoSessionData,
11
- parseKnownFiles
12
- } from "./chunk-YDVZIFIU.mjs";
13
- import "./chunk-BZ2JKJ54.mjs";
14
- import "./chunk-QZ7TP4HQ.mjs";
15
-
16
- // node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
17
- var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
18
-
19
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js
20
- var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
21
- var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
22
-
23
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
24
- var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
25
- const { SSOOIDCClient } = await import("./sso-oidc-NNH6SQIH.mjs");
26
- const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
27
- const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
28
- region: ssoRegion ?? init.clientConfig?.region,
29
- logger: coalesce("logger"),
30
- userAgentAppId: coalesce("userAgentAppId")
31
- }));
32
- return ssoOidcClient;
33
- };
34
-
35
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
36
- var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
37
- const { CreateTokenCommand } = await import("./sso-oidc-NNH6SQIH.mjs");
38
- const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
39
- return ssoOidcClient.send(new CreateTokenCommand({
40
- clientId: ssoToken.clientId,
41
- clientSecret: ssoToken.clientSecret,
42
- refreshToken: ssoToken.refreshToken,
43
- grantType: "refresh_token"
44
- }));
45
- };
46
-
47
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
48
- var validateTokenExpiry = (token) => {
49
- if (token.expiration && token.expiration.getTime() < Date.now()) {
50
- throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
51
- }
52
- };
53
-
54
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
55
- var validateTokenKey = (key, value, forRefresh = false) => {
56
- if (typeof value === "undefined") {
57
- throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
58
- }
59
- };
60
-
61
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
62
- import { promises as fsPromises } from "fs";
63
- var { writeFile } = fsPromises;
64
- var writeSSOTokenToFile = (id, ssoToken) => {
65
- const tokenFilepath = getSSOTokenFilepath(id);
66
- const tokenString = JSON.stringify(ssoToken, null, 2);
67
- return writeFile(tokenFilepath, tokenString);
68
- };
69
-
70
- // node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
71
- var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
72
- var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
73
- init.logger?.debug("@aws-sdk/token-providers - fromSso");
74
- const profiles = await parseKnownFiles(init);
75
- const profileName = getProfileName({
76
- profile: init.profile ?? callerClientConfig?.profile
77
- });
78
- const profile = profiles[profileName];
79
- if (!profile) {
80
- throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
81
- } else if (!profile["sso_session"]) {
82
- throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
83
- }
84
- const ssoSessionName = profile["sso_session"];
85
- const ssoSessions = await loadSsoSessionData(init);
86
- const ssoSession = ssoSessions[ssoSessionName];
87
- if (!ssoSession) {
88
- throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
89
- }
90
- for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
91
- if (!ssoSession[ssoSessionRequiredKey]) {
92
- throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
93
- }
94
- }
95
- const ssoStartUrl = ssoSession["sso_start_url"];
96
- const ssoRegion = ssoSession["sso_region"];
97
- let ssoToken;
98
- try {
99
- ssoToken = await getSSOTokenFromFile(ssoSessionName);
100
- } catch (e) {
101
- throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
102
- }
103
- validateTokenKey("accessToken", ssoToken.accessToken);
104
- validateTokenKey("expiresAt", ssoToken.expiresAt);
105
- const { accessToken, expiresAt } = ssoToken;
106
- const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
107
- if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
108
- return existingToken;
109
- }
110
- if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
111
- validateTokenExpiry(existingToken);
112
- return existingToken;
113
- }
114
- validateTokenKey("clientId", ssoToken.clientId, true);
115
- validateTokenKey("clientSecret", ssoToken.clientSecret, true);
116
- validateTokenKey("refreshToken", ssoToken.refreshToken, true);
117
- try {
118
- lastRefreshAttemptTime.setTime(Date.now());
119
- const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);
120
- validateTokenKey("accessToken", newSsoOidcToken.accessToken);
121
- validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
122
- const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
123
- try {
124
- await writeSSOTokenToFile(ssoSessionName, {
125
- ...ssoToken,
126
- accessToken: newSsoOidcToken.accessToken,
127
- expiresAt: newTokenExpiration.toISOString(),
128
- refreshToken: newSsoOidcToken.refreshToken
129
- });
130
- } catch (error) {
131
- }
132
- return {
133
- token: newSsoOidcToken.accessToken,
134
- expiration: newTokenExpiration
135
- };
136
- } catch (error) {
137
- validateTokenExpiry(existingToken);
138
- return existingToken;
139
- }
140
- };
141
-
142
- // node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
143
- var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
144
- var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => {
145
- let token;
146
- const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
147
- if (ssoSession) {
148
- try {
149
- const _token = await fromSso({
150
- profile,
151
- filepath,
152
- configFilepath,
153
- ignoreCache,
154
- clientConfig,
155
- parentClientConfig,
156
- logger
157
- })({ callerClientConfig });
158
- token = {
159
- accessToken: _token.token,
160
- expiresAt: new Date(_token.expiration).toISOString()
161
- };
162
- } catch (e) {
163
- throw new CredentialsProviderError(e.message, {
164
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
165
- logger
166
- });
167
- }
168
- } else {
169
- try {
170
- token = await getSSOTokenFromFile(ssoStartUrl);
171
- } catch (e) {
172
- throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
173
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
174
- logger
175
- });
176
- }
177
- }
178
- if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
179
- throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
180
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
181
- logger
182
- });
183
- }
184
- const { accessToken } = token;
185
- const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-OYKG6ZRE.mjs");
186
- const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, {
187
- logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,
188
- region: clientConfig?.region ?? ssoRegion,
189
- userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId
190
- }));
191
- let ssoResp;
192
- try {
193
- ssoResp = await sso.send(new GetRoleCredentialsCommand({
194
- accountId: ssoAccountId,
195
- roleName: ssoRoleName,
196
- accessToken
197
- }));
198
- } catch (e) {
199
- throw new CredentialsProviderError(e, {
200
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
201
- logger
202
- });
203
- }
204
- const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
205
- if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
206
- throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
207
- tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
208
- logger
209
- });
210
- }
211
- const credentials = {
212
- accessKeyId,
213
- secretAccessKey,
214
- sessionToken,
215
- expiration: new Date(expiration),
216
- ...credentialScope && { credentialScope },
217
- ...accountId && { accountId }
218
- };
219
- if (ssoSession) {
220
- setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
221
- } else {
222
- setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
223
- }
224
- return credentials;
225
- };
226
-
227
- // node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
228
- var validateSsoProfile = (profile, logger) => {
229
- const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
230
- if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
231
- throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}
232
- Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
233
- }
234
- return profile;
235
- };
236
-
237
- // node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
238
- var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
239
- init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
240
- const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
241
- const { ssoClient } = init;
242
- const profileName = getProfileName({
243
- profile: init.profile ?? callerClientConfig?.profile
244
- });
245
- if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
246
- const profiles = await parseKnownFiles(init);
247
- const profile = profiles[profileName];
248
- if (!profile) {
249
- throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
250
- }
251
- if (!isSsoProfile(profile)) {
252
- throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
253
- logger: init.logger
254
- });
255
- }
256
- if (profile?.sso_session) {
257
- const ssoSessions = await loadSsoSessionData(init);
258
- const session = ssoSessions[profile.sso_session];
259
- const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
260
- if (ssoRegion && ssoRegion !== session.sso_region) {
261
- throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
262
- tryNextLink: false,
263
- logger: init.logger
264
- });
265
- }
266
- if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
267
- throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
268
- tryNextLink: false,
269
- logger: init.logger
270
- });
271
- }
272
- profile.sso_region = session.sso_region;
273
- profile.sso_start_url = session.sso_start_url;
274
- }
275
- const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
276
- return resolveSSOCredentials({
277
- ssoStartUrl: sso_start_url,
278
- ssoSession: sso_session,
279
- ssoAccountId: sso_account_id,
280
- ssoRegion: sso_region,
281
- ssoRoleName: sso_role_name,
282
- ssoClient,
283
- clientConfig: init.clientConfig,
284
- parentClientConfig: init.parentClientConfig,
285
- callerClientConfig: init.callerClientConfig,
286
- profile: profileName,
287
- filepath: init.filepath,
288
- configFilepath: init.configFilepath,
289
- ignoreCache: init.ignoreCache,
290
- logger: init.logger
291
- });
292
- } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
293
- throw new CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
294
- } else {
295
- return resolveSSOCredentials({
296
- ssoStartUrl,
297
- ssoSession,
298
- ssoAccountId,
299
- ssoRegion,
300
- ssoRoleName,
301
- ssoClient,
302
- clientConfig: init.clientConfig,
303
- parentClientConfig: init.parentClientConfig,
304
- callerClientConfig: init.callerClientConfig,
305
- profile: profileName,
306
- filepath: init.filepath,
307
- configFilepath: init.configFilepath,
308
- ignoreCache: init.ignoreCache,
309
- logger: init.logger
310
- });
311
- }
312
- };
313
- export {
314
- fromSSO,
315
- isSsoProfile,
316
- validateSsoProfile
317
- };