@hilbras/omnihilbras 0.10.0 → 0.11.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/dist/adapters/cline.js +1 -1
- package/dist/adapters/kiro.d.ts +157 -0
- package/dist/adapters/kiro.d.ts.map +1 -0
- package/dist/adapters/kiro.js +511 -0
- package/dist/adapters/kiro.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/adapters/cline.js
CHANGED
|
@@ -35,7 +35,7 @@ export const CLINE_OAUTH = {
|
|
|
35
35
|
};
|
|
36
36
|
const defaultRefreshSkewMs = 60_000;
|
|
37
37
|
/** Reported to Cline as this client's version. */
|
|
38
|
-
const omnihilbrasVersion = '0.
|
|
38
|
+
const omnihilbrasVersion = '0.11.0';
|
|
39
39
|
/** Cline only accepts WorkOS JWTs with an explicit prefix. */
|
|
40
40
|
export function toClineAccessToken(token) {
|
|
41
41
|
const trimmed = token.trim();
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { HttpTransport } from '../transport.js';
|
|
2
|
+
import type { ChatChunk, ChatRequest, ChatResponse, CredentialValidation, FinishReason, Model, ProviderAdapter, ProviderCredential, ProviderRequestContext, TokenUsage } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Kiro.
|
|
5
|
+
*
|
|
6
|
+
* Kiro signs in through AWS SSO's OIDC device flow rather than a provider-specific one,
|
|
7
|
+
* and once signed in it is not an OpenAI-compatible endpoint at all: it is CodeWhisperer's
|
|
8
|
+
* streaming service, which takes a `conversationState` envelope and answers with an AWS
|
|
9
|
+
* eventstream. So there is no generic adapter to point at this, and the translation below
|
|
10
|
+
* is the whole integration.
|
|
11
|
+
*
|
|
12
|
+
* The auth half is a public OAuth client registered on demand, so nothing secret is
|
|
13
|
+
* embedded here — the same shape as the OpenCode Console device flow.
|
|
14
|
+
*/
|
|
15
|
+
export declare const KIRO: {
|
|
16
|
+
/** AWS SSO OIDC, where the device flow lives. */
|
|
17
|
+
readonly oidc: "https://oidc.us-east-1.amazonaws.com";
|
|
18
|
+
readonly clientName: "kiro-oauth-client";
|
|
19
|
+
readonly clientType: "public";
|
|
20
|
+
readonly scopes: readonly ["codewhisperer:completions", "codewhisperer:analysis", "codewhisperer:conversations"];
|
|
21
|
+
readonly grantTypes: readonly ["urn:ietf:params:oauth:grant-type:device_code", "refresh_token"];
|
|
22
|
+
readonly issuerUrl: "https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c";
|
|
23
|
+
/** Where the user approves the device. */
|
|
24
|
+
readonly startUrl: "https://view.awsapps.com/start";
|
|
25
|
+
/** CodeWhisperer's streaming service, which is what actually answers. */
|
|
26
|
+
readonly inferenceUrl: "https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse";
|
|
27
|
+
readonly streamingTarget: "AmazonCodeWhispererStreamingService.GenerateAssistantResponse";
|
|
28
|
+
readonly userAgent: "AWS-SDK-JS/3.0.0 kiro-ide/1.0.0";
|
|
29
|
+
readonly amzUserAgent: "aws-sdk-js/3.0.0 kiro-ide/1.0.0";
|
|
30
|
+
readonly eventStreamAccept: "application/vnd.amazon.eventstream";
|
|
31
|
+
};
|
|
32
|
+
export declare const kiroProviderId = "kiro";
|
|
33
|
+
/**
|
|
34
|
+
* Kiro's catalog. Ids must match its upstream exactly — an unknown id is refused with
|
|
35
|
+
* `400 Invalid model. Please select a different model`, and there is no wildcard or
|
|
36
|
+
* `auto` id to fall back on.
|
|
37
|
+
*/
|
|
38
|
+
export declare const KIRO_MODELS: ReadonlyArray<{
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
contextWindow?: number;
|
|
42
|
+
maxOutputTokens?: number;
|
|
43
|
+
}>;
|
|
44
|
+
export type KiroDeviceAuthorization = {
|
|
45
|
+
deviceCode: string;
|
|
46
|
+
userCode: string;
|
|
47
|
+
/** Absolute, because AWS returns this relative on some regions. */
|
|
48
|
+
verificationUrl: string;
|
|
49
|
+
intervalSeconds: number;
|
|
50
|
+
expiresIn?: number;
|
|
51
|
+
clientId: string;
|
|
52
|
+
clientSecret: string;
|
|
53
|
+
};
|
|
54
|
+
type Json = Record<string, unknown>;
|
|
55
|
+
/** Registers the public client the device flow needs. Nothing secret is embedded. */
|
|
56
|
+
export declare function registerKiroClient(): Promise<{
|
|
57
|
+
clientId: string;
|
|
58
|
+
clientSecret: string;
|
|
59
|
+
}>;
|
|
60
|
+
/** Asks AWS for a device code the user approves in a browser. */
|
|
61
|
+
export declare function beginKiroSignIn(): Promise<KiroDeviceAuthorization>;
|
|
62
|
+
export type KiroPoll = {
|
|
63
|
+
status: 'pending';
|
|
64
|
+
} | {
|
|
65
|
+
status: 'denied';
|
|
66
|
+
error: string;
|
|
67
|
+
} | {
|
|
68
|
+
status: 'connected';
|
|
69
|
+
accessToken: string;
|
|
70
|
+
refreshToken?: string;
|
|
71
|
+
expiresIn?: number;
|
|
72
|
+
profileArn?: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Polls for the token. A pending answer is HTTP 400 with `authorization_pending` in the
|
|
76
|
+
* body, so the status is read from the payload rather than treated as a failure.
|
|
77
|
+
*/
|
|
78
|
+
export declare function pollKiroSignIn(authorization: Pick<KiroDeviceAuthorization, 'deviceCode' | 'clientId' | 'clientSecret'>): Promise<KiroPoll>;
|
|
79
|
+
/** Renews the session. Kiro's refresh grant uses the same token endpoint. */
|
|
80
|
+
export declare function refreshKiroCredential(credential: ProviderCredential): Promise<ProviderCredential>;
|
|
81
|
+
/** True when the access token is within a minute of expiry. */
|
|
82
|
+
export declare function kiroCredentialExpired(credential: ProviderCredential | undefined, now?: number): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Builds the `conversationState` envelope.
|
|
85
|
+
*
|
|
86
|
+
* Kiro takes the whole turn history rather than a message list, the model id is
|
|
87
|
+
* addressed on the current message, and a system turn is folded into the user content
|
|
88
|
+
* rather than sent as its own role, because the envelope has no system role.
|
|
89
|
+
*/
|
|
90
|
+
export declare function toKiroBody(request: ChatRequest, conversationId: string): Json;
|
|
91
|
+
/**
|
|
92
|
+
* One decoded event from the stream.
|
|
93
|
+
*
|
|
94
|
+
* Kiro's eventstream arrives as `:event-type:` metadata lines and `data:` payloads, and
|
|
95
|
+
* the payload nests the useful body under a key named after the event. A bare `data:`
|
|
96
|
+
* with no event type is kept as text so a plain body is not silently dropped.
|
|
97
|
+
*/
|
|
98
|
+
export type KiroEvent = {
|
|
99
|
+
type: string;
|
|
100
|
+
text?: string;
|
|
101
|
+
reasoning?: string;
|
|
102
|
+
stopReason?: FinishReason;
|
|
103
|
+
usage?: TokenUsage;
|
|
104
|
+
};
|
|
105
|
+
/** Decodes one eventstream frame. Exported so the framing can be tested on its own. */
|
|
106
|
+
export declare function decodeKiroEvent(payload: string, eventType: string): KiroEvent;
|
|
107
|
+
/**
|
|
108
|
+
* Splits a raw eventstream body into events.
|
|
109
|
+
*
|
|
110
|
+
* The framing is line based: `:event-type: <name>` sets the type for the frames that
|
|
111
|
+
* follow, and each `data:` line is one JSON payload. A `data:` line with no preceding
|
|
112
|
+
* type still yields an event rather than being discarded.
|
|
113
|
+
*/
|
|
114
|
+
export declare function parseKiroEventStream(body: string): KiroEvent[];
|
|
115
|
+
declare function newConversationId(): string;
|
|
116
|
+
export type KiroAdapterOptions = {
|
|
117
|
+
transport?: HttpTransport;
|
|
118
|
+
onTokensRefreshed?: (credential: ProviderCredential) => void | Promise<void>;
|
|
119
|
+
now?: () => number;
|
|
120
|
+
};
|
|
121
|
+
export declare class KiroAdapter implements ProviderAdapter {
|
|
122
|
+
readonly id = "kiro";
|
|
123
|
+
readonly name = "Kiro";
|
|
124
|
+
readonly capabilities: {
|
|
125
|
+
readonly chat: true;
|
|
126
|
+
readonly streaming: false;
|
|
127
|
+
readonly models: true;
|
|
128
|
+
};
|
|
129
|
+
private readonly transport;
|
|
130
|
+
private readonly onTokensRefreshed?;
|
|
131
|
+
private readonly now;
|
|
132
|
+
private renewed;
|
|
133
|
+
constructor(options?: KiroAdapterOptions);
|
|
134
|
+
/**
|
|
135
|
+
* Kiro publishes no model list over the API, so the catalog is the known set. That is
|
|
136
|
+
* stated rather than implied: a model not in it is refused below instead of being sent
|
|
137
|
+
* and coming back as `400 Invalid model`.
|
|
138
|
+
*/
|
|
139
|
+
listModels(): Promise<Model[]>;
|
|
140
|
+
validateCredential(credential: ProviderCredential | undefined): Promise<CredentialValidation>;
|
|
141
|
+
chat(request: ChatRequest, context?: ProviderRequestContext): Promise<ChatResponse>;
|
|
142
|
+
/**
|
|
143
|
+
* Kiro only speaks the eventstream, so a non-streaming answer is assembled from it and
|
|
144
|
+
* yielded whole. Reporting that honestly beats implying a stream the provider does not
|
|
145
|
+
* have.
|
|
146
|
+
*/
|
|
147
|
+
streamChat(request: ChatRequest, context?: ProviderRequestContext): AsyncIterable<ChatChunk>;
|
|
148
|
+
healthCheck(context?: ProviderRequestContext): Promise<{
|
|
149
|
+
status: 'healthy' | 'degraded' | 'unavailable';
|
|
150
|
+
checkedAt: string;
|
|
151
|
+
message?: string;
|
|
152
|
+
}>;
|
|
153
|
+
/** Renews at expiry, memoised so one request never spends two refresh grants. */
|
|
154
|
+
private credential;
|
|
155
|
+
}
|
|
156
|
+
export { newConversationId };
|
|
157
|
+
//# sourceMappingURL=kiro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.d.ts","sourceRoot":"","sources":["../../src/adapters/kiro.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAkB,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5M;;;;;;;;;;;GAWG;A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C7B,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,YAAY;;;;MAA2D;IAEhF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAA2D;IAC9F,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,OAAO,CAAyC;gBAE5C,OAAO,GAAE,kBAAuB;IAM5C;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAS9B,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAU7F,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,YAAY,CAAC;IAwC7F;;;;OAIG;IACI,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,sBAA2B,GAAG,aAAa,CAAC,SAAS,CAAC;IAYjG,WAAW,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAazJ,iFAAiF;YACnE,UAAU;CAYzB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { ProviderError } from '../errors.js';
|
|
2
|
+
import { FetchHttpTransport } from '../transport.js';
|
|
3
|
+
/**
|
|
4
|
+
* Kiro.
|
|
5
|
+
*
|
|
6
|
+
* Kiro signs in through AWS SSO's OIDC device flow rather than a provider-specific one,
|
|
7
|
+
* and once signed in it is not an OpenAI-compatible endpoint at all: it is CodeWhisperer's
|
|
8
|
+
* streaming service, which takes a `conversationState` envelope and answers with an AWS
|
|
9
|
+
* eventstream. So there is no generic adapter to point at this, and the translation below
|
|
10
|
+
* is the whole integration.
|
|
11
|
+
*
|
|
12
|
+
* The auth half is a public OAuth client registered on demand, so nothing secret is
|
|
13
|
+
* embedded here — the same shape as the OpenCode Console device flow.
|
|
14
|
+
*/
|
|
15
|
+
export const KIRO = {
|
|
16
|
+
/** AWS SSO OIDC, where the device flow lives. */
|
|
17
|
+
oidc: 'https://oidc.us-east-1.amazonaws.com',
|
|
18
|
+
clientName: 'kiro-oauth-client',
|
|
19
|
+
clientType: 'public',
|
|
20
|
+
scopes: ['codewhisperer:completions', 'codewhisperer:analysis', 'codewhisperer:conversations'],
|
|
21
|
+
grantTypes: ['urn:ietf:params:oauth:grant-type:device_code', 'refresh_token'],
|
|
22
|
+
issuerUrl: 'https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c',
|
|
23
|
+
/** Where the user approves the device. */
|
|
24
|
+
startUrl: 'https://view.awsapps.com/start',
|
|
25
|
+
/** CodeWhisperer's streaming service, which is what actually answers. */
|
|
26
|
+
inferenceUrl: 'https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse',
|
|
27
|
+
streamingTarget: 'AmazonCodeWhispererStreamingService.GenerateAssistantResponse',
|
|
28
|
+
userAgent: 'AWS-SDK-JS/3.0.0 kiro-ide/1.0.0',
|
|
29
|
+
amzUserAgent: 'aws-sdk-js/3.0.0 kiro-ide/1.0.0',
|
|
30
|
+
eventStreamAccept: 'application/vnd.amazon.eventstream',
|
|
31
|
+
};
|
|
32
|
+
export const kiroProviderId = 'kiro';
|
|
33
|
+
/**
|
|
34
|
+
* Kiro's catalog. Ids must match its upstream exactly — an unknown id is refused with
|
|
35
|
+
* `400 Invalid model. Please select a different model`, and there is no wildcard or
|
|
36
|
+
* `auto` id to fall back on.
|
|
37
|
+
*/
|
|
38
|
+
export const KIRO_MODELS = [
|
|
39
|
+
{ id: 'claude-sonnet-5', name: 'Claude Sonnet 5', contextWindow: 1_000_000, maxOutputTokens: 128_000 },
|
|
40
|
+
{ id: 'claude-sonnet-4.5', name: 'Claude Sonnet 4.5', contextWindow: 200_000, maxOutputTokens: 64_000 },
|
|
41
|
+
{ id: 'claude-haiku-4.5', name: 'Claude Haiku 4.5', contextWindow: 200_000, maxOutputTokens: 64_000 },
|
|
42
|
+
{ id: 'gpt-5.6-sol', name: 'GPT-5.6 Sol', contextWindow: 272_000, maxOutputTokens: 128_000 },
|
|
43
|
+
{ id: 'gpt-5.6-terra', name: 'GPT-5.6 Terra', contextWindow: 272_000, maxOutputTokens: 128_000 },
|
|
44
|
+
{ id: 'gpt-5.6-luna', name: 'GPT-5.6 Luna', contextWindow: 272_000, maxOutputTokens: 128_000 },
|
|
45
|
+
{ id: 'deepseek-3.2', name: 'DeepSeek V3.2' },
|
|
46
|
+
{ id: 'minimax-m2.5', name: 'MiniMax M2.5' },
|
|
47
|
+
{ id: 'minimax-m2.1', name: 'MiniMax M2.1' },
|
|
48
|
+
{ id: 'glm-5', name: 'GLM-5' },
|
|
49
|
+
{ id: 'qwen3-coder-next', name: 'Qwen3 Coder Next' },
|
|
50
|
+
];
|
|
51
|
+
/**
|
|
52
|
+
* OAuth token endpoints are read directly rather than through the provider transport.
|
|
53
|
+
*
|
|
54
|
+
* The transport deliberately flattens an error body into a human sentence, and for a
|
|
55
|
+
* device grant the machine token *is* the state: AWS answers a pending poll with
|
|
56
|
+
* `400 {"error":"authorization_pending","error_description":"Authorization is still
|
|
57
|
+
* pending"}`, and the flattened detail keeps only the description, so the grant reads as
|
|
58
|
+
* a failure. Inference still goes through the transport, where that flattening is what we
|
|
59
|
+
* want.
|
|
60
|
+
*/
|
|
61
|
+
async function postAuthJson(url, body) {
|
|
62
|
+
const response = await fetch(url, {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
65
|
+
body: JSON.stringify(body),
|
|
66
|
+
});
|
|
67
|
+
const text = await response.text();
|
|
68
|
+
let data;
|
|
69
|
+
try {
|
|
70
|
+
data = (text ? JSON.parse(text) : {});
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
data = { error: 'invalid_response', error_description: text.slice(0, 200) };
|
|
74
|
+
}
|
|
75
|
+
return { status: response.status, data };
|
|
76
|
+
}
|
|
77
|
+
/** Registers the public client the device flow needs. Nothing secret is embedded. */
|
|
78
|
+
export async function registerKiroClient() {
|
|
79
|
+
const { data } = await postAuthJson(`${KIRO.oidc}/client/register`, {
|
|
80
|
+
clientName: KIRO.clientName,
|
|
81
|
+
clientType: KIRO.clientType,
|
|
82
|
+
scopes: [...KIRO.scopes],
|
|
83
|
+
grantTypes: [...KIRO.grantTypes],
|
|
84
|
+
issuerUrl: KIRO.issuerUrl,
|
|
85
|
+
});
|
|
86
|
+
const clientId = typeof data.clientId === 'string' ? data.clientId : '';
|
|
87
|
+
const clientSecret = typeof data.clientSecret === 'string' ? data.clientSecret : '';
|
|
88
|
+
if (!clientId || !clientSecret) {
|
|
89
|
+
throw new ProviderError('AUTHENTICATION_FAILED', 'AWS did not return a client registration for Kiro.', {
|
|
90
|
+
providerId: kiroProviderId,
|
|
91
|
+
publicMessage: 'AWS did not return a client registration for Kiro. Try again in a moment.',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return { clientId, clientSecret };
|
|
95
|
+
}
|
|
96
|
+
/** Asks AWS for a device code the user approves in a browser. */
|
|
97
|
+
export async function beginKiroSignIn() {
|
|
98
|
+
const { clientId, clientSecret } = await registerKiroClient();
|
|
99
|
+
// AWS refuses the request without the start URL, answering
|
|
100
|
+
// `400 Start URL is required`, so it is part of the grant rather than a preference.
|
|
101
|
+
const { data } = await postAuthJson(`${KIRO.oidc}/device_authorization`, { clientId, clientSecret, startUrl: KIRO.startUrl });
|
|
102
|
+
const deviceCode = typeof data.deviceCode === 'string' ? data.deviceCode : '';
|
|
103
|
+
const userCode = typeof data.userCode === 'string' ? data.userCode : '';
|
|
104
|
+
if (!deviceCode || !userCode) {
|
|
105
|
+
throw new ProviderError('AUTHENTICATION_FAILED', 'AWS did not return a Kiro device code.', {
|
|
106
|
+
providerId: kiroProviderId,
|
|
107
|
+
publicMessage: 'AWS did not return a Kiro device code. Try again in a moment.',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
const verificationUri = typeof data.verificationUri === 'string' ? data.verificationUri : KIRO.startUrl;
|
|
111
|
+
return {
|
|
112
|
+
deviceCode,
|
|
113
|
+
userCode,
|
|
114
|
+
// AWS returns this relative on some regions, so it is joined rather than shown bare.
|
|
115
|
+
verificationUrl: verificationUri.startsWith('http') ? verificationUri : `https://view.awsapps.com${verificationUri.startsWith('/') ? '' : '/'}${verificationUri}`,
|
|
116
|
+
intervalSeconds: typeof data.interval === 'number' ? data.interval : 5,
|
|
117
|
+
clientId,
|
|
118
|
+
clientSecret,
|
|
119
|
+
...(typeof data.expiresIn === 'number' ? { expiresIn: data.expiresIn } : {}),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Polls for the token. A pending answer is HTTP 400 with `authorization_pending` in the
|
|
124
|
+
* body, so the status is read from the payload rather than treated as a failure.
|
|
125
|
+
*/
|
|
126
|
+
export async function pollKiroSignIn(authorization) {
|
|
127
|
+
const { data } = await postAuthJson(`${KIRO.oidc}/token`, {
|
|
128
|
+
grantType: 'urn:ietf:params:oauth:grant-type:device_code',
|
|
129
|
+
deviceCode: authorization.deviceCode,
|
|
130
|
+
clientId: authorization.clientId,
|
|
131
|
+
clientSecret: authorization.clientSecret,
|
|
132
|
+
});
|
|
133
|
+
// A pending grant is HTTP 400 with the state in the body, so the body decides.
|
|
134
|
+
const error = typeof data.error === 'string' ? data.error : '';
|
|
135
|
+
if (error === 'authorization_pending' || error === 'slow_down')
|
|
136
|
+
return { status: 'pending' };
|
|
137
|
+
if (error) {
|
|
138
|
+
const description = typeof data.error_description === 'string' ? data.error_description : '';
|
|
139
|
+
return { status: 'denied', error: description || `AWS reported ${error.replace(/[^A-Za-z0-9_.-]/g, '').slice(0, 40)}.` };
|
|
140
|
+
}
|
|
141
|
+
const accessToken = typeof data.accessToken === 'string' ? data.accessToken : '';
|
|
142
|
+
if (!accessToken) {
|
|
143
|
+
return { status: 'denied', error: 'AWS returned a Kiro session with no access token. Start again.' };
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
status: 'connected',
|
|
147
|
+
accessToken,
|
|
148
|
+
...(typeof data.refreshToken === 'string' ? { refreshToken: data.refreshToken } : {}),
|
|
149
|
+
...(typeof data.expiresIn === 'number' ? { expiresIn: data.expiresIn } : {}),
|
|
150
|
+
...(typeof data.profileArn === 'string' && data.profileArn ? { profileArn: data.profileArn } : {}),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/** Renews the session. Kiro's refresh grant uses the same token endpoint. */
|
|
154
|
+
export async function refreshKiroCredential(credential) {
|
|
155
|
+
if (credential.type !== 'oauth' || !credential.refreshToken) {
|
|
156
|
+
throw new ProviderError('AUTHENTICATION_FAILED', 'This Kiro session cannot be renewed. Sign in again.', {
|
|
157
|
+
providerId: kiroProviderId,
|
|
158
|
+
publicMessage: 'This Kiro session cannot be renewed. Sign in again.',
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const { data } = await postAuthJson(`${KIRO.oidc}/token`, {
|
|
162
|
+
grantType: 'refresh_token',
|
|
163
|
+
refreshToken: credential.refreshToken,
|
|
164
|
+
clientId: credential.accountId ?? KIRO.clientName,
|
|
165
|
+
clientSecret: KIRO.clientName,
|
|
166
|
+
});
|
|
167
|
+
const accessToken = typeof data.accessToken === 'string' ? data.accessToken : '';
|
|
168
|
+
if (!accessToken) {
|
|
169
|
+
throw new ProviderError('AUTHENTICATION_FAILED', 'AWS did not renew the Kiro session. Sign in again.', {
|
|
170
|
+
providerId: kiroProviderId,
|
|
171
|
+
publicMessage: 'AWS did not renew the Kiro session. Sign in again.',
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const expiresIn = typeof data.expiresIn === 'number' ? data.expiresIn : undefined;
|
|
175
|
+
return {
|
|
176
|
+
type: 'oauth',
|
|
177
|
+
value: accessToken,
|
|
178
|
+
...(typeof data.refreshToken === 'string' ? { refreshToken: data.refreshToken } : { refreshToken: credential.refreshToken }),
|
|
179
|
+
...(expiresIn === undefined ? {} : { expiresAt: new Date(Date.now() + expiresIn * 1000).toISOString() }),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/** True when the access token is within a minute of expiry. */
|
|
183
|
+
export function kiroCredentialExpired(credential, now = Date.now()) {
|
|
184
|
+
if (credential?.type !== 'oauth' || !credential.expiresAt)
|
|
185
|
+
return false;
|
|
186
|
+
const expiry = Date.parse(credential.expiresAt);
|
|
187
|
+
return Number.isFinite(expiry) && expiry - 60_000 <= now;
|
|
188
|
+
}
|
|
189
|
+
/* ------------------------------------------------------------------ *
|
|
190
|
+
* Inference
|
|
191
|
+
* ------------------------------------------------------------------ */
|
|
192
|
+
/**
|
|
193
|
+
* Message content is either a string or a list of parts, and Kiro's envelope takes plain
|
|
194
|
+
* text, so both are flattened to text rather than one being dropped.
|
|
195
|
+
*/
|
|
196
|
+
function messageText(content) {
|
|
197
|
+
if (typeof content === 'string')
|
|
198
|
+
return content;
|
|
199
|
+
if (!Array.isArray(content))
|
|
200
|
+
return '';
|
|
201
|
+
return content
|
|
202
|
+
.map((part) => {
|
|
203
|
+
if (typeof part === 'string')
|
|
204
|
+
return part;
|
|
205
|
+
if (part && typeof part === 'object' && 'text' in part && typeof part.text === 'string')
|
|
206
|
+
return part.text;
|
|
207
|
+
return '';
|
|
208
|
+
})
|
|
209
|
+
.join('');
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Builds the `conversationState` envelope.
|
|
213
|
+
*
|
|
214
|
+
* Kiro takes the whole turn history rather than a message list, the model id is
|
|
215
|
+
* addressed on the current message, and a system turn is folded into the user content
|
|
216
|
+
* rather than sent as its own role, because the envelope has no system role.
|
|
217
|
+
*/
|
|
218
|
+
export function toKiroBody(request, conversationId) {
|
|
219
|
+
const system = request.messages.filter((message) => message.role === 'system').map((message) => messageText(message.content)).filter(Boolean);
|
|
220
|
+
const turns = request.messages.filter((message) => message.role !== 'system');
|
|
221
|
+
const current = turns[turns.length - 1];
|
|
222
|
+
const history = turns.slice(0, -1).map((message) => ({
|
|
223
|
+
[message.role === 'assistant' ? 'assistantResponseMessage' : 'userInputMessage']: {
|
|
224
|
+
content: messageText(message.content),
|
|
225
|
+
...(message.role === 'assistant' ? { modelId: request.model } : { modelId: request.model, origin: 'AI_EDITOR' }),
|
|
226
|
+
},
|
|
227
|
+
}));
|
|
228
|
+
const content = [system.length ? system.join('\n\n') : '', messageText(current?.content ?? '')].filter(Boolean).join('\n\n');
|
|
229
|
+
return {
|
|
230
|
+
conversationState: {
|
|
231
|
+
chatTriggerType: 'MANUAL',
|
|
232
|
+
conversationId,
|
|
233
|
+
currentMessage: {
|
|
234
|
+
userInputMessage: {
|
|
235
|
+
content,
|
|
236
|
+
modelId: request.model,
|
|
237
|
+
origin: 'AI_EDITOR',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
history,
|
|
241
|
+
},
|
|
242
|
+
...(request.maxOutputTokens === undefined ? {} : { inferenceConfig: { maxTokens: request.maxOutputTokens } }),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function kiroHeaders(credential) {
|
|
246
|
+
// `value` exists on every variant except `none`, which never reaches a request.
|
|
247
|
+
const token = credential.type === 'none' ? '' : credential.value;
|
|
248
|
+
return {
|
|
249
|
+
'content-type': 'application/json',
|
|
250
|
+
accept: KIRO.eventStreamAccept,
|
|
251
|
+
'X-Amz-Target': KIRO.streamingTarget,
|
|
252
|
+
'User-Agent': KIRO.userAgent,
|
|
253
|
+
'X-Amz-User-Agent': KIRO.amzUserAgent,
|
|
254
|
+
Authorization: `Bearer ${token}`,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/** Event names Kiro nests its payload under, longest first so `x` never shadows `xY`. */
|
|
258
|
+
const kiroEventKeys = [
|
|
259
|
+
'assistantResponseEvent',
|
|
260
|
+
'reasoningContentEvent',
|
|
261
|
+
'messageStopEvent',
|
|
262
|
+
'usageEvent',
|
|
263
|
+
'toolUseEvent',
|
|
264
|
+
'codeEvent',
|
|
265
|
+
'supplementaryWebLinksEvent',
|
|
266
|
+
];
|
|
267
|
+
function isRecord(value) {
|
|
268
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
269
|
+
}
|
|
270
|
+
function readString(source, keys) {
|
|
271
|
+
for (const key of keys) {
|
|
272
|
+
const value = source[key];
|
|
273
|
+
if (typeof value === 'string' && value)
|
|
274
|
+
return value;
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
/** Decodes one eventstream frame. Exported so the framing can be tested on its own. */
|
|
279
|
+
export function decodeKiroEvent(payload, eventType) {
|
|
280
|
+
let data;
|
|
281
|
+
try {
|
|
282
|
+
const parsed = JSON.parse(payload);
|
|
283
|
+
data = (typeof parsed === 'object' && parsed !== null ? parsed : { text: String(parsed) });
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
return eventType ? { type: eventType, text: payload } : { type: 'unknown', text: payload };
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* The type comes from the framing when there is one, and otherwise from a key the
|
|
290
|
+
* payload nests its body under. Inferring it matters: a response with no
|
|
291
|
+
* `:event-type:` line at all would otherwise decode to an unknown event and read as an
|
|
292
|
+
* empty answer rather than as a framing change.
|
|
293
|
+
*/
|
|
294
|
+
const type = eventType ||
|
|
295
|
+
readString(data, ['_eventType', 'event', 'eventType']) ||
|
|
296
|
+
kiroEventKeys.find((key) => isRecord(data[key])) ||
|
|
297
|
+
'unknown';
|
|
298
|
+
if (type === 'assistantResponseEvent') {
|
|
299
|
+
const nested = (data.assistantResponseEvent ?? data);
|
|
300
|
+
const text = readString(nested, ['content', 'text']);
|
|
301
|
+
return text === undefined ? { type } : { type, text };
|
|
302
|
+
}
|
|
303
|
+
if (type === 'reasoningContentEvent') {
|
|
304
|
+
const nested = (data.reasoningContentEvent ?? data);
|
|
305
|
+
const reasoning = readString(nested, ['content', 'text', 'reasoning']);
|
|
306
|
+
return reasoning === undefined ? { type } : { type, reasoning };
|
|
307
|
+
}
|
|
308
|
+
if (type === 'messageStopEvent' || type === 'done') {
|
|
309
|
+
const nested = (data.messageStopEvent ?? data);
|
|
310
|
+
const reason = readString(nested, ['stopReason', 'stop_reason']);
|
|
311
|
+
return { type, ...(reason ? { stopReason: kiroStopReason(reason) } : {}) };
|
|
312
|
+
}
|
|
313
|
+
if (type === 'usageEvent') {
|
|
314
|
+
const nested = (data.usageEvent ?? data);
|
|
315
|
+
const input = nested.inputTokens ?? nested.input_tokens;
|
|
316
|
+
const output = nested.outputTokens ?? nested.output_tokens;
|
|
317
|
+
const total = nested.totalTokens ?? nested.total_tokens;
|
|
318
|
+
return {
|
|
319
|
+
type,
|
|
320
|
+
usage: {
|
|
321
|
+
...(typeof input === 'number' ? { inputTokens: input } : {}),
|
|
322
|
+
...(typeof output === 'number' ? { outputTokens: output } : {}),
|
|
323
|
+
...(typeof total === 'number' ? { totalTokens: total } : {}),
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
// `toolUseEvent` and the rest carry no text this adapter can use, and dropping them
|
|
328
|
+
// silently would be indistinguishable from a truncated answer.
|
|
329
|
+
return { type };
|
|
330
|
+
}
|
|
331
|
+
function kiroStopReason(reason) {
|
|
332
|
+
if (reason === 'max_tokens' || reason === 'MAX_TOKENS')
|
|
333
|
+
return 'length';
|
|
334
|
+
if (reason === 'tool_use' || reason === 'TOOL_USE')
|
|
335
|
+
return 'tool_calls';
|
|
336
|
+
return 'stop';
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Splits a raw eventstream body into events.
|
|
340
|
+
*
|
|
341
|
+
* The framing is line based: `:event-type: <name>` sets the type for the frames that
|
|
342
|
+
* follow, and each `data:` line is one JSON payload. A `data:` line with no preceding
|
|
343
|
+
* type still yields an event rather than being discarded.
|
|
344
|
+
*/
|
|
345
|
+
export function parseKiroEventStream(body) {
|
|
346
|
+
const events = [];
|
|
347
|
+
let eventType = '';
|
|
348
|
+
for (const line of body.split(/\r?\n/)) {
|
|
349
|
+
if (line.startsWith(':event-type:')) {
|
|
350
|
+
eventType = line.slice(':event-type:'.length).trim();
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (line.startsWith('data:')) {
|
|
354
|
+
const payload = line.slice('data:'.length).trim();
|
|
355
|
+
if (payload)
|
|
356
|
+
events.push(decodeKiroEvent(payload, eventType));
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (!line.startsWith(':') && line.trim() && !eventType) {
|
|
360
|
+
// Some responses are a bare JSON body with no framing at all.
|
|
361
|
+
const trimmed = line.trim();
|
|
362
|
+
if (trimmed.startsWith('{'))
|
|
363
|
+
events.push(decodeKiroEvent(trimmed, ''));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return events;
|
|
367
|
+
}
|
|
368
|
+
/** The last event carrying a value of this kind, without needing ES2023's `findLast`. */
|
|
369
|
+
function lastOf(events, pick) {
|
|
370
|
+
for (let index = events.length - 1; index >= 0; index--) {
|
|
371
|
+
const event = events[index];
|
|
372
|
+
if (event === undefined)
|
|
373
|
+
continue;
|
|
374
|
+
const value = pick(event);
|
|
375
|
+
if (value !== undefined)
|
|
376
|
+
return value;
|
|
377
|
+
}
|
|
378
|
+
return undefined;
|
|
379
|
+
}
|
|
380
|
+
function newConversationId() {
|
|
381
|
+
return globalThis.crypto.randomUUID();
|
|
382
|
+
}
|
|
383
|
+
function conversationIdFor(request) {
|
|
384
|
+
// Deterministic per request, so a retried request stays in one conversation.
|
|
385
|
+
let hash = 0;
|
|
386
|
+
for (const character of `${request.model}:${request.messages.map((m) => `${m.role}:${messageText(m.content)}`).join('|')}`) {
|
|
387
|
+
hash = (hash * 31 + character.charCodeAt(0)) | 0;
|
|
388
|
+
}
|
|
389
|
+
return `omnihilbras-${(hash >>> 0).toString(16)}`;
|
|
390
|
+
}
|
|
391
|
+
export class KiroAdapter {
|
|
392
|
+
id = kiroProviderId;
|
|
393
|
+
name = 'Kiro';
|
|
394
|
+
capabilities = { chat: true, streaming: false, models: true };
|
|
395
|
+
transport;
|
|
396
|
+
onTokensRefreshed;
|
|
397
|
+
now;
|
|
398
|
+
renewed = new Map();
|
|
399
|
+
constructor(options = {}) {
|
|
400
|
+
this.transport = options.transport ?? new FetchHttpTransport();
|
|
401
|
+
this.onTokensRefreshed = options.onTokensRefreshed;
|
|
402
|
+
this.now = options.now ?? (() => Date.now());
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Kiro publishes no model list over the API, so the catalog is the known set. That is
|
|
406
|
+
* stated rather than implied: a model not in it is refused below instead of being sent
|
|
407
|
+
* and coming back as `400 Invalid model`.
|
|
408
|
+
*/
|
|
409
|
+
async listModels() {
|
|
410
|
+
return KIRO_MODELS.map((model) => ({
|
|
411
|
+
id: model.id,
|
|
412
|
+
providerId: this.id,
|
|
413
|
+
displayName: model.name,
|
|
414
|
+
...(model.contextWindow ? { contextWindow: model.contextWindow } : {}),
|
|
415
|
+
}));
|
|
416
|
+
}
|
|
417
|
+
async validateCredential(credential) {
|
|
418
|
+
if (credential?.type !== 'oauth' || !credential.value) {
|
|
419
|
+
throw new ProviderError('AUTHENTICATION_FAILED', 'Sign in to Kiro to use this provider.', {
|
|
420
|
+
providerId: this.id,
|
|
421
|
+
publicMessage: 'Sign in to Kiro to use this provider.',
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
return { status: 'valid', checkedAt: new Date().toISOString() };
|
|
425
|
+
}
|
|
426
|
+
async chat(request, context = {}) {
|
|
427
|
+
const credential = await this.credential(context);
|
|
428
|
+
const model = KIRO_MODELS.find((entry) => entry.id === request.model);
|
|
429
|
+
if (!model) {
|
|
430
|
+
throw new ProviderError('NOT_SUPPORTED', `Kiro does not offer a model called ${request.model}.`, {
|
|
431
|
+
providerId: this.id,
|
|
432
|
+
publicMessage: `Kiro does not offer a model called ${request.model}. Sign in to refresh the catalog.`,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
const response = await this.transport.request({
|
|
436
|
+
method: 'POST',
|
|
437
|
+
providerId: this.id,
|
|
438
|
+
url: KIRO.inferenceUrl,
|
|
439
|
+
headers: kiroHeaders(credential),
|
|
440
|
+
body: JSON.stringify(toKiroBody(request, conversationIdFor(request))),
|
|
441
|
+
...(context.signal ? { signal: context.signal } : {}),
|
|
442
|
+
});
|
|
443
|
+
const body = typeof response.data === 'string' ? response.data : JSON.stringify(response.data ?? '');
|
|
444
|
+
const events = parseKiroEventStream(body);
|
|
445
|
+
const text = events.map((event) => event.text ?? '').join('');
|
|
446
|
+
const reasoning = events.map((event) => event.reasoning ?? '').join('');
|
|
447
|
+
const stopReason = lastOf(events, (event) => event.stopReason) ?? 'stop';
|
|
448
|
+
const usage = lastOf(events, (event) => event.usage);
|
|
449
|
+
if (!text && !reasoning) {
|
|
450
|
+
throw new ProviderError('INVALID_RESPONSE', 'Kiro returned no answer text.', {
|
|
451
|
+
providerId: this.id,
|
|
452
|
+
publicMessage: 'Kiro returned no answer text.',
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
return {
|
|
456
|
+
id: `kiro-${conversationIdFor(request)}`,
|
|
457
|
+
providerId: this.id,
|
|
458
|
+
model: request.model,
|
|
459
|
+
createdAt: new Date().toISOString(),
|
|
460
|
+
message: { role: 'assistant', content: text },
|
|
461
|
+
finishReason: stopReason,
|
|
462
|
+
...(usage ? { usage } : {}),
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Kiro only speaks the eventstream, so a non-streaming answer is assembled from it and
|
|
467
|
+
* yielded whole. Reporting that honestly beats implying a stream the provider does not
|
|
468
|
+
* have.
|
|
469
|
+
*/
|
|
470
|
+
async *streamChat(request, context = {}) {
|
|
471
|
+
const response = await this.chat(request, context);
|
|
472
|
+
yield {
|
|
473
|
+
id: response.id,
|
|
474
|
+
providerId: response.providerId,
|
|
475
|
+
model: response.model,
|
|
476
|
+
delta: { role: 'assistant', content: messageText(response.message.content) },
|
|
477
|
+
finishReason: response.finishReason,
|
|
478
|
+
...(response.usage ? { usage: response.usage } : {}),
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
async healthCheck(context = {}) {
|
|
482
|
+
try {
|
|
483
|
+
await this.validateCredential(context.credential);
|
|
484
|
+
return { status: 'healthy', checkedAt: new Date().toISOString() };
|
|
485
|
+
}
|
|
486
|
+
catch (error) {
|
|
487
|
+
return {
|
|
488
|
+
status: 'unavailable',
|
|
489
|
+
checkedAt: new Date().toISOString(),
|
|
490
|
+
message: error instanceof Error ? error.message : 'The Kiro session could not be checked.',
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/** Renews at expiry, memoised so one request never spends two refresh grants. */
|
|
495
|
+
async credential(context) {
|
|
496
|
+
const current = context.credential;
|
|
497
|
+
if (!kiroCredentialExpired(current, this.now()))
|
|
498
|
+
return current;
|
|
499
|
+
// Only an OAuth credential can be expired, so the variant is known here.
|
|
500
|
+
const stale = current.value;
|
|
501
|
+
const memo = this.renewed.get(stale);
|
|
502
|
+
if (memo)
|
|
503
|
+
return memo;
|
|
504
|
+
const renewed = await refreshKiroCredential(current);
|
|
505
|
+
this.renewed.set(stale, renewed);
|
|
506
|
+
await this.onTokensRefreshed?.(renewed);
|
|
507
|
+
return renewed;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
export { newConversationId };
|
|
511
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../src/adapters/kiro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;A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Root":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hilbras/omnihilbras",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Typed provider SDK for the OmniHilbras gateway: normalized chat, streaming, model listing, and capability contracts for OpenAI, Anthropic, Gemini, and OpenAI-compatible providers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hilbras",
|