@javargasm/opencode-kiro-auth 0.1.0 → 0.1.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 +5 -5
- package/dist/index.js +15 -8
- package/dist/stream.d.ts.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# opencode-kiro
|
|
1
|
+
# @javargasm/opencode-kiro-auth
|
|
2
2
|
|
|
3
3
|
Kiro provider plugin for [OpenCode](https://opencode.ai). Authenticates via AWS Builder ID or IAM Identity Center and exposes all Kiro models through an Anthropic-compatible local gateway.
|
|
4
4
|
|
|
@@ -44,7 +44,7 @@ Add the plugin to your `opencode.json`:
|
|
|
44
44
|
{
|
|
45
45
|
"$schema": "https://opencode.ai/config.json",
|
|
46
46
|
"plugin": [
|
|
47
|
-
"opencode-kiro"
|
|
47
|
+
"@javargasm/opencode-kiro-auth"
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
```
|
|
@@ -56,8 +56,8 @@ OpenCode will auto-install the package on startup.
|
|
|
56
56
|
1. Clone the repository:
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
git clone https://github.com/
|
|
60
|
-
cd opencode-kiro
|
|
59
|
+
git clone https://github.com/javargasm/opencode-kiro-auth.git
|
|
60
|
+
cd opencode-kiro-auth
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
2. Install dependencies and build:
|
|
@@ -73,7 +73,7 @@ bun run build
|
|
|
73
73
|
{
|
|
74
74
|
"$schema": "https://opencode.ai/config.json",
|
|
75
75
|
"plugin": [
|
|
76
|
-
"/absolute/path/to/opencode-kiro/dist/index.js"
|
|
76
|
+
"/absolute/path/to/opencode-kiro-auth/dist/index.js"
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
```
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __returnValue = (v) => v;
|
|
4
|
+
function __exportSetter(name, newValue) {
|
|
5
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
6
|
+
}
|
|
3
7
|
var __export = (target, all) => {
|
|
4
8
|
for (var name in all)
|
|
5
9
|
__defProp(target, name, {
|
|
6
10
|
get: all[name],
|
|
7
11
|
enumerable: true,
|
|
8
12
|
configurable: true,
|
|
9
|
-
set: (
|
|
13
|
+
set: __exportSetter.bind(all, name)
|
|
10
14
|
});
|
|
11
15
|
};
|
|
12
16
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -2115,8 +2119,9 @@ ${currentContent}`;
|
|
|
2115
2119
|
let transientRetryCount = 0;
|
|
2116
2120
|
let contextTruncationAttempt = 0;
|
|
2117
2121
|
while (true) {
|
|
2118
|
-
const
|
|
2119
|
-
const ua = `aws-sdk-rust/1.
|
|
2122
|
+
const osName = resolveOS();
|
|
2123
|
+
const ua = `aws-sdk-rust/1.3.15 ua/2.1 api/codewhispererstreaming/0.1.16551 os/${osName} lang/rust/1.92.0 md/appVersion-2.7.1 app/AmazonQ-For-CLI`;
|
|
2124
|
+
const xAmzUa = `aws-sdk-rust/1.3.15 ua/2.1 api/codewhispererstreaming/0.1.16551 os/${osName} lang/rust/1.92.0 m/F app/AmazonQ-For-CLI`;
|
|
2120
2125
|
const requestBody = JSON.stringify(request);
|
|
2121
2126
|
log.debug("request.send", {
|
|
2122
2127
|
attempt: retryCount,
|
|
@@ -2137,15 +2142,17 @@ ${currentContent}`;
|
|
|
2137
2142
|
method: "POST",
|
|
2138
2143
|
headers: {
|
|
2139
2144
|
"Content-Type": "application/x-amz-json-1.0",
|
|
2140
|
-
Accept: "
|
|
2145
|
+
Accept: "*/*",
|
|
2146
|
+
"Accept-Encoding": "gzip",
|
|
2141
2147
|
Authorization: `Bearer ${accessToken}`,
|
|
2142
2148
|
"X-Amz-Target": "AmazonCodeWhispererStreamingService.GenerateAssistantResponse",
|
|
2143
2149
|
"x-amzn-codewhisperer-optout": "true",
|
|
2144
2150
|
"amz-sdk-invocation-id": crypto.randomUUID(),
|
|
2145
|
-
"amz-sdk-request": "attempt=1; max=
|
|
2146
|
-
"
|
|
2147
|
-
"x-amz-user-agent":
|
|
2148
|
-
"
|
|
2151
|
+
"amz-sdk-request": "attempt=1; max=3",
|
|
2152
|
+
"user-agent": ua,
|
|
2153
|
+
"x-amz-user-agent": xAmzUa,
|
|
2154
|
+
Pragma: "no-cache",
|
|
2155
|
+
"Cache-Control": "no-cache"
|
|
2149
2156
|
},
|
|
2150
2157
|
body: requestBody,
|
|
2151
2158
|
signal: options?.signal
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,GAAG,EAEH,OAAO,EAEP,KAAK,EACL,mBAAmB,EAKpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,2BAA2B,EAAiB,MAAM,SAAS,CAAC;AA6FrE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAgDlD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,UAAQ,GAAG,IAAI,CAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAElE;AAED,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuC1G;AA2DD,wBAAgB,UAAU,CACxB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,GAAG,EAEH,OAAO,EAEP,KAAK,EACL,mBAAmB,EAKpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,2BAA2B,EAAiB,MAAM,SAAS,CAAC;AA6FrE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAgDlD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,UAAQ,GAAG,IAAI,CAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAElE;AAED,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuC1G;AA2DD,wBAAgB,UAAU,CACxB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,2BAA2B,CAm0B7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@javargasm/opencode-kiro-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Kiro provider plugin for OpenCode: AWS Builder ID / Identity Center login and OpenAI compatible local gateway for CodeWhisperer streaming.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
"build:types": "tsc -p tsconfig.build.json",
|
|
46
46
|
"build": "bun run clean && bun run build:js && bun run build:types",
|
|
47
47
|
"typecheck": "tsc --noEmit",
|
|
48
|
-
"test": "
|
|
49
|
-
"test:
|
|
50
|
-
"
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:bun": "bun test test/gateway.test.ts",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"check": "bun run typecheck && bun run test && bun run test:bun",
|
|
51
52
|
"changeset": "changeset",
|
|
52
53
|
"version": "changeset version",
|
|
53
54
|
"prepack": "bun run build",
|