@llmops/sdk 0.6.10 → 1.0.0-beta.10
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/agents.d.cts +1 -1
- package/dist/agents.d.mts +1 -1
- package/dist/agents.mjs +1 -1
- package/dist/constants-BrB5eRjw.cjs +18 -0
- package/dist/constants-sHtPfi36.mjs +12 -0
- package/dist/express.d.cts +3 -3
- package/dist/express.d.mts +3 -3
- package/dist/express.mjs +1 -1
- package/dist/hono.d.cts +2 -2
- package/dist/hono.d.mts +2 -2
- package/dist/{index-1uemrw2P.d.cts → index-BHO7MEJx.d.cts} +1 -1
- package/dist/{index-C7J-9Jvp.d.cts → index-C0CDqR9v.d.mts} +1 -1
- package/dist/{index-BeDbCYjz.d.mts → index-DVkfeg2W.d.mts} +1 -1
- package/dist/{index-D0LVaLA4.d.mts → index-sjRozlIk.d.cts} +1 -1
- package/dist/index.cjs +2 -13
- package/dist/index.d.cts +6 -173
- package/dist/index.d.mts +6 -173
- package/dist/index.mjs +4 -15
- package/dist/interface-BbAwy96d.d.cts +223 -0
- package/dist/interface-Dz7B6QN1.d.mts +223 -0
- package/dist/nextjs.d.cts +2 -2
- package/dist/nextjs.d.mts +2 -2
- package/dist/store/d1.cjs +491 -0
- package/dist/store/d1.d.cts +60 -0
- package/dist/store/d1.d.mts +60 -0
- package/dist/store/d1.mjs +490 -0
- package/dist/store/pg.cjs +13636 -0
- package/dist/store/pg.d.cts +38 -0
- package/dist/store/pg.d.mts +38 -0
- package/dist/store/pg.mjs +13637 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +1 -0
- package/package.json +44 -3
- /package/dist/{agents-exporter-B-ADoC7t.d.cts → agents-exporter-Bn3NtzMO.d.mts} +0 -0
- /package/dist/{agents-exporter-CxbWY6xN.mjs → agents-exporter-DYmMvLPS.mjs} +0 -0
- /package/dist/{agents-exporter-BZjfVkaH.d.mts → agents-exporter-vuQine9v.d.cts} +0 -0
- /package/dist/{express-ClEIbLM9.mjs → express-Vt9JurUM.mjs} +0 -0
package/dist/agents.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-
|
|
1
|
+
import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-vuQine9v.cjs";
|
|
2
2
|
export { AgentsSpan, AgentsSpanData, AgentsSpanError, AgentsTrace, AgentsTracingExporter, LLMOpsAgentsExporterConfig, createLLMOpsAgentsExporter };
|
package/dist/agents.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-
|
|
1
|
+
import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-Bn3NtzMO.mjs";
|
|
2
2
|
export { AgentsSpan, AgentsSpanData, AgentsSpanError, AgentsTrace, AgentsTracingExporter, LLMOpsAgentsExporterConfig, createLLMOpsAgentsExporter };
|
package/dist/agents.mjs
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/telemetry/constants.ts
|
|
3
|
+
const COST_SUMMARY_GROUP_BY = [
|
|
4
|
+
"day",
|
|
5
|
+
"hour",
|
|
6
|
+
"model",
|
|
7
|
+
"provider",
|
|
8
|
+
"endpoint",
|
|
9
|
+
"tags"
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, 'COST_SUMMARY_GROUP_BY', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return COST_SUMMARY_GROUP_BY;
|
|
17
|
+
}
|
|
18
|
+
});
|
package/dist/express.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./agents-exporter-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import "./agents-exporter-vuQine9v.cjs";
|
|
2
|
+
import "./index-sjRozlIk.cjs";
|
|
3
|
+
import { t as createLLMOpsMiddleware } from "./index-BHO7MEJx.cjs";
|
|
4
4
|
export { createLLMOpsMiddleware };
|
package/dist/express.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./agents-exporter-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import "./agents-exporter-Bn3NtzMO.mjs";
|
|
2
|
+
import "./index-C0CDqR9v.mjs";
|
|
3
|
+
import { t as createLLMOpsMiddleware } from "./index-DVkfeg2W.mjs";
|
|
4
4
|
export { createLLMOpsMiddleware };
|
package/dist/express.mjs
CHANGED
package/dist/hono.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./agents-exporter-
|
|
2
|
-
import { t as LLMOpsClient } from "./index-
|
|
1
|
+
import "./agents-exporter-vuQine9v.cjs";
|
|
2
|
+
import { t as LLMOpsClient } from "./index-sjRozlIk.cjs";
|
|
3
3
|
import { MiddlewareHandler } from "hono";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/hono/index.d.ts
|
package/dist/hono.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./agents-exporter-
|
|
2
|
-
import { t as LLMOpsClient } from "./index-
|
|
1
|
+
import "./agents-exporter-Bn3NtzMO.mjs";
|
|
2
|
+
import { t as LLMOpsClient } from "./index-C0CDqR9v.mjs";
|
|
3
3
|
import { MiddlewareHandler } from "hono";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/hono/index.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AgentsTracingExporter } from "./agents-exporter-
|
|
1
|
+
import { a as AgentsTracingExporter } from "./agents-exporter-Bn3NtzMO.mjs";
|
|
2
2
|
import { LLMOpsConfig, ValidatedLLMOpsConfig } from "@llmops/core";
|
|
3
3
|
|
|
4
4
|
//#region src/telemetry/langchain-client.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AgentsTracingExporter } from "./agents-exporter-
|
|
1
|
+
import { a as AgentsTracingExporter } from "./agents-exporter-vuQine9v.cjs";
|
|
2
2
|
import { LLMOpsConfig, ValidatedLLMOpsConfig } from "@llmops/core";
|
|
3
3
|
|
|
4
4
|
//#region src/telemetry/langchain-client.d.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
const require_express = require('./express-B-wbCza5.cjs');
|
|
2
2
|
const require_agents_exporter = require('./agents-exporter-BuTq2n2y.cjs');
|
|
3
|
+
const require_constants = require('./constants-BrB5eRjw.cjs');
|
|
3
4
|
let __llmops_core = require("@llmops/core");
|
|
4
5
|
let __llmops_app = require("@llmops/app");
|
|
5
6
|
|
|
6
|
-
//#region src/lib/auth/client.ts
|
|
7
|
-
/**
|
|
8
|
-
* Error thrown when a feature is not available in the current auth implementation
|
|
9
|
-
*/
|
|
10
|
-
var AuthFeatureNotAvailableError = class extends Error {
|
|
11
|
-
constructor(feature, authType) {
|
|
12
|
-
super(`The "${feature}" feature is not available with "${authType}" auth. Upgrade to @llmops/enterprise for full auth functionality.`);
|
|
13
|
-
this.name = "AuthFeatureNotAvailableError";
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
7
|
//#region src/telemetry/langchain-client.ts
|
|
19
8
|
/**
|
|
20
9
|
* Create a LangSmithTracingClientInterface-compatible client that sends
|
|
@@ -241,7 +230,7 @@ function createLLMOpsSpanExporter(config) {
|
|
|
241
230
|
}
|
|
242
231
|
|
|
243
232
|
//#endregion
|
|
244
|
-
exports.
|
|
233
|
+
exports.COST_SUMMARY_GROUP_BY = require_constants.COST_SUMMARY_GROUP_BY;
|
|
245
234
|
exports.createLLMOpsAgentsExporter = require_agents_exporter.createLLMOpsAgentsExporter;
|
|
246
235
|
exports.createLLMOpsLangChainClient = createLLMOpsLangChainClient;
|
|
247
236
|
exports.createLLMOpsMiddleware = require_express.createLLMOpsMiddleware;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,177 +1,10 @@
|
|
|
1
|
-
import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-
|
|
2
|
-
import { a as LLMOpsLangChainClientConfig, i as createLLMOps, n as ProviderOptions, o as LangChainTracingClient, r as TraceContext, s as createLLMOpsLangChainClient, t as LLMOpsClient } from "./index-
|
|
3
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-vuQine9v.cjs";
|
|
2
|
+
import { a as LLMOpsLangChainClientConfig, i as createLLMOps, n as ProviderOptions, o as LangChainTracingClient, r as TraceContext, s as createLLMOpsLangChainClient, t as LLMOpsClient } from "./index-sjRozlIk.cjs";
|
|
3
|
+
import { t as createLLMOpsMiddleware } from "./index-BHO7MEJx.cjs";
|
|
4
|
+
import { a as TraceUpsert, i as SpanInsert, n as LLMRequestInsert, o as COST_SUMMARY_GROUP_BY, r as SpanEventInsert, s as CostSummaryGroupBy, t as TelemetryStore } from "./interface-BbAwy96d.cjs";
|
|
4
5
|
|
|
5
|
-
//#region src/lib/auth/client.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Auth Client - Extensible authentication client for LLMOps
|
|
9
|
-
*
|
|
10
|
-
* Provides an interface that can be extended for different auth providers.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* User representation
|
|
14
|
-
*/
|
|
15
|
-
interface User {
|
|
16
|
-
id: string;
|
|
17
|
-
email: string;
|
|
18
|
-
name: string;
|
|
19
|
-
role: string | null;
|
|
20
|
-
emailVerified: boolean;
|
|
21
|
-
image: string | null;
|
|
22
|
-
banned: boolean | null;
|
|
23
|
-
banReason: string | null;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
updatedAt: Date;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Session representation
|
|
29
|
-
*/
|
|
30
|
-
interface Session {
|
|
31
|
-
id: string;
|
|
32
|
-
userId: string;
|
|
33
|
-
expiresAt: Date;
|
|
34
|
-
createdAt: Date;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Permission check result
|
|
38
|
-
*/
|
|
39
|
-
interface Permission {
|
|
40
|
-
resource: string;
|
|
41
|
-
action: string;
|
|
42
|
-
allowed: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Pagination options
|
|
46
|
-
*/
|
|
47
|
-
interface PaginationOptions {
|
|
48
|
-
limit?: number;
|
|
49
|
-
offset?: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Paginated response
|
|
53
|
-
*/
|
|
54
|
-
interface PaginatedResponse<T> {
|
|
55
|
-
data: T[];
|
|
56
|
-
total: number;
|
|
57
|
-
limit: number;
|
|
58
|
-
offset: number;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Base auth client interface
|
|
62
|
-
* All auth implementations must implement this interface
|
|
63
|
-
*/
|
|
64
|
-
interface AuthClient {
|
|
65
|
-
/**
|
|
66
|
-
* The type of auth client
|
|
67
|
-
*/
|
|
68
|
-
readonly type: string;
|
|
69
|
-
/**
|
|
70
|
-
* Get the current session
|
|
71
|
-
* @returns Current session or null if not authenticated
|
|
72
|
-
*/
|
|
73
|
-
getSession(): Promise<Session | null>;
|
|
74
|
-
/**
|
|
75
|
-
* Get the current authenticated user
|
|
76
|
-
* @returns Current user or null if not authenticated
|
|
77
|
-
*/
|
|
78
|
-
getCurrentUser(): Promise<User | null>;
|
|
79
|
-
/**
|
|
80
|
-
* Check if currently authenticated
|
|
81
|
-
*/
|
|
82
|
-
isAuthenticated(): Promise<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* Get a user by ID
|
|
85
|
-
* @param userId - The user ID
|
|
86
|
-
*/
|
|
87
|
-
getUser(userId: string): Promise<User | null>;
|
|
88
|
-
/**
|
|
89
|
-
* List all users (paginated)
|
|
90
|
-
* @param options - Pagination options
|
|
91
|
-
*/
|
|
92
|
-
listUsers(options?: PaginationOptions): Promise<PaginatedResponse<User>>;
|
|
93
|
-
/**
|
|
94
|
-
* Create a new user
|
|
95
|
-
* @param data - User data
|
|
96
|
-
*/
|
|
97
|
-
createUser(data: {
|
|
98
|
-
email: string;
|
|
99
|
-
name: string;
|
|
100
|
-
password: string;
|
|
101
|
-
role?: string;
|
|
102
|
-
}): Promise<User>;
|
|
103
|
-
/**
|
|
104
|
-
* Update a user
|
|
105
|
-
* @param userId - The user ID
|
|
106
|
-
* @param data - Fields to update
|
|
107
|
-
*/
|
|
108
|
-
updateUser(userId: string, data: Partial<Pick<User, 'name' | 'email' | 'role' | 'image'>>): Promise<User>;
|
|
109
|
-
/**
|
|
110
|
-
* Delete a user
|
|
111
|
-
* @param userId - The user ID
|
|
112
|
-
*/
|
|
113
|
-
deleteUser(userId: string): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Get user's role
|
|
116
|
-
* @param userId - The user ID (optional, defaults to current user)
|
|
117
|
-
*/
|
|
118
|
-
getRole(userId?: string): Promise<string | null>;
|
|
119
|
-
/**
|
|
120
|
-
* Set user's role
|
|
121
|
-
* @param userId - The user ID
|
|
122
|
-
* @param role - The role to set
|
|
123
|
-
*/
|
|
124
|
-
setRole(userId: string, role: string): Promise<void>;
|
|
125
|
-
/**
|
|
126
|
-
* Check if user has permission
|
|
127
|
-
* @param permission - Permission to check (e.g., { resource: 'configs', action: 'create' })
|
|
128
|
-
* @param userId - The user ID (optional, defaults to current user)
|
|
129
|
-
*/
|
|
130
|
-
hasPermission(permission: {
|
|
131
|
-
resource: string;
|
|
132
|
-
action: string;
|
|
133
|
-
}, userId?: string): Promise<boolean>;
|
|
134
|
-
/**
|
|
135
|
-
* Get all permissions for a user
|
|
136
|
-
* @param userId - The user ID (optional, defaults to current user)
|
|
137
|
-
*/
|
|
138
|
-
getPermissions(userId?: string): Promise<Permission[]>;
|
|
139
|
-
/**
|
|
140
|
-
* Ban a user
|
|
141
|
-
* @param userId - The user ID
|
|
142
|
-
* @param reason - Optional ban reason
|
|
143
|
-
* @param expiresAt - Optional expiration date
|
|
144
|
-
*/
|
|
145
|
-
banUser(userId: string, reason?: string, expiresAt?: Date): Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Unban a user
|
|
148
|
-
* @param userId - The user ID
|
|
149
|
-
*/
|
|
150
|
-
unbanUser(userId: string): Promise<void>;
|
|
151
|
-
/**
|
|
152
|
-
* List all sessions for a user
|
|
153
|
-
* @param userId - The user ID
|
|
154
|
-
*/
|
|
155
|
-
listUserSessions(userId: string): Promise<Session[]>;
|
|
156
|
-
/**
|
|
157
|
-
* Revoke a specific session
|
|
158
|
-
* @param sessionId - The session ID
|
|
159
|
-
*/
|
|
160
|
-
revokeSession(sessionId: string): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* Revoke all sessions for a user
|
|
163
|
-
* @param userId - The user ID
|
|
164
|
-
*/
|
|
165
|
-
revokeAllSessions(userId: string): Promise<void>;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Error thrown when a feature is not available in the current auth implementation
|
|
169
|
-
*/
|
|
170
|
-
declare class AuthFeatureNotAvailableError extends Error {
|
|
171
|
-
constructor(feature: string, authType: string);
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
6
|
//#region src/telemetry/exporter.d.ts
|
|
7
|
+
|
|
175
8
|
/**
|
|
176
9
|
* LLMOps OTLP Span Exporter
|
|
177
10
|
*
|
|
@@ -260,4 +93,4 @@ interface LLMOpsExporterConfig {
|
|
|
260
93
|
*/
|
|
261
94
|
declare function createLLMOpsSpanExporter(config: LLMOpsExporterConfig): SpanExporter;
|
|
262
95
|
//#endregion
|
|
263
|
-
export { type AgentsTracingExporter,
|
|
96
|
+
export { type AgentsTracingExporter, COST_SUMMARY_GROUP_BY, type CostSummaryGroupBy, type LLMOpsAgentsExporterConfig, type LLMOpsClient, type LLMOpsExporterConfig, type LLMOpsLangChainClientConfig, type LLMRequestInsert, type LangChainTracingClient, type ProviderOptions, type SpanEventInsert, type SpanExporter, type SpanInsert, type TelemetryStore, type TraceContext, type TraceUpsert, createLLMOpsAgentsExporter, createLLMOpsLangChainClient, createLLMOpsMiddleware, createLLMOpsSpanExporter, createLLMOps as llmops };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,177 +1,10 @@
|
|
|
1
|
-
import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-
|
|
2
|
-
import { a as LLMOpsLangChainClientConfig, i as createLLMOps, n as ProviderOptions, o as LangChainTracingClient, r as TraceContext, s as createLLMOpsLangChainClient, t as LLMOpsClient } from "./index-
|
|
3
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-Bn3NtzMO.mjs";
|
|
2
|
+
import { a as LLMOpsLangChainClientConfig, i as createLLMOps, n as ProviderOptions, o as LangChainTracingClient, r as TraceContext, s as createLLMOpsLangChainClient, t as LLMOpsClient } from "./index-C0CDqR9v.mjs";
|
|
3
|
+
import { t as createLLMOpsMiddleware } from "./index-DVkfeg2W.mjs";
|
|
4
|
+
import { a as TraceUpsert, i as SpanInsert, n as LLMRequestInsert, o as COST_SUMMARY_GROUP_BY, r as SpanEventInsert, s as CostSummaryGroupBy, t as TelemetryStore } from "./interface-Dz7B6QN1.mjs";
|
|
4
5
|
|
|
5
|
-
//#region src/lib/auth/client.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Auth Client - Extensible authentication client for LLMOps
|
|
9
|
-
*
|
|
10
|
-
* Provides an interface that can be extended for different auth providers.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* User representation
|
|
14
|
-
*/
|
|
15
|
-
interface User {
|
|
16
|
-
id: string;
|
|
17
|
-
email: string;
|
|
18
|
-
name: string;
|
|
19
|
-
role: string | null;
|
|
20
|
-
emailVerified: boolean;
|
|
21
|
-
image: string | null;
|
|
22
|
-
banned: boolean | null;
|
|
23
|
-
banReason: string | null;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
updatedAt: Date;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Session representation
|
|
29
|
-
*/
|
|
30
|
-
interface Session {
|
|
31
|
-
id: string;
|
|
32
|
-
userId: string;
|
|
33
|
-
expiresAt: Date;
|
|
34
|
-
createdAt: Date;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Permission check result
|
|
38
|
-
*/
|
|
39
|
-
interface Permission {
|
|
40
|
-
resource: string;
|
|
41
|
-
action: string;
|
|
42
|
-
allowed: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Pagination options
|
|
46
|
-
*/
|
|
47
|
-
interface PaginationOptions {
|
|
48
|
-
limit?: number;
|
|
49
|
-
offset?: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Paginated response
|
|
53
|
-
*/
|
|
54
|
-
interface PaginatedResponse<T> {
|
|
55
|
-
data: T[];
|
|
56
|
-
total: number;
|
|
57
|
-
limit: number;
|
|
58
|
-
offset: number;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Base auth client interface
|
|
62
|
-
* All auth implementations must implement this interface
|
|
63
|
-
*/
|
|
64
|
-
interface AuthClient {
|
|
65
|
-
/**
|
|
66
|
-
* The type of auth client
|
|
67
|
-
*/
|
|
68
|
-
readonly type: string;
|
|
69
|
-
/**
|
|
70
|
-
* Get the current session
|
|
71
|
-
* @returns Current session or null if not authenticated
|
|
72
|
-
*/
|
|
73
|
-
getSession(): Promise<Session | null>;
|
|
74
|
-
/**
|
|
75
|
-
* Get the current authenticated user
|
|
76
|
-
* @returns Current user or null if not authenticated
|
|
77
|
-
*/
|
|
78
|
-
getCurrentUser(): Promise<User | null>;
|
|
79
|
-
/**
|
|
80
|
-
* Check if currently authenticated
|
|
81
|
-
*/
|
|
82
|
-
isAuthenticated(): Promise<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* Get a user by ID
|
|
85
|
-
* @param userId - The user ID
|
|
86
|
-
*/
|
|
87
|
-
getUser(userId: string): Promise<User | null>;
|
|
88
|
-
/**
|
|
89
|
-
* List all users (paginated)
|
|
90
|
-
* @param options - Pagination options
|
|
91
|
-
*/
|
|
92
|
-
listUsers(options?: PaginationOptions): Promise<PaginatedResponse<User>>;
|
|
93
|
-
/**
|
|
94
|
-
* Create a new user
|
|
95
|
-
* @param data - User data
|
|
96
|
-
*/
|
|
97
|
-
createUser(data: {
|
|
98
|
-
email: string;
|
|
99
|
-
name: string;
|
|
100
|
-
password: string;
|
|
101
|
-
role?: string;
|
|
102
|
-
}): Promise<User>;
|
|
103
|
-
/**
|
|
104
|
-
* Update a user
|
|
105
|
-
* @param userId - The user ID
|
|
106
|
-
* @param data - Fields to update
|
|
107
|
-
*/
|
|
108
|
-
updateUser(userId: string, data: Partial<Pick<User, 'name' | 'email' | 'role' | 'image'>>): Promise<User>;
|
|
109
|
-
/**
|
|
110
|
-
* Delete a user
|
|
111
|
-
* @param userId - The user ID
|
|
112
|
-
*/
|
|
113
|
-
deleteUser(userId: string): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Get user's role
|
|
116
|
-
* @param userId - The user ID (optional, defaults to current user)
|
|
117
|
-
*/
|
|
118
|
-
getRole(userId?: string): Promise<string | null>;
|
|
119
|
-
/**
|
|
120
|
-
* Set user's role
|
|
121
|
-
* @param userId - The user ID
|
|
122
|
-
* @param role - The role to set
|
|
123
|
-
*/
|
|
124
|
-
setRole(userId: string, role: string): Promise<void>;
|
|
125
|
-
/**
|
|
126
|
-
* Check if user has permission
|
|
127
|
-
* @param permission - Permission to check (e.g., { resource: 'configs', action: 'create' })
|
|
128
|
-
* @param userId - The user ID (optional, defaults to current user)
|
|
129
|
-
*/
|
|
130
|
-
hasPermission(permission: {
|
|
131
|
-
resource: string;
|
|
132
|
-
action: string;
|
|
133
|
-
}, userId?: string): Promise<boolean>;
|
|
134
|
-
/**
|
|
135
|
-
* Get all permissions for a user
|
|
136
|
-
* @param userId - The user ID (optional, defaults to current user)
|
|
137
|
-
*/
|
|
138
|
-
getPermissions(userId?: string): Promise<Permission[]>;
|
|
139
|
-
/**
|
|
140
|
-
* Ban a user
|
|
141
|
-
* @param userId - The user ID
|
|
142
|
-
* @param reason - Optional ban reason
|
|
143
|
-
* @param expiresAt - Optional expiration date
|
|
144
|
-
*/
|
|
145
|
-
banUser(userId: string, reason?: string, expiresAt?: Date): Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Unban a user
|
|
148
|
-
* @param userId - The user ID
|
|
149
|
-
*/
|
|
150
|
-
unbanUser(userId: string): Promise<void>;
|
|
151
|
-
/**
|
|
152
|
-
* List all sessions for a user
|
|
153
|
-
* @param userId - The user ID
|
|
154
|
-
*/
|
|
155
|
-
listUserSessions(userId: string): Promise<Session[]>;
|
|
156
|
-
/**
|
|
157
|
-
* Revoke a specific session
|
|
158
|
-
* @param sessionId - The session ID
|
|
159
|
-
*/
|
|
160
|
-
revokeSession(sessionId: string): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* Revoke all sessions for a user
|
|
163
|
-
* @param userId - The user ID
|
|
164
|
-
*/
|
|
165
|
-
revokeAllSessions(userId: string): Promise<void>;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Error thrown when a feature is not available in the current auth implementation
|
|
169
|
-
*/
|
|
170
|
-
declare class AuthFeatureNotAvailableError extends Error {
|
|
171
|
-
constructor(feature: string, authType: string);
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
6
|
//#region src/telemetry/exporter.d.ts
|
|
7
|
+
|
|
175
8
|
/**
|
|
176
9
|
* LLMOps OTLP Span Exporter
|
|
177
10
|
*
|
|
@@ -260,4 +93,4 @@ interface LLMOpsExporterConfig {
|
|
|
260
93
|
*/
|
|
261
94
|
declare function createLLMOpsSpanExporter(config: LLMOpsExporterConfig): SpanExporter;
|
|
262
95
|
//#endregion
|
|
263
|
-
export { type AgentsTracingExporter,
|
|
96
|
+
export { type AgentsTracingExporter, COST_SUMMARY_GROUP_BY, type CostSummaryGroupBy, type LLMOpsAgentsExporterConfig, type LLMOpsClient, type LLMOpsExporterConfig, type LLMOpsLangChainClientConfig, type LLMRequestInsert, type LangChainTracingClient, type ProviderOptions, type SpanEventInsert, type SpanExporter, type SpanInsert, type TelemetryStore, type TraceContext, type TraceUpsert, createLLMOpsAgentsExporter, createLLMOpsLangChainClient, createLLMOpsMiddleware, createLLMOpsSpanExporter, createLLMOps as llmops };
|
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { t as createLLMOpsMiddleware } from "./express-
|
|
2
|
-
import { t as createLLMOpsAgentsExporter } from "./agents-exporter-
|
|
1
|
+
import { t as createLLMOpsMiddleware } from "./express-Vt9JurUM.mjs";
|
|
2
|
+
import { t as createLLMOpsAgentsExporter } from "./agents-exporter-DYmMvLPS.mjs";
|
|
3
|
+
import { t as COST_SUMMARY_GROUP_BY } from "./constants-sHtPfi36.mjs";
|
|
3
4
|
import { LLMOPS_INTERNAL_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER } from "@llmops/core";
|
|
4
5
|
import { createApp } from "@llmops/app";
|
|
5
6
|
|
|
6
|
-
//#region src/lib/auth/client.ts
|
|
7
|
-
/**
|
|
8
|
-
* Error thrown when a feature is not available in the current auth implementation
|
|
9
|
-
*/
|
|
10
|
-
var AuthFeatureNotAvailableError = class extends Error {
|
|
11
|
-
constructor(feature, authType) {
|
|
12
|
-
super(`The "${feature}" feature is not available with "${authType}" auth. Upgrade to @llmops/enterprise for full auth functionality.`);
|
|
13
|
-
this.name = "AuthFeatureNotAvailableError";
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
7
|
//#region src/telemetry/langchain-client.ts
|
|
19
8
|
/**
|
|
20
9
|
* Create a LangSmithTracingClientInterface-compatible client that sends
|
|
@@ -241,4 +230,4 @@ function createLLMOpsSpanExporter(config) {
|
|
|
241
230
|
}
|
|
242
231
|
|
|
243
232
|
//#endregion
|
|
244
|
-
export {
|
|
233
|
+
export { COST_SUMMARY_GROUP_BY, createLLMOpsAgentsExporter, createLLMOpsLangChainClient, createLLMOpsMiddleware, createLLMOpsSpanExporter, createLLMOps as llmops };
|