@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
  [![npm version](https://img.shields.io/npm/v/@sunerpy/opencode-kiro-auth)](https://www.npmjs.com/package/@sunerpy/opencode-kiro-auth)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@sunerpy/opencode-kiro-auth)](https://www.npmjs.com/package/@sunerpy/opencode-kiro-auth)
7
+ [![codecov](https://codecov.io/gh/sunerpy/opencode-kiro-auth/branch/main/graph/badge.svg)](https://codecov.io/gh/sunerpy/opencode-kiro-auth)
7
8
  [![license](https://img.shields.io/npm/l/@sunerpy/opencode-kiro-auth)](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 = createSdkClient(auth, sdkPrep.region, sdkPrep.effort);
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunerpy/opencode-kiro-auth",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "OpenCode plugin for AWS Kiro (CodeWhisperer) providing access to Claude models",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",