@psnext/slingcli 2.5.20260602-4 → 2.5.20260607-2

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 (144) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/index.js +12 -6
  2. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -6
  3. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +1 -0
  4. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +11 -6
  5. package/node_modules/@aws-sdk/core/package.json +7 -7
  6. package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
  7. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -4
  8. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +7 -6
  9. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +2 -1
  10. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  11. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  12. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +2 -2
  13. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  14. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  15. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  16. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +1 -1
  17. package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -8
  18. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  19. package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
  20. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  21. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  22. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +7 -7
  23. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  24. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  25. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +5 -5
  26. package/node_modules/@aws-sdk/middleware-eventstream/package.json +5 -5
  27. package/node_modules/@aws-sdk/middleware-websocket/package.json +8 -8
  28. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +99 -106
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +62 -120
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +55 -86
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +73 -104
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +102 -185
  33. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +4 -5
  34. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/bdd.js +21 -57
  35. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +1 -2
  36. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +2 -4
  37. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +73 -41
  38. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +4 -5
  39. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +20 -52
  40. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +1 -2
  41. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +2 -4
  42. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +36 -59
  43. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js +4 -5
  44. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js +17 -45
  45. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +1 -2
  46. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +2 -4
  47. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +32 -32
  48. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +4 -5
  49. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js +17 -45
  50. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +1 -2
  51. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +2 -4
  52. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +50 -50
  53. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js +4 -5
  54. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js +1 -1
  55. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js +34 -96
  56. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +1 -2
  57. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +3 -6
  58. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +63 -80
  59. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -4
  60. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +7 -6
  61. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +2 -1
  62. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  63. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  64. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +2 -2
  65. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  66. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  67. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  68. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +1 -1
  69. package/node_modules/@aws-sdk/nested-clients/package.json +9 -9
  70. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
  71. package/node_modules/@aws-sdk/types/package.json +3 -3
  72. package/node_modules/@aws-sdk/util-locate-window/package.json +2 -2
  73. package/node_modules/@aws-sdk/xml-builder/package.json +3 -3
  74. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  75. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +3 -0
  76. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +45 -0
  77. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +827 -140
  78. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +32 -12
  79. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +13 -1
  80. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +4 -2
  81. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +15 -2
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +1 -0
  84. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +4 -3
  85. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +9 -3
  86. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +19 -6
  87. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +3 -0
  88. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +47 -13
  89. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +72 -0
  90. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js +3 -0
  91. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +28 -20
  92. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +2 -30
  93. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +71 -30
  94. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +1 -0
  95. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +1 -1
  96. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +1 -1
  97. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +1 -1
  98. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +1 -1
  99. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +1 -1
  100. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +1 -1
  101. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js +130 -0
  102. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +1 -0
  103. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +54 -2
  104. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +2 -2
  105. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  106. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +7 -0
  107. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js +1 -0
  108. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +3 -12
  109. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +22 -0
  110. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js +86 -0
  111. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +40 -0
  112. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +55 -8
  113. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js +54 -22
  114. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js +22 -0
  115. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
  116. package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -4
  117. package/node_modules/@earendil-works/pi-tui/dist/utils.js +3 -0
  118. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  119. package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js +2 -2
  120. package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js +2 -0
  121. package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts +1 -1
  122. package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/node-http.d.ts +2 -0
  123. package/node_modules/@smithy/credential-provider-imds/package.json +1 -1
  124. package/node_modules/@types/node/README.md +1 -1
  125. package/node_modules/@types/node/http2.d.ts +3 -0
  126. package/node_modules/@types/node/package.json +2 -2
  127. package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  128. package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
  129. package/node_modules/gaxios/package.json +7 -9
  130. package/node_modules/google-auth-library/build/src/auth/gdchclient.d.ts +47 -0
  131. package/node_modules/google-auth-library/build/src/auth/gdchclient.js +307 -0
  132. package/node_modules/google-auth-library/build/src/auth/googleauth.d.ts +5 -4
  133. package/node_modules/google-auth-library/build/src/auth/googleauth.js +18 -1
  134. package/node_modules/google-auth-library/build/src/index.d.ts +1 -0
  135. package/node_modules/google-auth-library/build/src/index.js +4 -1
  136. package/node_modules/google-auth-library/package.json +2 -4
  137. package/node_modules/semver/classes/semver.js +19 -2
  138. package/node_modules/semver/package.json +1 -1
  139. package/node_modules/undici/lib/global.js +1 -1
  140. package/node_modules/undici/lib/handler/unwrap-handler.js +6 -0
  141. package/node_modules/undici/package.json +1 -1
  142. package/node_modules/undici/types/dispatcher.d.ts +2 -0
  143. package/package.json +6 -6
  144. package/slingshot/index.js +275 -273
