@sunerpy/opencode-kiro-auth 0.6.1 → 0.6.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.
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@sunerpy/opencode-kiro-auth)
|
|
6
6
|
[](https://www.npmjs.com/package/@sunerpy/opencode-kiro-auth)
|
|
7
|
+
[](https://codecov.io/gh/sunerpy/opencode-kiro-auth)
|
|
7
8
|
[](https://www.npmjs.com/package/@sunerpy/opencode-kiro-auth)
|
|
8
9
|
|
|
9
10
|
> OpenCode plugin that lets OpenCode use AWS Kiro (CodeWhisperer) as a model
|
|
@@ -21,6 +21,12 @@ export declare class RequestHandler {
|
|
|
21
21
|
private enqueueKiroRequest;
|
|
22
22
|
private handleKiroRequest;
|
|
23
23
|
private extractModel;
|
|
24
|
+
/**
|
|
25
|
+
* Seam over the module-level SDK client factory so tests can inject a fake
|
|
26
|
+
* client without a real network call or a leaky module mock. Behavior is
|
|
27
|
+
* identical to calling createSdkClient directly.
|
|
28
|
+
*/
|
|
29
|
+
private makeSdkClient;
|
|
24
30
|
private prepareSdkRequest;
|
|
25
31
|
private handleSuccessfulRequest;
|
|
26
32
|
private logSdkRequest;
|
|
@@ -133,7 +133,7 @@ export class RequestHandler {
|
|
|
133
133
|
this.logSdkRequest(sdkPrep, acc, apiTimestamp);
|
|
134
134
|
}
|
|
135
135
|
try {
|
|
136
|
-
const client =
|
|
136
|
+
const client = this.makeSdkClient(auth, sdkPrep.region, sdkPrep.effort);
|
|
137
137
|
const command = new GenerateAssistantResponseCommand({
|
|
138
138
|
conversationState: sdkPrep.conversationState,
|
|
139
139
|
profileArn: sdkPrep.profileArn
|
|
@@ -183,6 +183,14 @@ export class RequestHandler {
|
|
|
183
183
|
extractModel(url) {
|
|
184
184
|
return url.match(/models\/([^/:]+)/)?.[1] || null;
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Seam over the module-level SDK client factory so tests can inject a fake
|
|
188
|
+
* client without a real network call or a leaky module mock. Behavior is
|
|
189
|
+
* identical to calling createSdkClient directly.
|
|
190
|
+
*/
|
|
191
|
+
makeSdkClient(auth, region, effort) {
|
|
192
|
+
return createSdkClient(auth, region, effort);
|
|
193
|
+
}
|
|
186
194
|
prepareSdkRequest(body, model, auth, think, budget, showToast) {
|
|
187
195
|
return transformToSdkRequest(body, model, auth, think, budget, showToast, {
|
|
188
196
|
effort: this.config.effort,
|