@bodhiapp/bodhi-js-core 0.0.29 → 0.0.30
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/access-request.d.ts +15 -3
- package/dist/bodhi-core.cjs.js +3 -3
- package/dist/bodhi-core.esm.js +121 -126
- package/dist/cli/setup-modal.js +1 -1
- package/dist/direct-client-base.d.ts +2 -6
- package/dist/facade-client-base.d.ts +1 -3
- package/dist/interface.d.ts +2 -7
- package/dist/openai-client-compat.d.ts +1 -14
- package/dist/types/config.d.ts +3 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AccessRequestStatusResponse, CreateAccessRequest, CreateAccessRequestResponse, DeploymentMode, PingResponse
|
|
1
|
+
import { AccessRequestStatusResponse, CreateAccessRequest, CreateAccessRequestResponse, DeploymentMode, PingResponse } from '@bodhiapp/ts-client';
|
|
2
2
|
import { ApiResponse } from '@bodhiapp/bodhi-browser-types';
|
|
3
3
|
import { IDirectClient } from './interface';
|
|
4
4
|
import { Logger } from './logger';
|
|
5
|
-
import { Chat, Models, Embeddings,
|
|
5
|
+
import { Chat, Models, Embeddings, Mcps } from './openai-client-compat';
|
|
6
6
|
import { OAuthEndpoints, RefreshTokenResponse } from './oauth';
|
|
7
7
|
import { StorageKeys } from './storage';
|
|
8
8
|
import { AuthState, BackendServerState, ClientState, DirectState, InitParams, LogLevel, SerializedDirectState, StateChangeCallback } from './types';
|
|
@@ -38,7 +38,6 @@ export declare function testServerConnectivity(serverUrl: string, timeoutMs?: nu
|
|
|
38
38
|
export interface DirectClientBaseConfig {
|
|
39
39
|
authClientId: string;
|
|
40
40
|
authServerUrl: string;
|
|
41
|
-
userRole: UserScope;
|
|
42
41
|
storagePrefix: string;
|
|
43
42
|
logLevel: LogLevel;
|
|
44
43
|
loggerPrefix: string;
|
|
@@ -52,7 +51,6 @@ export declare abstract class DirectClientBase implements IDirectClient {
|
|
|
52
51
|
protected serverUrl: string | null;
|
|
53
52
|
protected authClientId: string;
|
|
54
53
|
protected authServerUrl: string;
|
|
55
|
-
protected userRole: UserScope;
|
|
56
54
|
protected authEndpoints: OAuthEndpoints;
|
|
57
55
|
protected storageKeys: StorageKeys;
|
|
58
56
|
protected state: DirectState;
|
|
@@ -62,7 +60,6 @@ export declare abstract class DirectClientBase implements IDirectClient {
|
|
|
62
60
|
private _chat;
|
|
63
61
|
private _models;
|
|
64
62
|
private _embeddings;
|
|
65
|
-
private _toolsets;
|
|
66
63
|
private _mcps;
|
|
67
64
|
constructor(config: DirectClientBaseConfig, onStateChange?: StateChangeCallback);
|
|
68
65
|
/**
|
|
@@ -96,7 +93,6 @@ export declare abstract class DirectClientBase implements IDirectClient {
|
|
|
96
93
|
get chat(): Chat;
|
|
97
94
|
get models(): Models;
|
|
98
95
|
get embeddings(): Embeddings;
|
|
99
|
-
get toolsets(): Toolsets;
|
|
100
96
|
get mcps(): Mcps;
|
|
101
97
|
/**
|
|
102
98
|
* Test connectivity to local server
|
|
@@ -3,7 +3,7 @@ import { ApiResponse } from '@bodhiapp/bodhi-browser-types';
|
|
|
3
3
|
import { IConnectionClient, IExtensionClient } from './interface';
|
|
4
4
|
import { Logger } from './logger';
|
|
5
5
|
import { BodhiClientUserPrefsManager } from './storage';
|
|
6
|
-
import { Chat, Models, Embeddings,
|
|
6
|
+
import { Chat, Models, Embeddings, Mcps } from './openai-client-compat';
|
|
7
7
|
import { AuthState, BackendServerState, ClientState, ConnectionMode, DirectState, ExtensionState, InitParams, LoginOptions, SerializedClientState, SerializedDirectState, SerializedExtensionState, StateChange, StateChangeCallback } from './types';
|
|
8
8
|
/**
|
|
9
9
|
* Base facade client with common delegation logic
|
|
@@ -24,7 +24,6 @@ export declare abstract class BaseFacadeClient<TConfig, TExtClient extends IExte
|
|
|
24
24
|
private _chat;
|
|
25
25
|
private _models;
|
|
26
26
|
private _embeddings;
|
|
27
|
-
private _toolsets;
|
|
28
27
|
private _mcps;
|
|
29
28
|
constructor(authClientId: string, config: TConfig, onStateChange?: StateChangeCallback);
|
|
30
29
|
/**
|
|
@@ -116,7 +115,6 @@ export declare abstract class BaseFacadeClient<TConfig, TExtClient extends IExte
|
|
|
116
115
|
get chat(): Chat;
|
|
117
116
|
get models(): Models;
|
|
118
117
|
get embeddings(): Embeddings;
|
|
119
|
-
get toolsets(): Toolsets;
|
|
120
118
|
get mcps(): Mcps;
|
|
121
119
|
getConnectionMode(): ConnectionMode | null;
|
|
122
120
|
setConnectionMode(mode: ConnectionMode): Promise<ClientState>;
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccessRequestStatusResponse, CreateAccessRequest, CreateAccessRequestResponse, PingResponse } from '@bodhiapp/ts-client';
|
|
2
2
|
import { ApiResponse } from '@bodhiapp/bodhi-browser-types';
|
|
3
3
|
import { AuthState, BackendServerState, ClientState, ConnectionMode, DirectState, ExtensionState, InitParams, LoginOptions, StateChangeCallback } from './types';
|
|
4
|
-
import { Chat, Models, Embeddings,
|
|
4
|
+
import { Chat, Models, Embeddings, Mcps } from './openai-client-compat';
|
|
5
5
|
/**
|
|
6
6
|
* ConnectionClient - Base interface for all client implementations
|
|
7
7
|
*
|
|
@@ -72,7 +72,7 @@ export interface IConnectionClient<IParams = unknown, SerialState = unknown> {
|
|
|
72
72
|
* Login via OAuth
|
|
73
73
|
* - IExtensionClient: Delegates to extension (chrome.identity or browser redirect)
|
|
74
74
|
* - DirectClient: Direct HTTP OAuth flow
|
|
75
|
-
* @param options - Optional login options (
|
|
75
|
+
* @param options - Optional login options (requested resources, role, flow type)
|
|
76
76
|
* @returns AuthState with login state and user info
|
|
77
77
|
*/
|
|
78
78
|
login(options?: LoginOptions): Promise<AuthState>;
|
|
@@ -139,11 +139,6 @@ export interface IConnectionClient<IParams = unknown, SerialState = unknown> {
|
|
|
139
139
|
* Usage: await client.embeddings.create({ model, input })
|
|
140
140
|
*/
|
|
141
141
|
readonly embeddings: Embeddings;
|
|
142
|
-
/**
|
|
143
|
-
* Toolsets resource
|
|
144
|
-
* Usage: await client.toolsets.list()
|
|
145
|
-
*/
|
|
146
|
-
readonly toolsets: Toolsets;
|
|
147
142
|
/**
|
|
148
143
|
* MCPs resource
|
|
149
144
|
* Usage: await client.mcps.list()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateChatCompletionRequest, CreateChatCompletionResponse, CreateChatCompletionStreamResponse, CreateEmbeddingRequest, CreateEmbeddingResponse, Model,
|
|
1
|
+
import { CreateChatCompletionRequest, CreateChatCompletionResponse, CreateChatCompletionStreamResponse, CreateEmbeddingRequest, CreateEmbeddingResponse, Model, ListMcpsResponse, McpToolsResponse } from '@bodhiapp/ts-client';
|
|
2
2
|
import { ApiResponse } from '@bodhiapp/bodhi-browser-types';
|
|
3
3
|
/**
|
|
4
4
|
* Minimal client interface required by resource classes
|
|
@@ -60,19 +60,6 @@ export declare class Embeddings extends APIResource {
|
|
|
60
60
|
*/
|
|
61
61
|
create(body: CreateEmbeddingRequest): Promise<CreateEmbeddingResponse>;
|
|
62
62
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Toolsets resource
|
|
65
|
-
*/
|
|
66
|
-
export declare class Toolsets extends APIResource {
|
|
67
|
-
/**
|
|
68
|
-
* List available toolsets
|
|
69
|
-
*/
|
|
70
|
-
list(): Promise<ListToolsetsResponse>;
|
|
71
|
-
/**
|
|
72
|
-
* Execute a tool on a toolset
|
|
73
|
-
*/
|
|
74
|
-
executeTool(toolsetId: string, toolName: string, params: Record<string, unknown>): Promise<unknown>;
|
|
75
|
-
}
|
|
76
63
|
/**
|
|
77
64
|
* MCPs resource
|
|
78
65
|
*/
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Configuration and utility types
|
|
3
|
+
*/
|
|
2
4
|
/**
|
|
3
5
|
* Log levels for client logging
|
|
4
6
|
*/
|
|
@@ -16,7 +18,6 @@ export interface DiscoveryResult {
|
|
|
16
18
|
*/
|
|
17
19
|
export interface ClientConfig {
|
|
18
20
|
authServerUrl?: string;
|
|
19
|
-
userRole?: UserScope;
|
|
20
21
|
extensionId?: string;
|
|
21
22
|
logLevel?: LogLevel;
|
|
22
23
|
discoveryAttempts?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlowType,
|
|
1
|
+
import { FlowType, RequestedResourcesV1, UserScope } from '@bodhiapp/ts-client';
|
|
2
2
|
/**
|
|
3
3
|
* Shared types used by both ext2ext and web2ext clients
|
|
4
4
|
*/
|
|
@@ -16,7 +16,7 @@ export type LoginProgressStage = 'requesting' | 'reviewing' | 'authenticating';
|
|
|
16
16
|
export type LoginProgressCallback = (stage: LoginProgressStage) => void;
|
|
17
17
|
export interface LoginOptions {
|
|
18
18
|
userRole?: UserScope;
|
|
19
|
-
requested?:
|
|
19
|
+
requested?: RequestedResourcesV1;
|
|
20
20
|
flowType?: FlowType;
|
|
21
21
|
redirectUrl?: string;
|
|
22
22
|
onProgress?: LoginProgressCallback;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodhiapp/bodhi-js-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "Core types and interfaces for Bodhi Browser SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/bodhi-core.cjs.js",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"typecheck": "tsc --noEmit"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@bodhiapp/bodhi-browser-types": "0.0.
|
|
60
|
-
"@bodhiapp/setup-modal-types": "0.0.
|
|
61
|
-
"@bodhiapp/ts-client": "0.1.
|
|
59
|
+
"@bodhiapp/bodhi-browser-types": "0.0.30",
|
|
60
|
+
"@bodhiapp/setup-modal-types": "0.0.30",
|
|
61
|
+
"@bodhiapp/ts-client": "0.1.24",
|
|
62
62
|
"ua-parser-js": "^1.0.40"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|