@@ -0,0 +1,307 @@
1
+ "use strict";
2
+ // Copyright 2026 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.GdchClient = exports.GDCH_SERVICE_ACCOUNT_TYPE = void 0;
17
+ const crypto = require("crypto");
18
+ const fs = require("fs");
19
+ const https = require("https");
20
+ const oauth2client_1 = require("./oauth2client");
21
+ const DEFAULT_LIFETIME_IN_SECONDS = 3600;
22
+ exports.GDCH_SERVICE_ACCOUNT_TYPE = 'gdch_service_account';
23
+ class GdchClient extends oauth2client_1.OAuth2Client {
24
+ projectId;
25
+ privateKeyId;
26
+ privateKey;
27
+ serviceIdentityName;
28
+ tokenServerUri;
29
+ caCertPath;
30
+ apiAudience;
31
+ lifetime;
32
+ gdchOptions;
33
+ caAgentPromise;
34
+ cachedCaCertPath;
35
+ lastCaCertReadTime = 0;
36
+ CA_CERT_TTL_MS = 5 * 60 * 1000;
37
+ constructor(options = {}) {
38
+ super(options);
39
+ this.gdchOptions = options;
40
+ this.projectId = options.projectId || undefined;
41
+ this.privateKeyId = options.privateKeyId;
42
+ this.privateKey = options.privateKey;
43
+ this.serviceIdentityName = options.serviceIdentityName;
44
+ this.tokenServerUri = options.tokenServerUri;
45
+ this.caCertPath = options.caCertPath;
46
+ this.apiAudience = options.apiAudience;
47
+ this.lifetime = options.lifetime || DEFAULT_LIFETIME_IN_SECONDS;
48
+ // Start with an expired refresh token, which will automatically be
49
+ // refreshed before the first API call is made.
50
+ this.credentials = { refresh_token: 'gdch-placeholder', expiry_date: 1 };
51
+ }
52
+ createWithGdchAudience(apiAudience) {
53
+ if (!apiAudience) {
54
+ throw new Error('Audience cannot be null or empty for GDCH service account credentials.');
55
+ }
56
+ return new GdchClient({
57
+ ...this.gdchOptions,
58
+ projectId: this.projectId,
59
+ privateKeyId: this.privateKeyId,
60
+ privateKey: this.privateKey,
61
+ serviceIdentityName: this.serviceIdentityName,
62
+ tokenServerUri: this.tokenServerUri,
63
+ caCertPath: this.caCertPath,
64
+ lifetime: this.lifetime,
65
+ apiAudience,
66
+ });
67
+ }
68
+ fromJSON(json) {
69
+ if (!json) {
70
+ throw new Error('Must pass in a JSON object containing the GDCH credentials settings.');
71
+ }
72
+ if (json.type !== exports.GDCH_SERVICE_ACCOUNT_TYPE) {
73
+ throw new Error(`The incoming JSON object does not have the "${exports.GDCH_SERVICE_ACCOUNT_TYPE}" type`);
74
+ }
75
+ if (json.format_version !== '1') {
76
+ throw new Error('Only format version 1 is supported.');
77
+ }
78
+ if (!json.project) {
79
+ throw new Error('The incoming JSON object does not contain a project field');
80
+ }
81
+ if (!json.private_key_id) {
82
+ throw new Error('The incoming JSON object does not contain a private_key_id field');
83
+ }
84
+ if (!json.private_key) {
85
+ throw new Error('The incoming JSON object does not contain a private_key field');
86
+ }
87
+ if (!json.name) {
88
+ throw new Error('The incoming JSON object does not contain a name field');
89
+ }
90
+ if (!json.token_uri) {
91
+ throw new Error('The incoming JSON object does not contain a token_uri field');
92
+ }
93
+ this.projectId = json.project;
94
+ this.privateKeyId = json.private_key_id;
95
+ this.privateKey = json.private_key;
96
+ this.serviceIdentityName = json.name;
97
+ this.tokenServerUri = json.token_uri;
98
+ this.caCertPath = json.ca_cert_path;
99
+ this.gdchOptions = {
100
+ ...this.gdchOptions,
101
+ projectId: json.project,
102
+ privateKeyId: json.private_key_id,
103
+ privateKey: json.private_key,
104
+ serviceIdentityName: json.name,
105
+ tokenServerUri: json.token_uri,
106
+ caCertPath: json.ca_cert_path,
107
+ };
108
+ }
109
+ async refreshTokenNoCache() {
110
+ if (!this.apiAudience) {
111
+ throw new Error('Audience cannot be null or empty for GDCH service account credentials. ' +
112
+ 'Specify the audience by calling createWithGdchAudience.');
113
+ }
114
+ if (!this.privateKey) {
115
+ throw new Error('Private key is not configured for GDCH credentials.');
116
+ }
117
+ if (!this.privateKeyId) {
118
+ throw new Error('Private key ID is not configured for GDCH credentials.');
119
+ }
120
+ if (!this.projectId) {
121
+ throw new Error('Project is not configured for GDCH credentials.');
122
+ }
123
+ if (!this.serviceIdentityName) {
124
+ throw new Error('Service identity name is not configured for GDCH credentials.');
125
+ }
126
+ if (!this.tokenServerUri) {
127
+ throw new Error('Token server URI is not configured for GDCH credentials.');
128
+ }
129
+ const assertion = this.createAssertion();
130
+ const data = {
131
+ audience: this.apiAudience,
132
+ grant_type: 'urn:ietf:params:oauth:token-type:token-exchange',
133
+ requested_token_type: 'urn:ietf:params:oauth:token-type:access_token',
134
+ subject_token: assertion,
135
+ subject_token_type: 'urn:k8s:params:oauth:token-type:serviceaccount',
136
+ };
137
+ const requestOpts = {
138
+ url: this.tokenServerUri,
139
+ method: 'POST',
140
+ headers: {
141
+ 'Content-Type': 'application/json',
142
+ },
143
+ data,
144
+ responseType: 'json',
145
+ timeout: 10000,
146
+ retry: true,
147
+ retryConfig: {
148
+ httpMethodsToRetry: ['POST'],
149
+ statusCodesToRetry: [[500, 599]],
150
+ noResponseRetries: 3,
151
+ },
152
+ };
153
+ if (this.caCertPath) {
154
+ requestOpts.agent = await this.getCaAgent();
155
+ }
156
+ try {
157
+ const res = await this.transporter.request(requestOpts);
158
+ const tokenResponse = res.data;
159
+ if (!tokenResponse.access_token) {
160
+ throw new Error('Token response did not contain an access_token.');
161
+ }
162
+ if (!tokenResponse.expires_in) {
163
+ throw new Error('Token response did not contain an expires_in field.');
164
+ }
165
+ const tokens = {
166
+ access_token: tokenResponse.access_token,
167
+ token_type: 'STS-Bearer',
168
+ expiry_date: Date.now() + tokenResponse.expires_in * 1000,
169
+ };
170
+ this.emit('tokens', tokens);
171
+ return { res, tokens };
172
+ }
173
+ catch (e) {
174
+ if (e && e.config && e.config.data) {
175
+ try {
176
+ if (typeof e.config.data === 'string') {
177
+ const parsedData = JSON.parse(e.config.data);
178
+ if (parsedData.subject_token) {
179
+ parsedData.subject_token = '***REDACTED***';
180
+ e.config.data = JSON.stringify(parsedData);
181
+ }
182
+ }
183
+ else if (typeof e.config.data === 'object' && e.config.data.subject_token) {
184
+ e.config.data.subject_token = '***REDACTED***';
185
+ }
186
+ }
187
+ catch { }
188
+ }
189
+ if (e instanceof Error) {
190
+ e.message = `Error getting access token for GDCH service account: ${e.message}, iss: ${this.serviceIdentityName}`;
191
+ }
192
+ throw e;
193
+ }
194
+ }
195
+ createAssertion() {
196
+ const header = {
197
+ alg: 'ES256',
198
+ typ: 'JWT',
199
+ kid: this.privateKeyId,
200
+ };
201
+ const issSub = `system:serviceaccount:${this.projectId}:${this.serviceIdentityName}`;
202
+ const currentTime = Math.floor(Date.now() / 1000);
203
+ const payload = {
204
+ iss: issSub,
205
+ sub: issSub,
206
+ iat: currentTime,
207
+ exp: currentTime + this.lifetime,
208
+ aud: this.tokenServerUri,
209
+ };
210
+ const encodedHeader = this.base64UrlEncode(JSON.stringify(header));
211
+ const encodedPayload = this.base64UrlEncode(JSON.stringify(payload));
212
+ const signingInput = `${encodedHeader}.${encodedPayload}`;
213
+ const signature = crypto.sign('sha256', Buffer.from(signingInput), {
214
+ key: this.privateKey,
215
+ dsaEncoding: 'ieee-p1363',
216
+ });
217
+ const encodedSignature = this.base64UrlEncode(signature);
218
+ return `${signingInput}.${encodedSignature}`;
219
+ }
220
+ async requestAsync(opts, retry = false) {
221
+ if (this.caCertPath && !opts.agent) {
222
+ const url = (opts.url || '').toString();
223
+ if (!url.includes('googleapis.com') && !url.includes('google.com')) {
224
+ opts.agent = await this.getCaAgent();
225
+ }
226
+ }
227
+ return super.requestAsync(opts, retry);
228
+ }
229
+ getCaAgent() {
230
+ if (!this.caCertPath) {
231
+ this.caAgentPromise = undefined;
232
+ this.cachedCaCertPath = undefined;
233
+ this.lastCaCertReadTime = 0;
234
+ return undefined;
235
+ }
236
+ const now = Date.now();
237
+ const isCacheExpired = now - this.lastCaCertReadTime > this.CA_CERT_TTL_MS;
238
+ if (this.caAgentPromise &&
239
+ this.caCertPath === this.cachedCaCertPath &&
240
+ !isCacheExpired) {
241
+ return this.caAgentPromise;
242
+ }
243
+ this.cachedCaCertPath = this.caCertPath;
244
+ this.lastCaCertReadTime = now;
245
+ const currentPath = this.caCertPath;
246
+ this.caAgentPromise = (async () => {
247
+ try {
248
+ const ca = await fs.promises.readFile(currentPath);
249
+ return new https.Agent({ ca });
250
+ }
251
+ catch (err) {
252
+ if (this.cachedCaCertPath === currentPath) {
253
+ this.caAgentPromise = undefined;
254
+ this.cachedCaCertPath = undefined;
255
+ this.lastCaCertReadTime = 0;
256
+ }
257
+ if (err instanceof Error) {
258
+ err.message = `Error reading certificate file from CA cert path, value '${currentPath}': ${err.message}`;
259
+ }
260
+ throw err;
261
+ }
262
+ })();
263
+ return this.caAgentPromise;
264
+ }
265
+ toJSON() {
266
+ return {
267
+ ...this,
268
+ privateKey: this.privateKey ? '***REDACTED***' : undefined,
269
+ _clientSecret: this._clientSecret ? '***REDACTED***' : undefined,
270
+ apiKey: this.apiKey ? '***REDACTED***' : undefined,
271
+ gdchOptions: this.gdchOptions
272
+ ? {
273
+ ...this.gdchOptions,
274
+ privateKey: this.gdchOptions.privateKey ? '***REDACTED***' : undefined,
275
+ clientSecret: this.gdchOptions.clientSecret ? '***REDACTED***' : undefined,
276
+ client_secret: this.gdchOptions.client_secret ? '***REDACTED***' : undefined,
277
+ apiKey: this.gdchOptions.apiKey ? '***REDACTED***' : undefined,
278
+ credentials: this.gdchOptions.credentials
279
+ ? {
280
+ ...this.gdchOptions.credentials,
281
+ access_token: this.gdchOptions.credentials.access_token
282
+ ? '***REDACTED***'
283
+ : undefined,
284
+ refresh_token: this.gdchOptions.credentials.refresh_token
285
+ ? '***REDACTED***'
286
+ : undefined,
287
+ }
288
+ : undefined,
289
+ }
290
+ : undefined,
291
+ credentials: {
292
+ ...this.credentials,
293
+ access_token: this.credentials?.access_token ? '***REDACTED***' : undefined,
294
+ refresh_token: this.credentials?.refresh_token ? '***REDACTED***' : undefined,
295
+ },
296
+ };
297
+ }
298
+ [Symbol.for('nodejs.util.inspect.custom')]() {
299
+ return this.toJSON();
300
+ }
301
+ base64UrlEncode(str) {
302
+ const buffer = typeof str === 'string' ? Buffer.from(str) : str;
303
+ return buffer.toString('base64url');
304
+ }
305
+ }
306
+ exports.GdchClient = GdchClient;
307
+ //# sourceMappingURL=gdchclient.js.map
@@ -10,12 +10,13 @@ import { ExternalAccountClientOptions } from './externalclient';
10
10
  import { BaseExternalAccountClient } from './baseexternalclient';
