ns-omp-provider-kiro 0.1.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/LICENSE +22 -0
- package/README.md +45 -0
- package/dist/auth.d.ts +31 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4872 -0
- package/dist/messages.d.ts +10 -0
- package/dist/models.d.ts +20 -0
- package/dist/stream.d.ts +2 -0
- package/dist/usage.d.ts +11 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ngosangns
|
|
4
|
+
Copyright (c) 2025-2026 Mike O'Brien (pi-provider-kiro)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ns-omp-provider-kiro
|
|
2
|
+
|
|
3
|
+
Kiro (AWS CodeWhisperer/Q) models in [OMP](https://github.com/can1357/oh-my-pi).
|
|
4
|
+
|
|
5
|
+
Not on npm yet — install from a clone of
|
|
6
|
+
[ns-kiro-provider](https://github.com/ngosangns/ns-kiro-provider):
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pnpm install && pnpm -r build
|
|
10
|
+
omp plugin install ./packages/omp-provider-kiro
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Sign in once with kiro-cli — Builder ID, IAM Identity Center, Google, GitHub, or
|
|
14
|
+
enterprise OIDC all work, because kiro-cli does them:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
kiro-cli login
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Then, in OMP:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
/login kiro
|
|
24
|
+
/model
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`/login kiro` picks up the kiro-cli session and refreshes it when it expires,
|
|
28
|
+
writing the refresh back so both tools stay on the same token. With no session
|
|
29
|
+
on the machine it prompts for a Kiro API key (`ksk_…`) instead.
|
|
30
|
+
|
|
31
|
+
`/model` lists whatever your account's region actually serves: the catalog is
|
|
32
|
+
fetched from Kiro's management API and cached for an hour, so a model added
|
|
33
|
+
upstream shows up without a release here.
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- Reasoning effort maps onto Kiro's own ladder per model — `xhigh` and `max`
|
|
38
|
+
exist only where the model advertises them, and a request for more thinking
|
|
39
|
+
than a model offers is clamped rather than rejected.
|
|
40
|
+
- Usage (`/settings`) reports the account's Kiro credit balance.
|
|
41
|
+
- `KIRO_API_KEY` is read as a fallback when no session is stored.
|
|
42
|
+
- `KIRO_DEBUG=1` writes a full request/response trace to
|
|
43
|
+
`~/.ns-kiro-provider/logs/kiro-debug.log`, with credentials redacted.
|
|
44
|
+
|
|
45
|
+
Part of [ns-kiro-provider](https://github.com/ngosangns/ns-kiro-provider).
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai";
|
|
2
|
+
/**
|
|
3
|
+
* v0.1 establishes no browser flow of its own. Every interactive method Kiro
|
|
4
|
+
* supports already lands a session in the kiro-cli store or the Kiro IDE token
|
|
5
|
+
* file, so this reads one of those and refreshes it. The one credential with no
|
|
6
|
+
* browser step — an API key — is accepted directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare function loginKiro(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials>;
|
|
9
|
+
export declare function refreshKiroCredentials(credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
10
|
+
export declare function getKiroApiKey(credentials: OAuthCredentials): string;
|
|
11
|
+
/** The token, region, and profile one request runs on. */
|
|
12
|
+
export interface ResolvedKiroRequestCredentials {
|
|
13
|
+
accessToken: string;
|
|
14
|
+
region: string;
|
|
15
|
+
profileArn?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Decide which credential a request or catalog fetch runs on.
|
|
19
|
+
*
|
|
20
|
+
* The key OMP resolves for the provider is the session this package returned
|
|
21
|
+
* from `/login kiro` — but it is also `$KIRO_API_KEY` verbatim when that
|
|
22
|
+
* variable is unset, and Kiro answers a bogus bearer with a 403 the core then
|
|
23
|
+
* has to recover from. So a host key is trusted only when it is recognizably a
|
|
24
|
+
* Kiro credential; anything else defers to the store, which is where the
|
|
25
|
+
* session actually lives.
|
|
26
|
+
*
|
|
27
|
+
* The stored record also carries the region and the profile ARN, and passing
|
|
28
|
+
* the ARN skips the ListAvailableProfiles round trip that a social login cannot
|
|
29
|
+
* answer anyway.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveRequestCredentials(hostKey: string | undefined): Promise<ResolvedKiroRequestCredentials>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
|
|
2
|
+
export { toKiroMessages, toKiroTools } from "./messages.js";
|
|
3
|
+
export { toOmpModelConfig } from "./models.js";
|
|
4
|
+
export { streamKiroForOmp } from "./stream.js";
|
|
5
|
+
export { kiroUsageProvider, toUsageReport } from "./usage.js";
|
|
6
|
+
export default function (pi: ExtensionAPI): void;
|