@sunerpy/kiro-provider 0.8.1 → 3.0.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 +46 -68
- package/dist/cli.js +132 -72
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# kiro-provider
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> An OpenAI Responses-compatible provider over AWS KiroRuntime, with native Responses and protocol-fidelity stateless fallback transports.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/sunerpy/kiro-provider/actions/workflows/ci.yml)
|
|
6
6
|
[](https://codecov.io/gh/sunerpy/kiro-provider)
|
|
@@ -29,17 +29,20 @@
|
|
|
29
29
|
|
|
30
30
|
## Features
|
|
31
31
|
|
|
32
|
-
- OpenAI Responses
|
|
32
|
+
- OpenAI Responses creation plus locally mirrored retrieve, delete, input-items,
|
|
33
|
+
and cancel routes; Anthropic Messages `POST /v1/messages`; legacy Chat
|
|
34
|
+
Completions behind an explicit switch; `GET /v1/models`, `GET /health`, and
|
|
35
|
+
authenticated `GET /ready`.
|
|
33
36
|
- Legacy OpenAI Chat Completions is available at `POST /v1/chat/completions`, but is disabled by default and must be explicitly enabled with `enable_legacy_chat_completions`.
|
|
34
37
|
- Bearer API-key gate that fails closed: the server refuses to start with no configured keys, and defaults to binding `127.0.0.1`.
|
|
35
38
|
- Provider-owned authentication by default: `auth_source: "local"` stores credentials in `~/.config/kiro-provider/accounts.db`. Existing `opencode-kiro-auth` accounts can be imported once with `kiro-provider accounts import`; after that, kiro-provider refreshes access tokens, usage, quota recovery, and account health without reading or locking OpenCode's database.
|
|
36
39
|
- Explicit-only session affinity by default: Responses requests can opt in through standard `metadata`, compatibility `client_metadata`, or `prompt_cache_key`; standard clients that resend complete history can also continue through the exact prior assistant-output lineage. User prompts are never fingerprinted to guess a session. A matching Zuno native OpenAI transport supplies `metadata.zuno_session_id` automatically.
|
|
37
40
|
- Account-scoped scheduling and cached SDK/transport objects: unrelated accounts can run concurrently, while one account is protected from overlapping Kiro streams. Access-token rotation rebuilds the credential-bound SDK client while retaining the account transport. A production-default service lock prevents multiple processes from silently splitting those queues and pools. Kiro model-call HTTP keep-alive is disabled by default and is an explicit transport opt-in.
|
|
38
41
|
- Live per-account model discovery and account-aware routing through Kiro management, with bounded stale/static fallback. Production calls use the live-probe-confirmed `runtime.<region>.kiro.dev` dialect. Token-usage metadata is an immediate completion witness; the current runtime's valid terminal metering event is accepted only when followed by clean EOF.
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
- Default `v3-auto` transport selection: ordinary requests use KiroRuntime's
|
|
43
|
+
native OpenAI Responses operation and request shapes requiring `store:false`,
|
|
44
|
+
max effort, encrypted reasoning replay, custom grammar, namespace tools, or
|
|
45
|
+
Codex collaboration use the canonical stateless fallback.
|
|
43
46
|
- Encrypted reasoning replay for complete native Kiro envelopes: opaque `kr1_...` tokens, AES-256-GCM storage, tenant/model/account/conversation/output binding, TTL/LRU cleanup, and account-locked replay.
|
|
44
47
|
- Multi-account rotation with automatic token refresh and failover. Exhausted accounts are hard-excluded from model attempts, then automatically rejoin only after a bounded, deduplicated Kiro usage probe confirms a new quota window. A provider-owned maintenance loop also refreshes near-expiry tokens and stale usage while the service is idle.
|
|
45
48
|
- `kiro-provider login` and `accounts import` write directly to the provider-owned local authentication store. The former `auth_source: "opencode-shared"` compatibility mode was removed in 0.7.0; a configuration that still selects it fails at startup with migration instructions (import once, then use `local`).
|
|
@@ -48,54 +51,30 @@
|
|
|
48
51
|
|
|
49
52
|
## Protocol compatibility
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
controls are rejected;
|
|
76
|
-
- Responses `input_file` supports inline base64/data-URL documents in Kiro's
|
|
77
|
-
native document formats. The original filename remains in the canonical
|
|
78
|
-
request; its recognized extension becomes the separate Kiro `format`, while
|
|
79
|
-
the extensionless ASCII name is validated before the SDK call. Names that
|
|
80
|
-
would require lossy rewriting return `invalid_file_name`; `file_id`
|
|
81
|
-
references are rejected because the provider has no OpenAI file store;
|
|
82
|
-
- an output-token limit is probe-confirmed for `claude-sonnet-5` and
|
|
83
|
-
`claude-opus-5` variants in the range 1,024–128,000;
|
|
84
|
-
- Responses omits only the exact `...`/`…` reasoning placeholder emitted by
|
|
85
|
-
GPT 5.6 Sol; Opus reasoning, non-placeholder Sol reasoning, effort mapping,
|
|
86
|
-
and encrypted reasoning replay remain unchanged;
|
|
87
|
-
- stateful Responses fields and native Web Search remain unsupported, and the
|
|
88
|
-
provider never fabricates search/citation events.
|
|
89
|
-
|
|
90
|
-
The current state of the verified subset, the compiled-binary acceptance runs
|
|
91
|
-
behind each release, and the 2026-09-02 full code review with its remediation
|
|
92
|
-
plan are recorded in [`docs/audits/`](docs/audits/README.md). Stable releases
|
|
93
|
-
stay gated on those records rather than on silently discarding unsupported
|
|
94
|
-
fields.
|
|
95
|
-
|
|
96
|
-
For the complete capability matrix, error codes, reasoning replay contract,
|
|
97
|
-
and v0.4 migration steps, see
|
|
98
|
-
[`docs/PROTOCOL_COMPATIBILITY.md`](docs/PROTOCOL_COMPATIBILITY.md).
|
|
54
|
+
V3 implements the core OpenAI Responses resource and makes every upstream
|
|
55
|
+
difference explicit:
|
|
56
|
+
|
|
57
|
+
- native JSON/SSE creation, instructions, function tools, supported effort and
|
|
58
|
+
token controls, and native `previous_response_id`;
|
|
59
|
+
- automatic stateless fallback for `store:false`, max effort, encrypted
|
|
60
|
+
reasoning, custom grammar, namespace tools, and Codex multi-agent items;
|
|
61
|
+
- tenant-isolated local response mirrors for retrieve, delete, input-items
|
|
62
|
+
pagination, and continuation;
|
|
63
|
+
- field-level OpenAI error envelopes for capabilities Kiro cannot preserve,
|
|
64
|
+
including Responses conversation objects, background execution, Structured
|
|
65
|
+
Outputs, hosted tools, remote file references, compact, and exact
|
|
66
|
+
input-token counting.
|
|
67
|
+
|
|
68
|
+
The old GenerateAssistantResponse `safe` mode remains fail-closed because
|
|
69
|
+
`additionalContext` did not preserve instruction content or priority, and the
|
|
70
|
+
account does not advertise the private `systemPrompt` feature. The default
|
|
71
|
+
`v3-auto` path instead uses KiroRuntime CreateResponse's native
|
|
72
|
+
`instructions` field.
|
|
73
|
+
|
|
74
|
+
For the transport decision table, stored-response contract, data-retention
|
|
75
|
+
boundary, verified model controls, and current client evidence, see
|
|
76
|
+
[`docs/PROTOCOL_COMPATIBILITY.md`](docs/PROTOCOL_COMPATIBILITY.md) and the
|
|
77
|
+
[`docs/audits/`](docs/audits/README.md) records.
|
|
99
78
|
|
|
100
79
|
## Install
|
|
101
80
|
|
|
@@ -135,11 +114,11 @@ irm https://raw.githubusercontent.com/sunerpy/kiro-provider/main/scripts/install
|
|
|
135
114
|
Both scripts download the platform asset together with the release's `SHA256SUMS`, verify the checksum, and abort on a mismatch before installing to `~/.local/bin` (override with `KIRO_PROVIDER_INSTALL_DIR`). By default they follow `releases/latest`; for reproducible or service installs, pin a release with `KIRO_PROVIDER_VERSION` (recommended):
|
|
136
115
|
|
|
137
116
|
```bash
|
|
138
|
-
curl -fsSL https://raw.githubusercontent.com/sunerpy/kiro-provider/main/scripts/install.sh | KIRO_PROVIDER_VERSION=0.
|
|
117
|
+
curl -fsSL https://raw.githubusercontent.com/sunerpy/kiro-provider/main/scripts/install.sh | KIRO_PROVIDER_VERSION=3.0.0 sh
|
|
139
118
|
```
|
|
140
119
|
|
|
141
120
|
```powershell
|
|
142
|
-
$env:KIRO_PROVIDER_VERSION = "0.
|
|
121
|
+
$env:KIRO_PROVIDER_VERSION = "3.0.0"; irm https://raw.githubusercontent.com/sunerpy/kiro-provider/main/scripts/install.ps1 | iex
|
|
143
122
|
```
|
|
144
123
|
|
|
145
124
|
### 3. From source (developers)
|
|
@@ -503,7 +482,7 @@ Config is loaded from `~/.config/kiro-provider/config.json` (or `$XDG_CONFIG_HOM
|
|
|
503
482
|
| `port` | `8787` | `KIRO_PROVIDER_PORT` |
|
|
504
483
|
| `api_keys` | required, non-empty | `KIRO_PROVIDER_API_KEYS` |
|
|
505
484
|
| `enable_legacy_chat_completions` | `false` | `KIRO_PROVIDER_ENABLE_LEGACY_CHAT_COMPLETIONS` |
|
|
506
|
-
| `protocol_projection_mode` | `
|
|
485
|
+
| `protocol_projection_mode` | `v3-auto` | `KIRO_PROVIDER_PROTOCOL_PROJECTION_MODE` |
|
|
507
486
|
| `session_affinity_mode` | `explicit-only` | `KIRO_PROVIDER_SESSION_AFFINITY_MODE` |
|
|
508
487
|
| `auth_source` | `local` | `KIRO_PROVIDER_AUTH_SOURCE` |
|
|
509
488
|
| `opencode_auth_db_path` | `null` (deprecated since 0.7.0, ignored) | `KIRO_PROVIDER_OPENCODE_AUTH_DB_PATH` |
|
|
@@ -560,14 +539,12 @@ Chat-Completions-only client (`@ai-sdk/openai-compatible`, older LangChain
|
|
|
560
539
|
adapters, or an OpenCode custom provider using that package) at
|
|
561
540
|
`POST /v1/chat/completions` after explicitly enabling the legacy endpoint.
|
|
562
541
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
protocol-faithful native instruction channel, or affected clients must migrate
|
|
570
|
-
away from instruction roles first.
|
|
542
|
+
The default `v3-auto` mode accepts standard instructions through KiroRuntime's
|
|
543
|
+
native Responses field. Requests that need custom grammar, namespace tools,
|
|
544
|
+
Codex collaboration items, encrypted reasoning replay, max effort, or
|
|
545
|
+
`store:false` automatically use the stateless compatibility lane. Unsupported
|
|
546
|
+
hosted capabilities fail with a field-level OpenAI error instead of being
|
|
547
|
+
silently ignored.
|
|
571
548
|
|
|
572
549
|
The default `session_affinity_mode: "explicit-only"` never hashes prompt text
|
|
573
550
|
to guess a conversation. Responses checks, in order,
|
|
@@ -584,9 +561,10 @@ socket behavior.
|
|
|
584
561
|
The temporary `legacy-initial-input` mode restores only the old affinity
|
|
585
562
|
heuristics and logs a startup warning; it does not alter request content.
|
|
586
563
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
564
|
+
`previous_response_id` is supported for tenant-local mirrored responses.
|
|
565
|
+
`conversation` objects remain unsupported. Retrieve, delete, input-items, and
|
|
566
|
+
cancel use the local mirror; deleting it does not prove deletion of Kiro's
|
|
567
|
+
upstream state.
|
|
590
568
|
|
|
591
569
|
<details>
|
|
592
570
|
<summary>Agent command reference</summary>
|