11
11
  import { AuthClient, AuthClientOptions } from './authclient';
12
12
  import { ExternalAccountAuthorizedUserClient } from './externalAccountAuthorizedUserClient';
13
+ import { GdchClient, GdchCredentialsInput } from './gdchclient';
13
14
  import { AnyAuthClient, AnyAuthClientConstructor } from '..';
14
15
  /**
15
16
  * Defines all types of explicit clients that are determined via ADC JSON
16
17
  * config file.
17
18
  */
18
- export type JSONClient = JWT | UserRefreshClient | BaseExternalAccountClient | ExternalAccountAuthorizedUserClient | Impersonated;
19
+ export type JSONClient = JWT | UserRefreshClient | BaseExternalAccountClient | ExternalAccountAuthorizedUserClient | Impersonated | GdchClient;
19
20
  export interface ProjectIdCallback {
20
21
  (err?: Error | null, projectId?: string | null): void;
21
22
  }
@@ -127,7 +128,7 @@ export interface GoogleAuthOptions<T extends AuthClient = AnyAuthClient> {
127
128
  *
128
129
  * For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
129
130
  */
130
- credentials?: JWTInput | ExternalAccountClientOptions;
131
+ credentials?: JWTInput | ExternalAccountClientOptions | GdchCredentialsInput;
131
132
  /**
132
133
  * `AuthClientOptions` object passed to the constructor of the client
133
134
  */
@@ -168,7 +169,7 @@ export declare class GoogleAuth<T extends AuthClient = AuthClient> {
168
169
  get isGCE(): boolean | undefined;
169
170
  private _findProjectIdPromise?;
170
171
  private _cachedProjectId?;
171
- jsonContent: JWTInput | ExternalAccountClientOptions | null;
172
+ jsonContent: JWTInput | ExternalAccountClientOptions | GdchCredentialsInput | null;
172
173
  apiKey: string | null;
173
174
  cachedCredential: AnyAuthClient | T | null;
174
175
  /**
@@ -335,7 +336,7 @@ export declare class GoogleAuth<T extends AuthClient = AuthClient> {
335
336
  * @param options The JWT or UserRefresh options for the client
336
337
  * @returns JWT or UserRefresh Client with data
337
338
  */
338
- fromJSON(json: JWTInput | ImpersonatedJWTInput, options?: AuthClientOptions): JSONClient;
339
+ fromJSON(json: JWTInput | ImpersonatedJWTInput | GdchCredentialsInput | ExternalAccountClientOptions, options?: AuthClientOptions): JSONClient;
339
340
  /**
340
341
  * Return a JWT or UserRefreshClient from JavaScript object, caching both the
341
342
  * object used to instantiate and the client.
@@ -31,6 +31,7 @@ const externalclient_1 = require("./externalclient");
31
31
  const baseexternalclient_1 = require("./baseexternalclient");
32
32
  const authclient_1 = require("./authclient");
33
33
  const externalAccountAuthorizedUserClient_1 = require("./externalAccountAuthorizedUserClient");
34
+ const gdchclient_1 = require("./gdchclient");
34
35
  const util_1 = require("../util");
35
36
  exports.GoogleAuthExceptionMessages = {
36
37
  API_KEY_WITH_CREDENTIALS: 'API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.',
@@ -497,6 +498,10 @@ class GoogleAuth {
497
498
  ...options,
498
499
  });
499
500
  }
501
+ else if (json.type === gdchclient_1.GDCH_SERVICE_ACCOUNT_TYPE) {
502
+ client = new gdchclient_1.GdchClient(options);
503
+ client.fromJSON(json);
504
+ }
500
505
  else {
501
506
  options.scopes = this.scopes;
502
507
  client = new jwtclient_1.JWT(options);
@@ -738,7 +743,19 @@ class GoogleAuth {
738
743
  this.#pendingAuthClient =
739
744
  this.#pendingAuthClient || this.#determineClient();
740
745
  try {
741
- return await this.#pendingAuthClient;
746
+ const client = await this.#pendingAuthClient;
747
+ if (client instanceof gdchclient_1.GdchClient && !client.apiAudience) {
748
+ const opts = this.clientOptions;
749
+ const endpoint = opts.apiEndpoint || opts.servicePath;
750
+ if (endpoint) {
751
+ const scheme = endpoint.startsWith('http') ? '' : 'https://';
752
+ const formattedAudience = `${scheme}${endpoint}/`.replace(/\/+$/, '/');
753
+ const newClient = client.createWithGdchAudience(formattedAudience);
754
+ this.cachedCredential = newClient;
755
+ return newClient;
756
+ }
757
+ }
758
+ return client;
742
759
  }
743
760
  finally {
744
761
  // reset the pending auth client in case it is changed later
@@ -24,6 +24,7 @@ export { CredentialAccessBoundary, DownscopedClient, } from './auth/downscopedcl
24
24
  export { PluggableAuthClient, PluggableAuthClientOptions, ExecutableError, } from './auth/pluggable-auth-client';
25
25
  export { EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE, ExternalAccountAuthorizedUserClient, ExternalAccountAuthorizedUserClientOptions, } from './auth/externalAccountAuthorizedUserClient';
26
26
  export { PassThroughClient } from './auth/passthrough';
27
+ export { GdchClient, GdchClientOptions, GdchCredentialsInput, GDCH_SERVICE_ACCOUNT_TYPE, } from './auth/gdchclient';
27
28
  export * from './gtoken/googleToken';
28
29
  type ALL_EXPORTS = (typeof import('./'))[keyof typeof import('./')];
29
30
  /**
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.GoogleAuth = exports.auth = exports.PassThroughClient = exports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = void 0;
17
+ exports.GoogleAuth = exports.auth = exports.GDCH_SERVICE_ACCOUNT_TYPE = exports.GdchClient = exports.PassThroughClient = exports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = void 0;
18
18
  // Copyright 2017 Google LLC
19
19
  //
20
20
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -79,6 +79,9 @@ Object.defineProperty(exports, "EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE", { enumer
79
79
  Object.defineProperty(exports, "ExternalAccountAuthorizedUserClient", { enumerable: true, get: function () { return externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient; } });
80
80
  var passthrough_1 = require("./auth/passthrough");
81
81
  Object.defineProperty(exports, "PassThroughClient", { enumerable: true, get: function () { return passthrough_1.PassThroughClient; } });
82
+ var gdchclient_1 = require("./auth/gdchclient");
83
+ Object.defineProperty(exports, "GdchClient", { enumerable: true, get: function () { return gdchclient_1.GdchClient; } });
84
+ Object.defineProperty(exports, "GDCH_SERVICE_ACCOUNT_TYPE", { enumerable: true, get: function () { return gdchclient_1.GDCH_SERVICE_ACCOUNT_TYPE; } });
82
85
  __exportStar(require("./gtoken/googleToken"), exports);
83
86
  const auth = new googleauth_1.GoogleAuth();
84
87
  exports.auth = auth;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-auth-library",
3
- "version": "10.6.2",
3
+ "version": "10.7.0",
4
4
  "author": "Google Inc.",
5
5
  "description": "Google APIs Authentication Client Library for Node.js",
6
6
  "engines": {
@@ -58,7 +58,7 @@
58
58
  "nock": "^14.0.5",
59
59
  "null-loader": "^4.0.1",
60
60
  "puppeteer": "^24.0.0",
61
- "sinon": "^21.0.0",
61
+ "sinon": "21.0.3",
62
62
  "ts-loader": "^9.5.2",
63
63
  "typescript": "5.8.3",
64
64
  "webpack": "^5.97.1",
@@ -83,8 +83,6 @@
83
83
  "presystem-test": "npm run compile -- --sourceMap",
84
84
  "webpack": "webpack",
85
85
  "browser-test": "karma start",
86
- "docs-test": "echo 'disabled until linkinator is fixed'",
87
- "predocs-test": "npm run docs",
88
86
  "prelint": "cd samples; npm link ../; npm install"
89
87
  },
90
88
  "license": "Apache-2.0",
@@ -6,6 +6,22 @@ const { safeRe: re, t } = require('../internal/re')
6
6
 
7
7
  const parseOptions = require('../internal/parse-options')
8
8
  const { compareIdentifiers } = require('../internal/identifiers')
9
+
10
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
11
+ const identifiers = identifier.split('.')
12
+ if (identifiers.length > prerelease.length) {
13
+ return false
14
+ }
15
+
16
+ for (let i = 0; i < identifiers.length; i++) {
17
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
18
+ return false
19
+ }
20
+ }
21
+
22
+ return true
23
+ }
24
+
9
25
  class SemVer {
10
26
  constructor (version, options) {
11
27
  options = parseOptions(options)
@@ -309,8 +325,9 @@ class SemVer {
309
325
  if (identifierBase === false) {
310
326
  prerelease = [identifier]
311
327
  }
312
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
313
- if (isNaN(this.prerelease[1])) {
328
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
329
+ const prereleaseBase = this.prerelease[identifier.split('.').length]
330
+ if (isNaN(prereleaseBase)) {
314
331
  this.prerelease = prerelease
315
332
  }
316
333
  } else {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.8.1",
3
+ "version": "7.8.2",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ function setGlobalDispatcher (agent) {
32
32
  }
33
33
 
34
34
  function getGlobalDispatcher () {
35
- return globalThis[globalDispatcher]
35
+ return globalThis[legacyGlobalDispatcher]
36
36
  }
37
37
 
38
38
  // These are the globals that can be installed by undici.install().
@@ -13,6 +13,9 @@ class UnwrapController {
13
13
 
14
14
  [kResume] = null
15
15
 
16
+ rawHeaders = null
17
+ rawTrailers = null
18
+
16
19
  constructor (abort) {
17
20
  this.#abort = abort
18
21
  }
@@ -72,11 +75,13 @@ module.exports = class UnwrapHandler {
72
75
  }
73
76
 
74
77
  onUpgrade (statusCode, rawHeaders, socket) {
78
+ this.#controller.rawHeaders = rawHeaders
75
79
  this.#handler.onRequestUpgrade?.(this.#controller, statusCode, parseHeaders(rawHeaders), socket)
76
80
  }
77
81
 
78
82
  onHeaders (statusCode, rawHeaders, resume, statusMessage) {
79
83
  this.#controller[kResume] = resume
84
+ this.#controller.rawHeaders = rawHeaders
80
85
  this.#handler.onResponseStart?.(this.#controller, statusCode, parseHeaders(rawHeaders), statusMessage)
81
86
  return !this.#controller.paused
82
87
  }
@@ -87,6 +92,7 @@ module.exports = class UnwrapHandler {
87
92
  }
88
93
 
89
94
  onComplete (rawTrailers) {
95
+ this.#controller.rawTrailers = rawTrailers
90
96
  this.#handler.onResponseEnd?.(this.#controller, parseHeaders(rawTrailers))
91
97
  }
92
98
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.27.0",
3
+ "version": "7.27.2",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -212,6 +212,8 @@ declare namespace Dispatcher {
212
212
  get aborted(): boolean
213
213
  get paused(): boolean
214
214
  get reason(): Error | null
215
+ rawHeaders?: Buffer[] | string[] | IncomingHttpHeaders | null
216
+ rawTrailers?: Buffer[] | string[] | IncomingHttpHeaders | null
215
217
  abort(reason: Error): void
216
218
  pause(): void
217
219
  resume(): void
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/slingcli",
3
- "version": "2.5.20260602-4",
3
+ "version": "2.5.20260607-2",
4
4
  "description": "Connects Sling CLI to Publicis Sapient Slingshot enterprise LLM gateway. Bundles the pi coding-agent runtime.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,12 +29,12 @@
29
29
  "type": "git",
30
30
  "url": "git+https://pscode.lioncloud.net/psaiproducts/slingcli.git"
31
31
  },
32
- "slingVersion": "2.5.20260602-4",
32
+ "slingVersion": "2.5.20260607-2",
33
33
  "dependencies": {
34
- "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.78.0.tgz",
35
- "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.78.0.tgz",
36
- "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.78.0.tgz",
37
- "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.78.0.tgz",
34
+ "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.78.1.tgz",
35
+ "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.78.1.tgz",
36
+ "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.78.1.tgz",
37
+ "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.78.1.tgz",
38
38
  "undici": "^7.19.1",
39
39
  "semver": "^7.6.0"
40
40
  },