@gajae-code/ai 0.15.4 → 0.15.6
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/CHANGELOG.md +27 -1
- package/dist/types/auth-broker/client.d.ts +6 -2
- package/dist/types/auth-broker/remote-store.d.ts +14 -2
- package/dist/types/auth-broker/types.d.ts +6 -0
- package/dist/types/auth-broker/wire-schemas.d.ts +19 -0
- package/dist/types/auth-gateway/server.d.ts +39 -5
- package/dist/types/auth-gateway/types.d.ts +16 -2
- package/dist/types/auth-storage.d.ts +116 -34
- package/dist/types/provider-models/openai-compat.d.ts +1 -0
- package/dist/types/provider-models/special.d.ts +2 -1
- package/dist/types/providers/kiro-api-key.d.ts +50 -0
- package/dist/types/providers/kiro-codewhisperer.d.ts +3 -0
- package/dist/types/providers/register-builtins.d.ts +12 -12
- package/dist/types/stream.d.ts +2 -1
- package/dist/types/types.d.ts +35 -24
- package/dist/types/utils/fallback-transport.d.ts +7 -0
- package/dist/types/utils/json-parse.d.ts +5 -3
- package/dist/types/utils/oauth/api-key-login.d.ts +4 -1
- package/dist/types/utils/oauth/api-key-validation.d.ts +12 -6
- package/dist/types/utils/oauth/commandcode.d.ts +1 -0
- package/dist/types/utils/oauth/types.d.ts +1 -1
- package/dist/types/utils/retry.d.ts +2 -0
- package/dist/types/utils/tool-call-healing.d.ts +4 -4
- package/package.json +3 -3
- package/src/auth-broker/client.ts +41 -13
- package/src/auth-broker/redact.ts +25 -1
- package/src/auth-broker/remote-store.ts +374 -115
- package/src/auth-broker/server.ts +131 -91
- package/src/auth-broker/types.ts +6 -0
- package/src/auth-broker/wire-schemas.ts +6 -0
- package/src/auth-gateway/server.ts +447 -79
- package/src/auth-gateway/types.ts +28 -2
- package/src/auth-storage.ts +742 -157
- package/src/cli.ts +1 -0
- package/src/model-thinking.ts +16 -0
- package/src/models.json +1054 -0
- package/src/models.ts +9 -1
- package/src/provider-models/descriptors.ts +3 -1
- package/src/provider-models/openai-compat.ts +41 -1
- package/src/provider-models/special.ts +15 -3
- package/src/providers/anthropic.ts +7 -1
- package/src/providers/azure-openai-responses.ts +4 -1
- package/src/providers/cursor.ts +256 -101
- package/src/providers/gitlab-duo.ts +18 -1
- package/src/providers/google-gemini-cli.ts +3 -0
- package/src/providers/google-shared.ts +3 -0
- package/src/providers/kiro-api-key.d.ts +50 -0
- package/src/providers/kiro-api-key.ts +786 -0
- package/src/providers/kiro-codewhisperer.d.ts +3 -0
- package/src/providers/kiro-codewhisperer.ts +34 -9
- package/src/providers/ollama.ts +3 -0
- package/src/providers/openai-codex-responses.ts +24 -6
- package/src/providers/openai-completions.ts +11 -1
- package/src/providers/openai-responses-shared.ts +23 -2
- package/src/providers/openai-responses.ts +10 -1
- package/src/providers/pi-native-client.ts +1 -0
- package/src/providers/pi-native-server.ts +24 -0
- package/src/providers/register-builtins.d.ts +12 -12
- package/src/providers/register-builtins.ts +16 -3
- package/src/stream.d.ts +2 -1
- package/src/stream.ts +180 -70
- package/src/types.d.ts +35 -24
- package/src/types.ts +40 -23
- package/src/utils/fallback-transport.d.ts +7 -0
- package/src/utils/fallback-transport.ts +21 -4
- package/src/utils/json-parse.d.ts +5 -3
- package/src/utils/json-parse.ts +6 -6
- package/src/utils/oauth/api-key-login.ts +13 -2
- package/src/utils/oauth/api-key-validation.ts +242 -41
- package/src/utils/oauth/commandcode.ts +17 -0
- package/src/utils/oauth/index.ts +20 -5
- package/src/utils/oauth/types.d.ts +1 -1
- package/src/utils/oauth/types.ts +1 -0
- package/src/utils/retry.d.ts +2 -0
- package/src/utils/retry.ts +15 -2
- package/src/utils/tool-call-healing.d.ts +4 -4
- package/src/utils/tool-call-healing.ts +4 -4
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { Effort } from "../model-thinking";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
Api,
|
|
4
|
+
AssistantMessage,
|
|
5
|
+
AssistantMessageEventStream,
|
|
6
|
+
CacheRetention,
|
|
7
|
+
Context,
|
|
8
|
+
Provider,
|
|
9
|
+
ServiceTier,
|
|
10
|
+
} from "../types";
|
|
3
11
|
|
|
4
12
|
/**
|
|
5
13
|
* Wire types for the gjc auth-gateway.
|
|
6
14
|
*
|
|
7
15
|
* The gateway sits between unauthenticated clients (containerized gjc,
|
|
8
16
|
* llm-git, …) and the broker. It accepts provider-format HTTP requests
|
|
9
|
-
* (OpenAI chat-completions / Anthropic messages / OpenAI Responses)
|
|
17
|
+
* (OpenAI chat-completions / Anthropic messages / OpenAI Responses) within
|
|
18
|
+
* one explicit provider scope,
|
|
10
19
|
* dispatches them through pi-ai's `streamSimple()`, and translates the
|
|
11
20
|
* canonical event stream back to the matching wire format. The gateway
|
|
12
21
|
* injects `Authorization` server-side so clients never see access tokens.
|
|
@@ -15,6 +24,21 @@ import type { AssistantMessage, AssistantMessageEventStream, CacheRetention, Con
|
|
|
15
24
|
/** Default bind. Loopback-only — front with reverse proxy for remote access. */
|
|
16
25
|
export const DEFAULT_AUTH_GATEWAY_BIND = "127.0.0.1:4000";
|
|
17
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Provider APIs whose gateway identity is part of the provider contract.
|
|
29
|
+
*
|
|
30
|
+
* OpenAI Codex is backed by the Codex OAuth authority and must never be
|
|
31
|
+
* projected as a generic OpenAI Responses model. Other providers may expose
|
|
32
|
+
* more than one API and therefore remain catalog-defined.
|
|
33
|
+
*/
|
|
34
|
+
export const AUTH_GATEWAY_PROVIDER_APIS: Readonly<Record<string, Api>> = {
|
|
35
|
+
"openai-codex": "openai-codex-responses",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export interface AuthGatewayProviderScope {
|
|
39
|
+
provider: Provider;
|
|
40
|
+
}
|
|
41
|
+
|
|
18
42
|
export type AuthGatewayToolChoice = "auto" | "none" | "required" | { name: string };
|
|
19
43
|
|
|
20
44
|
export interface AuthGatewayParsedRequestOptions {
|
|
@@ -120,6 +144,8 @@ export interface AuthGatewayFormatModule {
|
|
|
120
144
|
export interface AuthGatewayServerOptions {
|
|
121
145
|
/** Listen address. Default `127.0.0.1:4000`. */
|
|
122
146
|
bind?: string;
|
|
147
|
+
/** Required provider scope. An unscoped gateway is not supported. */
|
|
148
|
+
providerScope: AuthGatewayProviderScope;
|
|
123
149
|
/** Accept any of these bearer tokens. Empty allows unauthenticated calls. */
|
|
124
150
|
bearerTokens: string[];
|
|
125
151
|
/** Version surfaced on `/healthz`. */
|