@f5-sales-demo/pi-ai 21.19.1 → 21.19.3
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/package.json +2 -2
- package/src/auth-storage.ts +14 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5-sales-demo/pi-ai",
|
|
4
|
-
"version": "21.19.
|
|
4
|
+
"version": "21.19.3",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"homepage": "https://github.com/f5-sales-demo/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@anthropic-ai/sdk": "^0.115",
|
|
47
47
|
"@aws-sdk/client-bedrock-runtime": "^3",
|
|
48
48
|
"@bufbuild/protobuf": "^2.11",
|
|
49
|
-
"@f5-sales-demo/pi-utils": "21.19.
|
|
49
|
+
"@f5-sales-demo/pi-utils": "21.19.3",
|
|
50
50
|
"@google/genai": "^2.15",
|
|
51
51
|
"@sinclair/typebox": "^0.34",
|
|
52
52
|
"@smithy/node-http-handler": "^4.4",
|
package/src/auth-storage.ts
CHANGED
|
@@ -94,6 +94,8 @@ export type AuthCredentialEntry = AuthCredential | AuthCredential[];
|
|
|
94
94
|
|
|
95
95
|
export type AuthStorageData = Record<string, AuthCredentialEntry>;
|
|
96
96
|
|
|
97
|
+
export type AuthCredentialSource = "stored-oauth" | "stored-api-key" | "environment" | "runtime" | "configuration";
|
|
98
|
+
|
|
97
99
|
/**
|
|
98
100
|
* Serialized representation of AuthStorage for passing to subagent workers.
|
|
99
101
|
* Contains only the essential credential data, not runtime state.
|
|
@@ -714,6 +716,18 @@ export class AuthStorage {
|
|
|
714
716
|
return false;
|
|
715
717
|
}
|
|
716
718
|
|
|
719
|
+
/** Describe where the effective credential came from without exposing its value. */
|
|
720
|
+
getCredentialSource(provider: string): AuthCredentialSource | undefined {
|
|
721
|
+
provider = canonicalizeOAuthProviderId(provider);
|
|
722
|
+
if (this.#runtimeOverrides.has(provider)) return "runtime";
|
|
723
|
+
const stored = this.#getCredentialsForProvider(provider);
|
|
724
|
+
if (stored.some(credential => credential.type === "api_key")) return "stored-api-key";
|
|
725
|
+
if (stored.some(credential => credential.type === "oauth")) return "stored-oauth";
|
|
726
|
+
if (getEnvApiKey(provider)) return "environment";
|
|
727
|
+
if (this.#fallbackResolver?.(provider)) return "configuration";
|
|
728
|
+
return undefined;
|
|
729
|
+
}
|
|
730
|
+
|
|
717
731
|
/**
|
|
718
732
|
* Check if OAuth credentials are configured for a provider.
|
|
719
733
|
*/
|