@sunerpy/opencode-kiro-auth 0.11.0 → 0.13.0
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 +3 -2
- package/dist/constants.js +5 -0
- package/dist/plugin/effort.d.ts +9 -0
- package/dist/plugin/effort.js +27 -1
- package/dist/plugin/models.js +4 -1
- package/dist/plugin/sdk-client.js +5 -8
- package/dist/plugin.js +90 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/@sunerpy/opencode-kiro-auth)
|
|
9
9
|
|
|
10
10
|
> OpenCode plugin that lets OpenCode use AWS Kiro (CodeWhisperer) as a model
|
|
11
|
-
> provider — Claude Sonnet, Opus, and Haiku, plus the
|
|
12
|
-
>
|
|
11
|
+
> provider — Claude Sonnet, Opus, and Haiku, plus the other models Kiro proxies
|
|
12
|
+
> (OpenAI GPT 5.6, DeepSeek, GLM, MiniMax, Qwen3) — with substantial trial
|
|
13
|
+
> quotas.
|
|
13
14
|
|
|
14
15
|
## Table of Contents
|
|
15
16
|
|
package/dist/constants.js
CHANGED
|
@@ -81,6 +81,11 @@ export const MODEL_MAPPING = {
|
|
|
81
81
|
'minimax-m2.5': 'minimax-m2.5',
|
|
82
82
|
'minimax-m2.1': 'minimax-m2.1',
|
|
83
83
|
'qwen3-coder-next': 'qwen3-coder-next',
|
|
84
|
+
// OpenAI GPT 5.6 — probe-confirmed (200, us-east-1); other naming guesses 400.
|
|
85
|
+
// Effort variants (-low..-max) are parsed by resolveModelVariant, not mapped here.
|
|
86
|
+
'gpt-5.6-sol': 'gpt-5.6-sol',
|
|
87
|
+
'gpt-5.6-terra': 'gpt-5.6-terra',
|
|
88
|
+
'gpt-5.6-luna': 'gpt-5.6-luna',
|
|
84
89
|
// Legacy / internal mappings kept for backwards compatibility
|
|
85
90
|
'claude-3-7-sonnet': 'CLAUDE_3_7_SONNET_20250219_V1_0',
|
|
86
91
|
'nova-swe': 'AGI_NOVA_SWE_V1_5',
|
package/dist/plugin/effort.d.ts
CHANGED
|
@@ -11,6 +11,15 @@ export declare function supportsEffort(kiroModel: string): boolean;
|
|
|
11
11
|
* Check if a model supports xhigh effort level.
|
|
12
12
|
*/
|
|
13
13
|
export declare function supportsXHighEffort(kiroModel: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Build the additionalModelRequestFields payload carrying the effort level.
|
|
16
|
+
*
|
|
17
|
+
* GPT and Claude take effort through different, mutually-exclusive wire fields
|
|
18
|
+
* (each rejects the other's with HTTP 400, probe-confirmed):
|
|
19
|
+
* - GPT (Mantle): `reasoning.effort`
|
|
20
|
+
* - Claude: `output_config.effort`
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildEffortRequestFields(kiroModel: string, effort: Effort): Record<string, unknown>;
|
|
14
23
|
/**
|
|
15
24
|
* Resolve effort level for a given model.
|
|
16
25
|
* - Returns undefined if model doesn't support effort
|
package/dist/plugin/effort.js
CHANGED
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
* Effort levels ordered from lowest to highest reasoning depth.
|
|
3
3
|
*/
|
|
4
4
|
export const EFFORT_LEVELS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
5
|
+
/**
|
|
6
|
+
* OpenAI GPT models (Kiro proxies these via Mantle). They accept the effort enum
|
|
7
|
+
* through a DIFFERENT wire field than Claude — see buildEffortRequestFields.
|
|
8
|
+
* All five levels (incl. xhigh/max) are probe-confirmed: credit usage scales
|
|
9
|
+
* monotonically low<medium<high<xhigh<max (.omo/evidence/task-gpt56-effort-probe.txt).
|
|
10
|
+
*/
|
|
11
|
+
const GPT_REASONING_MODELS = new Set(['gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna']);
|
|
5
12
|
/**
|
|
6
13
|
* Models that support the 5-value effort enum (including xhigh).
|
|
7
14
|
* These models support up to 128k thinking tokens with max effort.
|
|
8
15
|
*/
|
|
9
|
-
const XHIGH_CAPABLE_MODELS = new Set([
|
|
16
|
+
const XHIGH_CAPABLE_MODELS = new Set([
|
|
17
|
+
'claude-opus-4.7',
|
|
18
|
+
'claude-opus-4.8',
|
|
19
|
+
'claude-sonnet-5',
|
|
20
|
+
...GPT_REASONING_MODELS
|
|
21
|
+
]);
|
|
10
22
|
/**
|
|
11
23
|
* Models that support the 4-value effort enum (no xhigh).
|
|
12
24
|
* xhigh requests on these models are clamped to max.
|
|
@@ -33,6 +45,20 @@ export function supportsEffort(kiroModel) {
|
|
|
33
45
|
export function supportsXHighEffort(kiroModel) {
|
|
34
46
|
return XHIGH_CAPABLE_MODELS.has(kiroModel);
|
|
35
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Build the additionalModelRequestFields payload carrying the effort level.
|
|
50
|
+
*
|
|
51
|
+
* GPT and Claude take effort through different, mutually-exclusive wire fields
|
|
52
|
+
* (each rejects the other's with HTTP 400, probe-confirmed):
|
|
53
|
+
* - GPT (Mantle): `reasoning.effort`
|
|
54
|
+
* - Claude: `output_config.effort`
|
|
55
|
+
*/
|
|
56
|
+
export function buildEffortRequestFields(kiroModel, effort) {
|
|
57
|
+
if (GPT_REASONING_MODELS.has(kiroModel)) {
|
|
58
|
+
return { reasoning: { effort } };
|
|
59
|
+
}
|
|
60
|
+
return { output_config: { effort } };
|
|
61
|
+
}
|
|
36
62
|
/**
|
|
37
63
|
* Resolve effort level for a given model.
|
|
38
64
|
* - Returns undefined if model doesn't support effort
|
package/dist/plugin/models.js
CHANGED
|
@@ -10,7 +10,10 @@ const VARIANT_BASE_ALLOWLIST = new Set([
|
|
|
10
10
|
'claude-opus-4-8',
|
|
11
11
|
'claude-opus-4-7',
|
|
12
12
|
'claude-sonnet-5',
|
|
13
|
-
'claude-sonnet-4-6'
|
|
13
|
+
'claude-sonnet-4-6',
|
|
14
|
+
'gpt-5.6-sol',
|
|
15
|
+
'gpt-5.6-terra',
|
|
16
|
+
'gpt-5.6-luna'
|
|
14
17
|
]);
|
|
15
18
|
const EFFORT_SUFFIXES = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
16
19
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CodeWhispererStreamingClient } from '@aws/codewhisperer-streaming-client';
|
|
2
2
|
import { KIRO_CONSTANTS } from '../constants.js';
|
|
3
|
+
import { buildEffortRequestFields } from './effort.js';
|
|
3
4
|
const clientCache = new Map();
|
|
4
5
|
const KIRO_CLI_MAX_ATTEMPTS = 3;
|
|
5
6
|
export function createSdkClient(auth, region, effort) {
|
|
@@ -22,19 +23,15 @@ export function createSdkClient(auth, region, effort) {
|
|
|
22
23
|
args.request.headers['x-amzn-kiro-agent-mode'] = 'vibe';
|
|
23
24
|
return next(args);
|
|
24
25
|
}, { step: 'build', name: 'addKiroHeaders' });
|
|
25
|
-
//
|
|
26
|
+
// Effort wire shape differs per family (GPT: reasoning.effort, Claude:
|
|
27
|
+
// output_config.effort; each 400s the other), so derive it from the body's modelId.
|
|
26
28
|
if (effort) {
|
|
27
29
|
client.middlewareStack.add((next) => async (args) => {
|
|
28
|
-
// The SDK serializes input to args.input, we need to modify the body
|
|
29
|
-
// before it's sent. The body is in args.request.body as a string.
|
|
30
30
|
if (args.request?.body) {
|
|
31
31
|
try {
|
|
32
32
|
const body = JSON.parse(args.request.body);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
effort
|
|
36
|
-
}
|
|
37
|
-
};
|
|
33
|
+
const wireModel = body?.conversationState?.currentMessage?.userInputMessage?.modelId;
|
|
34
|
+
body.additionalModelRequestFields = buildEffortRequestFields(wireModel, effort);
|
|
38
35
|
args.request.body = JSON.stringify(body);
|
|
39
36
|
}
|
|
40
37
|
catch {
|
package/dist/plugin.js
CHANGED
|
@@ -259,6 +259,96 @@ export const createKiroPlugin = (id) => async ({ client, directory }) => {
|
|
|
259
259
|
name: 'Qwen3 Coder Next (0.05x)',
|
|
260
260
|
limit: { context: 256000, output: 64000 },
|
|
261
261
|
modalities: { input: ['text'], output: ['text'] }
|
|
262
|
+
},
|
|
263
|
+
'gpt-5.6-sol': {
|
|
264
|
+
name: 'GPT 5.6 Sol (2.4x)',
|
|
265
|
+
limit: { context: 272000, output: 64000 },
|
|
266
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
267
|
+
},
|
|
268
|
+
'gpt-5.6-sol-low': {
|
|
269
|
+
name: 'GPT 5.6 Sol (low) (2.4x)',
|
|
270
|
+
limit: { context: 272000, output: 64000 },
|
|
271
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
272
|
+
},
|
|
273
|
+
'gpt-5.6-sol-medium': {
|
|
274
|
+
name: 'GPT 5.6 Sol (medium) (2.4x)',
|
|
275
|
+
limit: { context: 272000, output: 64000 },
|
|
276
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
277
|
+
},
|
|
278
|
+
'gpt-5.6-sol-high': {
|
|
279
|
+
name: 'GPT 5.6 Sol (high) (2.4x)',
|
|
280
|
+
limit: { context: 272000, output: 64000 },
|
|
281
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
282
|
+
},
|
|
283
|
+
'gpt-5.6-sol-xhigh': {
|
|
284
|
+
name: 'GPT 5.6 Sol (xhigh) (2.4x)',
|
|
285
|
+
limit: { context: 272000, output: 64000 },
|
|
286
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
287
|
+
},
|
|
288
|
+
'gpt-5.6-sol-max': {
|
|
289
|
+
name: 'GPT 5.6 Sol (max) (2.4x)',
|
|
290
|
+
limit: { context: 272000, output: 64000 },
|
|
291
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
292
|
+
},
|
|
293
|
+
'gpt-5.6-terra': {
|
|
294
|
+
name: 'GPT 5.6 Terra (1.2x)',
|
|
295
|
+
limit: { context: 272000, output: 64000 },
|
|
296
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
297
|
+
},
|
|
298
|
+
'gpt-5.6-terra-low': {
|
|
299
|
+
name: 'GPT 5.6 Terra (low) (1.2x)',
|
|
300
|
+
limit: { context: 272000, output: 64000 },
|
|
301
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
302
|
+
},
|
|
303
|
+
'gpt-5.6-terra-medium': {
|
|
304
|
+
name: 'GPT 5.6 Terra (medium) (1.2x)',
|
|
305
|
+
limit: { context: 272000, output: 64000 },
|
|
306
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
307
|
+
},
|
|
308
|
+
'gpt-5.6-terra-high': {
|
|
309
|
+
name: 'GPT 5.6 Terra (high) (1.2x)',
|
|
310
|
+
limit: { context: 272000, output: 64000 },
|
|
311
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
312
|
+
},
|
|
313
|
+
'gpt-5.6-terra-xhigh': {
|
|
314
|
+
name: 'GPT 5.6 Terra (xhigh) (1.2x)',
|
|
315
|
+
limit: { context: 272000, output: 64000 },
|
|
316
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
317
|
+
},
|
|
318
|
+
'gpt-5.6-terra-max': {
|
|
319
|
+
name: 'GPT 5.6 Terra (max) (1.2x)',
|
|
320
|
+
limit: { context: 272000, output: 64000 },
|
|
321
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
322
|
+
},
|
|
323
|
+
'gpt-5.6-luna': {
|
|
324
|
+
name: 'GPT 5.6 Luna',
|
|
325
|
+
limit: { context: 272000, output: 64000 },
|
|
326
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
327
|
+
},
|
|
328
|
+
'gpt-5.6-luna-low': {
|
|
329
|
+
name: 'GPT 5.6 Luna (low)',
|
|
330
|
+
limit: { context: 272000, output: 64000 },
|
|
331
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
332
|
+
},
|
|
333
|
+
'gpt-5.6-luna-medium': {
|
|
334
|
+
name: 'GPT 5.6 Luna (medium)',
|
|
335
|
+
limit: { context: 272000, output: 64000 },
|
|
336
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
337
|
+
},
|
|
338
|
+
'gpt-5.6-luna-high': {
|
|
339
|
+
name: 'GPT 5.6 Luna (high)',
|
|
340
|
+
limit: { context: 272000, output: 64000 },
|
|
341
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
342
|
+
},
|
|
343
|
+
'gpt-5.6-luna-xhigh': {
|
|
344
|
+
name: 'GPT 5.6 Luna (xhigh)',
|
|
345
|
+
limit: { context: 272000, output: 64000 },
|
|
346
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
347
|
+
},
|
|
348
|
+
'gpt-5.6-luna-max': {
|
|
349
|
+
name: 'GPT 5.6 Luna (max)',
|
|
350
|
+
limit: { context: 272000, output: 64000 },
|
|
351
|
+
modalities: { input: ['text', 'image'], output: ['text'] }
|
|
262
352
|
}
|
|
263
353
|
};
|
|
264
354
|
}
|