@premai/api-sdk 1.0.41 → 1.0.42
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/README.md +165 -39
- package/dist/anthropic/count-tokens-route.d.ts +3 -0
- package/dist/anthropic/from-openai.d.ts +33 -0
- package/dist/anthropic/http.d.ts +19 -0
- package/dist/anthropic/messages-route.d.ts +3 -0
- package/dist/anthropic/models-route.d.ts +3 -0
- package/dist/anthropic/to-openai.d.ts +35 -0
- package/dist/cli-claude.d.ts +2 -0
- package/dist/cli-claude.mjs +3304 -0
- package/dist/cli.mjs +2959 -0
- package/dist/core.browser.cjs +159 -20
- package/dist/core.browser.mjs +159 -20
- package/dist/index.cjs +1506 -237
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +1506 -239
- package/dist/launcher/claude-code.d.ts +1 -0
- package/dist/launcher/model-picker.d.ts +7 -0
- package/dist/launcher/proxy-subprocess.d.ts +13 -0
- package/dist/launcher/text-input.d.ts +3 -0
- package/dist/openai/routes.d.ts +3 -0
- package/dist/server/create-app.d.ts +8 -0
- package/dist/server/discovery.d.ts +7 -0
- package/dist/server/route-prefix.d.ts +9 -0
- package/dist/server/runtime.d.ts +8 -0
- package/dist/server/start.d.ts +4 -0
- package/dist/server.d.ts +7 -5
- package/dist/types.d.ts +9 -3
- package/package.json +8 -3
- package/dist/cli.cjs +0 -1699
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runClaudeCode(forwardedArgs?: string[]): Promise<number>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ProxyConfig = {
|
|
2
|
+
host: string;
|
|
3
|
+
port: number;
|
|
4
|
+
proxyUrl: string;
|
|
5
|
+
enclaveUrl: string;
|
|
6
|
+
kek: string;
|
|
7
|
+
};
|
|
8
|
+
export type ProxyHandle = {
|
|
9
|
+
stop: () => void;
|
|
10
|
+
ready: Promise<void>;
|
|
11
|
+
whenCrashed: Promise<never>;
|
|
12
|
+
};
|
|
13
|
+
export declare function startProxySubprocess(config: ProxyConfig): ProxyHandle;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import type { RvencClient } from "../core";
|
|
3
|
+
import type { CreateServerAppOptions, ServerCompatMode } from "../types";
|
|
4
|
+
export type RvencServerDeps = {
|
|
5
|
+
getOrCreateClient: (apiKey: string) => Promise<RvencClient>;
|
|
6
|
+
};
|
|
7
|
+
export declare function createServerApp(compat?: ServerCompatMode): express.Application;
|
|
8
|
+
export declare function createServerApp(options: CreateServerAppOptions): express.Application;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ServerCompatMode } from "../types";
|
|
2
|
+
export declare function normalizeRoutePrefix(raw: string | undefined): string;
|
|
3
|
+
export declare const DEFAULT_OPENAI_ROUTE_PREFIX_BOTH = "/openai";
|
|
4
|
+
export declare const DEFAULT_ANTHROPIC_ROUTE_PREFIX_BOTH = "/anthropic";
|
|
5
|
+
export declare function resolvePrefixesForCompat(compat: ServerCompatMode, openaiRaw: string | undefined, anthropicRaw: string | undefined): {
|
|
6
|
+
openaiPrefix: string;
|
|
7
|
+
anthropicPrefix: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function prefixedRoute(prefix: string, path: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import multer from "multer";
|
|
2
|
+
import { type RvencClient } from "../core";
|
|
3
|
+
import type { ServerOptions } from "../types";
|
|
4
|
+
export declare const DEFAULT_HOST: string;
|
|
5
|
+
export declare const DEFAULT_PORT: number;
|
|
6
|
+
export declare const audioUpload: multer.Multer;
|
|
7
|
+
export declare function applyServerOptions(options: ServerOptions): void;
|
|
8
|
+
export declare function getOrCreateRvencClient(apiKey: string): Promise<RvencClient>;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
import { createServerApp } from "./server/create-app";
|
|
2
|
+
export type { RvencServerDeps } from "./server/create-app";
|
|
3
|
+
export { DEFAULT_ANTHROPIC_ROUTE_PREFIX_BOTH, DEFAULT_OPENAI_ROUTE_PREFIX_BOTH, normalizeRoutePrefix, resolvePrefixesForCompat, } from "./server/route-prefix";
|
|
4
|
+
export { createServerApp };
|
|
5
|
+
export { startServer } from "./server/start";
|
|
6
|
+
declare const _default: import("express").Application;
|
|
7
|
+
export default _default;
|
package/dist/types.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export interface IndexFilesResponse {
|
|
|
121
121
|
data: {
|
|
122
122
|
results: Array<{
|
|
123
123
|
file_id: string;
|
|
124
|
-
rag_status:
|
|
124
|
+
rag_status: "running" | "stopped" | "failure" | "success" | null;
|
|
125
125
|
success: boolean;
|
|
126
126
|
error?: string;
|
|
127
127
|
}>;
|
|
@@ -271,7 +271,7 @@ export interface TranscribeWithDiarizationDecrypted {
|
|
|
271
271
|
detectedLanguage?: string;
|
|
272
272
|
}
|
|
273
273
|
export interface SpreadsheetContentDecrypted {
|
|
274
|
-
format:
|
|
274
|
+
format: "csv" | "xlsx";
|
|
275
275
|
data?: unknown[][];
|
|
276
276
|
sheets?: Array<{
|
|
277
277
|
name: string;
|
|
@@ -284,7 +284,7 @@ export interface SpreadsheetContentDecrypted {
|
|
|
284
284
|
error?: string;
|
|
285
285
|
}
|
|
286
286
|
export interface DataFileContentDecrypted {
|
|
287
|
-
format:
|
|
287
|
+
format: "json" | "xml";
|
|
288
288
|
content: string;
|
|
289
289
|
summary?: {
|
|
290
290
|
type?: string;
|
|
@@ -328,6 +328,7 @@ export interface ExecuteToolResponseWrapper {
|
|
|
328
328
|
data: ExecuteToolResponse;
|
|
329
329
|
error?: string;
|
|
330
330
|
}
|
|
331
|
+
export type ServerCompatMode = "openai" | "anthropic" | "both";
|
|
331
332
|
export type ServerOptions = {
|
|
332
333
|
host?: string;
|
|
333
334
|
port?: number;
|
|
@@ -335,7 +336,12 @@ export type ServerOptions = {
|
|
|
335
336
|
enclaveUrl?: string;
|
|
336
337
|
kek?: string;
|
|
337
338
|
attest?: boolean;
|
|
339
|
+
compat?: ServerCompatMode;
|
|
340
|
+
openaiRoutePrefix?: string;
|
|
341
|
+
anthropicRoutePrefix?: string;
|
|
342
|
+
jsonBodyLimit?: string;
|
|
338
343
|
};
|
|
344
|
+
export type CreateServerAppOptions = Pick<ServerOptions, "compat" | "openaiRoutePrefix" | "anthropicRoutePrefix" | "jsonBodyLimit">;
|
|
339
345
|
export interface ListModelsParams {
|
|
340
346
|
type?: string;
|
|
341
347
|
}
|
package/package.json
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
},
|
|
5
5
|
"homepage": "https://github.com/premai-io/api-sdk-ts",
|
|
6
6
|
"name": "@premai/api-sdk",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.42",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
9
9
|
"bin": {
|
|
10
|
-
"
|
|
10
|
+
"confidential-proxy": "./dist/cli.mjs",
|
|
11
|
+
"confidential-claude": "./dist/cli-claude.mjs"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [],
|
|
13
14
|
"author": "",
|
|
@@ -65,7 +66,8 @@
|
|
|
65
66
|
"@noble/curves": "^1.8.1",
|
|
66
67
|
"@noble/hashes": "^1.7.1",
|
|
67
68
|
"@noble/post-quantum": "^0.5.2",
|
|
68
|
-
"@premai/reticle": "^0.4.
|
|
69
|
+
"@premai/reticle": "^0.4.7",
|
|
70
|
+
"@types/react": "^19.2.15",
|
|
69
71
|
"bare-abort-controller": "^1.1.1",
|
|
70
72
|
"bare-crypto": "^1.13.5",
|
|
71
73
|
"bare-encoding": "^1.0.3",
|
|
@@ -74,9 +76,12 @@
|
|
|
74
76
|
"bare-process": "^4.4.1",
|
|
75
77
|
"date-fns": "^4.1.0",
|
|
76
78
|
"dotenv": "^17.2.3",
|
|
79
|
+
"env-paths": "^4.0.0",
|
|
77
80
|
"express": "^4.18.2",
|
|
81
|
+
"ink": "^7.0.4",
|
|
78
82
|
"multer": "^2.0.2",
|
|
79
83
|
"openai": "^6.9.1",
|
|
84
|
+
"react": "^19.2.6",
|
|
80
85
|
"typescript": "^5.9.3",
|
|
81
86
|
"zod": "^4.2.1"
|
|
82
87
|
},
|