@sunerpy/opencode-kiro-auth 0.13.8 → 0.14.1

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
@@ -218,9 +218,9 @@ Details and the full JSON example: [docs/MODELS.md](docs/MODELS.md).
218
218
  > [Reasoning display](docs/CONFIGURATION.md#reasoning-display) for details.
219
219
 
220
220
  > **Note:** Per-request thinking level via model variants — pick
221
- > `kiro-auth/claude-opus-4-8-xhigh` (or similar) straight from the model
221
+ > `kiro-auth/claude-opus-5-xhigh` (or similar) straight from the model
222
222
  > list to pin an explicit Kiro effort level for that model, no `kiro.json`
223
- > edit needed. Base models like `claude-opus-4-8` remain available and keep
223
+ > edit needed. Base models like `claude-opus-5` remain available and keep
224
224
  > using the global `effort` setting. See [docs/VARIANTS.md](docs/VARIANTS.md)
225
225
  > for the full variant list and why they exist.
226
226
 
package/dist/constants.js CHANGED
@@ -73,6 +73,9 @@ export const MODEL_MAPPING = {
73
73
  'claude-opus-4-7-thinking': 'claude-opus-4.7',
74
74
  'claude-opus-4-8': 'claude-opus-4.8',
75
75
  'claude-opus-4-8-thinking': 'claude-opus-4.8',
76
+ // Wire id has no dot suffix (probe-confirmed against the live API).
77
+ 'claude-opus-5': 'claude-opus-5',
78
+ 'claude-opus-5-thinking': 'claude-opus-5',
76
79
  // Auto
77
80
  auto: 'auto',
78
81
  // Open weight models
@@ -117,6 +120,7 @@ export const MODEL_CONTEXT_LIMITS = {
117
120
  'claude-opus-4-6-1m': 1000000,
118
121
  'claude-opus-4-7': 1000000,
119
122
  'claude-opus-4-8': 1000000,
123
+ 'claude-opus-5': 1000000,
120
124
  'deepseek-3.2': 128000,
121
125
  'glm-5': 200000,
122
126
  'minimax-m2.5': 200000,
@@ -242,8 +242,9 @@ export class RequestHandler {
242
242
  try {
243
243
  sdkResponse = await client.send(command, { abortSignal: signal });
244
244
  }
245
- finally {
245
+ catch (error) {
246
246
  endUpstreamWait();
247
+ throw error;
247
248
  }
248
249
  sendResolved = true;
249
250
  if (apiTimestamp) {
@@ -251,11 +252,19 @@ export class RequestHandler {
251
252
  }
252
253
  const response = await this.responseHandler.handleSdkSuccess(sdkResponse, model, sdkPrep.conversationId, sdkPrep.streaming, {
253
254
  signal,
254
- onUpstreamWaitStart: () => beginUpstreamWait('stream event', this.config.request_timeout_ms, {
255
- model,
256
- effectiveModel: sdkPrep.effectiveModel,
257
- region: sdkPrep.region
258
- }),
255
+ onUpstreamWaitStart: ({ eventIndex }) => {
256
+ if (eventIndex === 0) {
257
+ if (!this.config.sdk_response_timeout_enabled)
258
+ endUpstreamWait();
259
+ return;
260
+ }
261
+ beginUpstreamWait('stream event', this.config.request_timeout_ms, {
262
+ model,
263
+ effectiveModel: sdkPrep.effectiveModel,
264
+ region: sdkPrep.region,
265
+ eventIndex
266
+ });
267
+ },
259
268
  onUpstreamWaitEnd: endUpstreamWait,
260
269
  onIterationError: (error, afterCompletionMetadata) => logger.warn('Kiro SDK event stream iteration failed', {
261
270
  model,
@@ -1,7 +1,9 @@
1
1
  import { SdkEventStreamIterationError } from './stream-error.js';
2
2
  export interface SdkResponseLifecycle {
3
3
  signal?: AbortSignal;
4
- onUpstreamWaitStart?: () => void;
4
+ onUpstreamWaitStart?: (context: {
5
+ eventIndex: number;
6
+ }) => void;
5
7
  onUpstreamWaitEnd?: () => void;
6
8
  onIterationError?: (error: unknown, afterCompletionMetadata: boolean) => void;
7
9
  onComplete?: () => void | Promise<void>;
@@ -27,6 +27,7 @@ function wrapSdkEventStream(sdkResponse, signal, onUpstreamWaitStart, onUpstream
27
27
  const rawIterator = eventStream[Symbol.asyncIterator]();
28
28
  let closed = false;
29
29
  let completionMetadataSeen = false;
30
+ let eventIndex = 0;
30
31
  const closeRaw = async () => {
31
32
  if (closed)
32
33
  return;
@@ -38,26 +39,33 @@ function wrapSdkEventStream(sdkResponse, signal, onUpstreamWaitStart, onUpstream
38
39
  await closeRaw();
39
40
  throw abortReason(signal);
40
41
  }
41
- onUpstreamWaitStart?.();
42
+ onUpstreamWaitStart?.({ eventIndex });
42
43
  try {
43
- if (!signal)
44
- return await rawIterator.next();
45
- return await new Promise((resolve, reject) => {
46
- let settled = false;
47
- const settle = (callback) => {
48
- if (settled)
49
- return;
50
- settled = true;
51
- signal.removeEventListener('abort', onAbort);
52
- callback();
53
- };
54
- const onAbort = () => {
55
- void closeRaw();
56
- settle(() => reject(abortReason(signal)));
57
- };
58
- signal.addEventListener('abort', onAbort, { once: true });
59
- Promise.resolve(rawIterator.next()).then((result) => settle(() => resolve(result)), (error) => settle(() => reject(error)));
60
- });
44
+ let result;
45
+ if (!signal) {
46
+ result = await rawIterator.next();
47
+ }
48
+ else {
49
+ result = await new Promise((resolve, reject) => {
50
+ let settled = false;
51
+ const settle = (callback) => {
52
+ if (settled)
53
+ return;
54
+ settled = true;
55
+ signal.removeEventListener('abort', onAbort);
56
+ callback();
57
+ };
58
+ const onAbort = () => {
59
+ void closeRaw();
60
+ settle(() => reject(abortReason(signal)));
61
+ };
62
+ signal.addEventListener('abort', onAbort, { once: true });
63
+ Promise.resolve(rawIterator.next()).then((nextResult) => settle(() => resolve(nextResult)), (error) => settle(() => reject(error)));
64
+ });
65
+ }
66
+ if (!result.done)
67
+ eventIndex++;
68
+ return result;
61
69
  }
62
70
  finally {
63
71
  onUpstreamWaitEnd?.();
@@ -14,6 +14,7 @@ const GPT_REASONING_MODELS = new Set(['gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-l
14
14
  * These models support up to 128k thinking tokens with max effort.
15
15
  */
16
16
  const XHIGH_CAPABLE_MODELS = new Set([
17
+ 'claude-opus-5',
17
18
  'claude-opus-4.7',
18
19
  'claude-opus-4.8',
19
20
  'claude-sonnet-5',
@@ -68,7 +69,7 @@ export function resolveEffort(kiroModel, requested) {
68
69
  if (!supportsEffort(kiroModel)) {
69
70
  return undefined;
70
71
  }
71
- // xhigh is only supported on opus-4.7 and opus-4.8
72
+ // xhigh is only supported on models in XHIGH_CAPABLE_MODELS.
72
73
  if (requested === 'xhigh' && !supportsXHighEffort(kiroModel)) {
73
74
  return 'max';
74
75
  }
@@ -7,6 +7,7 @@ export function resolveKiroModel(model) {
7
7
  return resolved;
8
8
  }
9
9
  const VARIANT_BASE_ALLOWLIST = new Set([
10
+ 'claude-opus-5',
10
11
  'claude-opus-4-8',
11
12
  'claude-opus-4-7',
12
13
  'claude-sonnet-5',
package/dist/plugin.js CHANGED
@@ -234,6 +234,36 @@ export const createKiroPlugin = (id) => async ({ client, directory }) => {
234
234
  limit: { context: 1000000, output: 64000 },
235
235
  modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
236
236
  },
237
+ 'claude-opus-5': {
238
+ name: 'Claude Opus 5 (2.2x)',
239
+ limit: { context: 1000000, output: 64000 },
240
+ modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
241
+ },
242
+ 'claude-opus-5-low': {
243
+ name: 'Claude Opus 5 (low) (2.2x)',
244
+ limit: { context: 1000000, output: 64000 },
245
+ modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
246
+ },
247
+ 'claude-opus-5-medium': {
248
+ name: 'Claude Opus 5 (medium) (2.2x)',
249
+ limit: { context: 1000000, output: 64000 },
250
+ modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
251
+ },
252
+ 'claude-opus-5-high': {
253
+ name: 'Claude Opus 5 (high) (2.2x)',
254
+ limit: { context: 1000000, output: 64000 },
255
+ modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
256
+ },
257
+ 'claude-opus-5-xhigh': {
258
+ name: 'Claude Opus 5 (xhigh) (2.2x)',
259
+ limit: { context: 1000000, output: 64000 },
260
+ modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
261
+ },
262
+ 'claude-opus-5-max': {
263
+ name: 'Claude Opus 5 (max) (2.2x)',
264
+ limit: { context: 1000000, output: 64000 },
265
+ modalities: { input: ['text', 'image', 'pdf'], output: ['text'] }
266
+ },
237
267
  // Open weight models
238
268
  'deepseek-3.2': {
239
269
  name: 'DeepSeek 3.2 (0.25x)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunerpy/opencode-kiro-auth",
3
- "version": "0.13.8",
3
+ "version": "0.14.1",
4
4
  "description": "OpenCode plugin for AWS Kiro (CodeWhisperer) providing access to Claude models",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",