@highflame/sdk 0.3.3 → 0.3.4
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/index.cjs +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -281,7 +281,7 @@ var Highflame = class {
|
|
|
281
281
|
const baseUrl = options.baseUrl ?? SAAS_BASE_URL;
|
|
282
282
|
const tokenUrl = options.tokenUrl ?? SAAS_TOKEN_URL;
|
|
283
283
|
this.#baseUrl = baseUrl.replace(/\/$/, "");
|
|
284
|
-
this.#tokenUrl = options.apiKey.startsWith("hf_sk") ? tokenUrl : void 0;
|
|
284
|
+
this.#tokenUrl = options.apiKey.startsWith("hf_sk") || options.apiKey.startsWith("hfa_") ? tokenUrl : void 0;
|
|
285
285
|
this.#apiKey = options.apiKey;
|
|
286
286
|
this.#timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
287
287
|
this.#maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
|
package/dist/index.d.cts
CHANGED
|
@@ -506,8 +506,8 @@ interface ProblemDetails {
|
|
|
506
506
|
interface StreamEvent {
|
|
507
507
|
/** Event payload (DetectorResult for detector_result, GuardResponse for decision). */
|
|
508
508
|
data: Record<string, unknown>;
|
|
509
|
-
/** Event type: detector_result (per-detector), decision (final), or
|
|
510
|
-
type: "detector_result" | "decision" | "error";
|
|
509
|
+
/** Event type: detector_result (per-detector), decision (final), error, or message (keepalive/info). */
|
|
510
|
+
type: "detector_result" | "decision" | "error" | "message";
|
|
511
511
|
}
|
|
512
512
|
/** Response from the token exchange endpoint (used by SDK auth). */
|
|
513
513
|
interface TokenResponse {
|
|
@@ -568,11 +568,11 @@ interface Logger {
|
|
|
568
568
|
warn(message: string, ...args: unknown[]): void;
|
|
569
569
|
}
|
|
570
570
|
interface HighflameOptions {
|
|
571
|
-
/** Service API key (`hf_sk_...`) or a raw JWT. */
|
|
571
|
+
/** Service API key (`hf_sk_...`), agent API key (`hfa_...`), or a raw JWT. */
|
|
572
572
|
apiKey: string;
|
|
573
573
|
/** Base URL of the guard service. Defaults to Highflame SaaS. */
|
|
574
574
|
baseUrl?: string;
|
|
575
|
-
/** Token exchange URL. Defaults to Highflame SaaS.
|
|
575
|
+
/** Token exchange URL. Defaults to Highflame SaaS. Used for `hf_sk_*` and `hfa_*` keys. */
|
|
576
576
|
tokenUrl?: string;
|
|
577
577
|
/** Request timeout in milliseconds. Default: 30000. */
|
|
578
578
|
timeout?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -506,8 +506,8 @@ interface ProblemDetails {
|
|
|
506
506
|
interface StreamEvent {
|
|
507
507
|
/** Event payload (DetectorResult for detector_result, GuardResponse for decision). */
|
|
508
508
|
data: Record<string, unknown>;
|
|
509
|
-
/** Event type: detector_result (per-detector), decision (final), or
|
|
510
|
-
type: "detector_result" | "decision" | "error";
|
|
509
|
+
/** Event type: detector_result (per-detector), decision (final), error, or message (keepalive/info). */
|
|
510
|
+
type: "detector_result" | "decision" | "error" | "message";
|
|
511
511
|
}
|
|
512
512
|
/** Response from the token exchange endpoint (used by SDK auth). */
|
|
513
513
|
interface TokenResponse {
|
|
@@ -568,11 +568,11 @@ interface Logger {
|
|
|
568
568
|
warn(message: string, ...args: unknown[]): void;
|
|
569
569
|
}
|
|
570
570
|
interface HighflameOptions {
|
|
571
|
-
/** Service API key (`hf_sk_...`) or a raw JWT. */
|
|
571
|
+
/** Service API key (`hf_sk_...`), agent API key (`hfa_...`), or a raw JWT. */
|
|
572
572
|
apiKey: string;
|
|
573
573
|
/** Base URL of the guard service. Defaults to Highflame SaaS. */
|
|
574
574
|
baseUrl?: string;
|
|
575
|
-
/** Token exchange URL. Defaults to Highflame SaaS.
|
|
575
|
+
/** Token exchange URL. Defaults to Highflame SaaS. Used for `hf_sk_*` and `hfa_*` keys. */
|
|
576
576
|
tokenUrl?: string;
|
|
577
577
|
/** Request timeout in milliseconds. Default: 30000. */
|
|
578
578
|
timeout?: number;
|
package/dist/index.js
CHANGED
|
@@ -243,7 +243,7 @@ var Highflame = class {
|
|
|
243
243
|
const baseUrl = options.baseUrl ?? SAAS_BASE_URL;
|
|
244
244
|
const tokenUrl = options.tokenUrl ?? SAAS_TOKEN_URL;
|
|
245
245
|
this.#baseUrl = baseUrl.replace(/\/$/, "");
|
|
246
|
-
this.#tokenUrl = options.apiKey.startsWith("hf_sk") ? tokenUrl : void 0;
|
|
246
|
+
this.#tokenUrl = options.apiKey.startsWith("hf_sk") || options.apiKey.startsWith("hfa_") ? tokenUrl : void 0;
|
|
247
247
|
this.#apiKey = options.apiKey;
|
|
248
248
|
this.#timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
249
249
|
this.#maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
|