@zhafron/opencode-kiro-auth 1.6.3 → 1.6.5
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 +31 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +2 -1
- package/dist/plugin/config/schema.js +2 -2
- package/dist/plugin/request.js +3 -7
- package/dist/plugin/token.js +3 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,21 @@ Add the plugin to your `opencode.json` or `opencode.jsonc`:
|
|
|
41
41
|
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
+
"claude-sonnet-4-6": {
|
|
45
|
+
"name": "Claude Sonnet 4.6",
|
|
46
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
47
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
48
|
+
},
|
|
49
|
+
"claude-sonnet-4-6-thinking": {
|
|
50
|
+
"name": "Claude Sonnet 4.6 Thinking",
|
|
51
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
52
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
53
|
+
"variants": {
|
|
54
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
55
|
+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
|
|
56
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
44
59
|
"claude-haiku-4-5": {
|
|
45
60
|
"name": "Claude Haiku 4.5",
|
|
46
61
|
"limit": { "context": 200000, "output": 64000 },
|
|
@@ -92,10 +107,25 @@ Add the plugin to your `opencode.json` or `opencode.jsonc`:
|
|
|
92
107
|
}
|
|
93
108
|
},
|
|
94
109
|
"claude-sonnet-4-5-1m": {
|
|
95
|
-
"name": "Claude Sonnet 4.5 1M",
|
|
110
|
+
"name": "Claude Sonnet 4.5 (1M Context)",
|
|
96
111
|
"limit": { "context": 1000000, "output": 64000 },
|
|
97
112
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
98
113
|
},
|
|
114
|
+
"claude-sonnet-4-6-1m": {
|
|
115
|
+
"name": "Claude Sonnet 4.6 (1M Context)",
|
|
116
|
+
"limit": { "context": 1000000, "output": 64000 },
|
|
117
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
118
|
+
},
|
|
119
|
+
"claude-sonnet-4-6-1m-thinking": {
|
|
120
|
+
"name": "Claude Sonnet 4.6 (1M Context) Thinking",
|
|
121
|
+
"limit": { "context": 1000000, "output": 64000 },
|
|
122
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
123
|
+
"variants": {
|
|
124
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
125
|
+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
|
|
126
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
127
|
+
}
|
|
128
|
+
},
|
|
99
129
|
"qwen3-coder-480b": {
|
|
100
130
|
"name": "Qwen3 Coder 480B",
|
|
101
131
|
"limit": { "context": 200000, "output": 64000 },
|
package/dist/constants.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ export declare const KIRO_CONSTANTS: {
|
|
|
10
10
|
DEFAULT_REGION: KiroRegion;
|
|
11
11
|
AXIOS_TIMEOUT: number;
|
|
12
12
|
USER_AGENT: string;
|
|
13
|
-
|
|
13
|
+
SDK_VERSION: string;
|
|
14
|
+
SDK_VERSION_USAGE: string;
|
|
14
15
|
CHAT_TRIGGER_TYPE_MANUAL: string;
|
|
15
16
|
ORIGIN_AI_EDITOR: string;
|
|
16
17
|
};
|
package/dist/constants.js
CHANGED
|
@@ -27,7 +27,8 @@ export const KIRO_CONSTANTS = {
|
|
|
27
27
|
DEFAULT_REGION: 'us-east-1',
|
|
28
28
|
AXIOS_TIMEOUT: 120000,
|
|
29
29
|
USER_AGENT: 'KiroIDE',
|
|
30
|
-
|
|
30
|
+
SDK_VERSION: '3.738.0',
|
|
31
|
+
SDK_VERSION_USAGE: '3.0.0',
|
|
31
32
|
CHAT_TRIGGER_TYPE_MANUAL: 'MANUAL',
|
|
32
33
|
ORIGIN_AI_EDITOR: 'AI_EDITOR'
|
|
33
34
|
};
|
|
@@ -45,7 +45,7 @@ export const KiroConfigSchema = z.object({
|
|
|
45
45
|
rate_limit_max_retries: z.number().min(0).max(10).default(3),
|
|
46
46
|
max_request_iterations: z.number().min(5).max(1000).default(20),
|
|
47
47
|
request_timeout_ms: z.number().min(30000).max(600000).default(120000),
|
|
48
|
-
token_expiry_buffer_ms: z.number().min(30000).max(300000).default(
|
|
48
|
+
token_expiry_buffer_ms: z.number().min(30000).max(300000).default(300000),
|
|
49
49
|
usage_sync_max_retries: z.number().min(0).max(5).default(3),
|
|
50
50
|
auth_server_port_start: z.number().min(1024).max(65535).default(19847),
|
|
51
51
|
auth_server_port_range: z.number().min(1).max(100).default(10),
|
|
@@ -60,7 +60,7 @@ export const DEFAULT_CONFIG = {
|
|
|
60
60
|
rate_limit_max_retries: 3,
|
|
61
61
|
max_request_iterations: 20,
|
|
62
62
|
request_timeout_ms: 120000,
|
|
63
|
-
token_expiry_buffer_ms:
|
|
63
|
+
token_expiry_buffer_ms: 300000,
|
|
64
64
|
usage_sync_max_retries: 3,
|
|
65
65
|
auth_server_port_start: 19847,
|
|
66
66
|
auth_server_port_range: 10,
|
package/dist/plugin/request.js
CHANGED
|
@@ -215,13 +215,9 @@ export function transformToCodeWhisperer(url, body, model, auth, think = false,
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
const
|
|
219
|
-
.createHash('sha256')
|
|
220
|
-
.update(auth.profileArn || auth.clientId || 'KIRO_DEFAULT_MACHINE')
|
|
221
|
-
.digest('hex');
|
|
222
|
-
const osP = os.platform(), osR = os.release(), nodeV = process.version.replace('v', ''), kiroV = KIRO_CONSTANTS.KIRO_VERSION;
|
|
218
|
+
const osP = os.platform(), osR = os.release(), nodeV = process.version.replace('v', '');
|
|
223
219
|
const osN = osP === 'win32' ? `windows#${osR}` : osP === 'darwin' ? `macos#${osR}` : `${osP}#${osR}`;
|
|
224
|
-
const ua = `aws-sdk-js/
|
|
220
|
+
const ua = `aws-sdk-js/3.738.0 ua/2.1 os/${osN} lang/js md/nodejs#${nodeV} api/codewhisperer#3.738.0 m/E KiroIDE`;
|
|
225
221
|
return {
|
|
226
222
|
url: KIRO_CONSTANTS.BASE_URL.replace('{{region}}', auth.region),
|
|
227
223
|
init: {
|
|
@@ -233,7 +229,7 @@ export function transformToCodeWhisperer(url, body, model, auth, think = false,
|
|
|
233
229
|
'amz-sdk-invocation-id': crypto.randomUUID(),
|
|
234
230
|
'amz-sdk-request': 'attempt=1; max=1',
|
|
235
231
|
'x-amzn-kiro-agent-mode': 'vibe',
|
|
236
|
-
'x-amz-user-agent':
|
|
232
|
+
'x-amz-user-agent': 'aws-sdk-js/3.738.0 KiroIDE',
|
|
237
233
|
'user-agent': ua,
|
|
238
234
|
Connection: 'close'
|
|
239
235
|
},
|
package/dist/plugin/token.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import crypto from 'node:crypto';
|
|
2
1
|
import { decodeRefreshToken, encodeRefreshToken } from '../kiro/auth';
|
|
3
2
|
import { KiroTokenRefreshError } from './errors';
|
|
4
3
|
export async function refreshAccessToken(auth) {
|
|
@@ -20,11 +19,9 @@ export async function refreshAccessToken(auth) {
|
|
|
20
19
|
: {
|
|
21
20
|
refreshToken: p.refreshToken
|
|
22
21
|
};
|
|
23
|
-
const
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.digest('hex');
|
|
27
|
-
const ua = isIdc ? 'aws-sdk-js/1.0.0' : `KiroIDE-0.7.45-${machineId}`;
|
|
22
|
+
const ua = isIdc
|
|
23
|
+
? 'aws-sdk-js/3.738.0 ua/2.1 os/other lang/js md/browser#unknown_unknown api/sso-oidc#3.738.0 m/E KiroIDE'
|
|
24
|
+
: 'aws-sdk-js/3.0.0 KiroIDE-0.1.0 os/macos lang/js md/nodejs/18.0.0';
|
|
28
25
|
try {
|
|
29
26
|
const res = await fetch(url, {
|
|
30
27
|
method: 'POST',
|