pendra 0.13.1 → 0.15.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/index.d.mts +21 -6
- package/dist/index.d.ts +21 -6
- package/dist/index.js +745 -628
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +745 -628
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -41,6 +41,13 @@ declare class Transcriptions {
|
|
|
41
41
|
private client;
|
|
42
42
|
constructor(client: Pendra);
|
|
43
43
|
create(params: TranscriptionCreateParams): Promise<TranscriptionResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Private-inference transcription. There is no multipart upload: the audio
|
|
46
|
+
* bytes ride inside the envelope (sealed under the request's data key) and
|
|
47
|
+
* the request options are the sealed JSON body, POSTed as JSON to the same
|
|
48
|
+
* route.
|
|
49
|
+
*/
|
|
50
|
+
private createEncrypted;
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
declare class Audio {
|
|
@@ -485,6 +492,7 @@ declare class Generations {
|
|
|
485
492
|
private client;
|
|
486
493
|
constructor(client: Pendra);
|
|
487
494
|
create(params: ImageGenerationCreateParams): Promise<ImageResponse>;
|
|
495
|
+
private createEncrypted;
|
|
488
496
|
}
|
|
489
497
|
|
|
490
498
|
declare class Images {
|
|
@@ -555,22 +563,25 @@ declare class Rerank {
|
|
|
555
563
|
|
|
556
564
|
interface ResponseInner {
|
|
557
565
|
v?: number;
|
|
566
|
+
/** Legacy v1 encapsulated key. A v2 client refuses any frame carrying it. */
|
|
558
567
|
enc?: string;
|
|
568
|
+
kid?: string;
|
|
559
569
|
seq: number;
|
|
560
570
|
ciphertext: string;
|
|
561
571
|
}
|
|
562
572
|
/**
|
|
563
|
-
* Decrypts a worker's sealed response.
|
|
564
|
-
*
|
|
565
|
-
* monotonic `seq` across
|
|
573
|
+
* Decrypts a worker's sealed response. The first frame names the `kid` the
|
|
574
|
+
* worker opened; its response key (from {@link sealRequest}) decrypts every
|
|
575
|
+
* frame. Refuses any frame not in v2 form and enforces a monotonic `seq` across
|
|
576
|
+
* streaming chunks.
|
|
566
577
|
*/
|
|
567
578
|
declare class ResponseDecryptor {
|
|
568
|
-
private
|
|
579
|
+
private keys;
|
|
569
580
|
private dek;
|
|
570
581
|
private nextSeq;
|
|
571
|
-
constructor(
|
|
582
|
+
constructor(responseKeys: Map<string, Uint8Array>);
|
|
572
583
|
private ensureDek;
|
|
573
|
-
/** Decrypt a non-streaming result envelope `{v,
|
|
584
|
+
/** Decrypt a non-streaming result envelope `{v, kid, seq, ciphertext}`. */
|
|
574
585
|
openResult(inner: ResponseInner): Uint8Array;
|
|
575
586
|
/** Decrypt one streaming chunk envelope, enforcing monotonic `seq`. */
|
|
576
587
|
openChunk(inner: ResponseInner): Uint8Array;
|
|
@@ -649,6 +660,7 @@ declare class PrivateInferenceEngine {
|
|
|
649
660
|
/**
|
|
650
661
|
* Seal a request body to the resolved org key. Returns `{ topLevel, decryptor }`.
|
|
651
662
|
* `messages` (chat only) drives the affinity token; pass undefined for non-chat.
|
|
663
|
+
* `binary` (audio only) is sealed under the same data key as the body.
|
|
652
664
|
*/
|
|
653
665
|
seal(args: {
|
|
654
666
|
model: string;
|
|
@@ -656,6 +668,7 @@ declare class PrivateInferenceEngine {
|
|
|
656
668
|
taskType: string;
|
|
657
669
|
body: Uint8Array;
|
|
658
670
|
messages?: AffinityMessage[] | null;
|
|
671
|
+
binary?: Uint8Array | null;
|
|
659
672
|
}): {
|
|
660
673
|
topLevel: Record<string, unknown>;
|
|
661
674
|
decryptor: ResponseDecryptor;
|
|
@@ -709,6 +722,8 @@ declare class Pendra {
|
|
|
709
722
|
method: string;
|
|
710
723
|
body?: Record<string, unknown>;
|
|
711
724
|
headers?: Record<string, string>;
|
|
725
|
+
/** Overrides the client timeout for this request (ms). */
|
|
726
|
+
timeout?: number;
|
|
712
727
|
}): Promise<{
|
|
713
728
|
response: Response;
|
|
714
729
|
controller: AbortController;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,13 @@ declare class Transcriptions {
|
|
|
41
41
|
private client;
|
|
42
42
|
constructor(client: Pendra);
|
|
43
43
|
create(params: TranscriptionCreateParams): Promise<TranscriptionResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Private-inference transcription. There is no multipart upload: the audio
|
|
46
|
+
* bytes ride inside the envelope (sealed under the request's data key) and
|
|
47
|
+
* the request options are the sealed JSON body, POSTed as JSON to the same
|
|
48
|
+
* route.
|
|
49
|
+
*/
|
|
50
|
+
private createEncrypted;
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
declare class Audio {
|
|
@@ -485,6 +492,7 @@ declare class Generations {
|
|
|
485
492
|
private client;
|
|
486
493
|
constructor(client: Pendra);
|
|
487
494
|
create(params: ImageGenerationCreateParams): Promise<ImageResponse>;
|
|
495
|
+
private createEncrypted;
|
|
488
496
|
}
|
|
489
497
|
|
|
490
498
|
declare class Images {
|
|
@@ -555,22 +563,25 @@ declare class Rerank {
|
|
|
555
563
|
|
|
556
564
|
interface ResponseInner {
|
|
557
565
|
v?: number;
|
|
566
|
+
/** Legacy v1 encapsulated key. A v2 client refuses any frame carrying it. */
|
|
558
567
|
enc?: string;
|
|
568
|
+
kid?: string;
|
|
559
569
|
seq: number;
|
|
560
570
|
ciphertext: string;
|
|
561
571
|
}
|
|
562
572
|
/**
|
|
563
|
-
* Decrypts a worker's sealed response.
|
|
564
|
-
*
|
|
565
|
-
* monotonic `seq` across
|
|
573
|
+
* Decrypts a worker's sealed response. The first frame names the `kid` the
|
|
574
|
+
* worker opened; its response key (from {@link sealRequest}) decrypts every
|
|
575
|
+
* frame. Refuses any frame not in v2 form and enforces a monotonic `seq` across
|
|
576
|
+
* streaming chunks.
|
|
566
577
|
*/
|
|
567
578
|
declare class ResponseDecryptor {
|
|
568
|
-
private
|
|
579
|
+
private keys;
|
|
569
580
|
private dek;
|
|
570
581
|
private nextSeq;
|
|
571
|
-
constructor(
|
|
582
|
+
constructor(responseKeys: Map<string, Uint8Array>);
|
|
572
583
|
private ensureDek;
|
|
573
|
-
/** Decrypt a non-streaming result envelope `{v,
|
|
584
|
+
/** Decrypt a non-streaming result envelope `{v, kid, seq, ciphertext}`. */
|
|
574
585
|
openResult(inner: ResponseInner): Uint8Array;
|
|
575
586
|
/** Decrypt one streaming chunk envelope, enforcing monotonic `seq`. */
|
|
576
587
|
openChunk(inner: ResponseInner): Uint8Array;
|
|
@@ -649,6 +660,7 @@ declare class PrivateInferenceEngine {
|
|
|
649
660
|
/**
|
|
650
661
|
* Seal a request body to the resolved org key. Returns `{ topLevel, decryptor }`.
|
|
651
662
|
* `messages` (chat only) drives the affinity token; pass undefined for non-chat.
|
|
663
|
+
* `binary` (audio only) is sealed under the same data key as the body.
|
|
652
664
|
*/
|
|
653
665
|
seal(args: {
|
|
654
666
|
model: string;
|
|
@@ -656,6 +668,7 @@ declare class PrivateInferenceEngine {
|
|
|
656
668
|
taskType: string;
|
|
657
669
|
body: Uint8Array;
|
|
658
670
|
messages?: AffinityMessage[] | null;
|
|
671
|
+
binary?: Uint8Array | null;
|
|
659
672
|
}): {
|
|
660
673
|
topLevel: Record<string, unknown>;
|
|
661
674
|
decryptor: ResponseDecryptor;
|
|
@@ -709,6 +722,8 @@ declare class Pendra {
|
|
|
709
722
|
method: string;
|
|
710
723
|
body?: Record<string, unknown>;
|
|
711
724
|
headers?: Record<string, string>;
|
|
725
|
+
/** Overrides the client timeout for this request (ms). */
|
|
726
|
+
timeout?: number;
|
|
712
727
|
}): Promise<{
|
|
713
728
|
response: Response;
|
|
714
729
|
controller: AbortController;
|