@bodhiapp/bodhi-js-react-ext 0.0.31 → 0.0.32

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),i=require("@bodhiapp/bodhi-js-ext"),e=require("@bodhiapp/bodhi-js-react-core");function O({children:d,authClientId:n,clientConfig:o,client:t,basePath:u,...l}){if(!t&&!n)throw new Error('BodhiProvider requires either "client" or "authClientId" prop');const r=a.useRef(null),b=a.useMemo(()=>{if(t)return t;if(r.current)return r.current;const c={...o,basePath:o?.basePath??u};return r.current=new i.ExtUIClient(n,c),r.current},[t,n,o,u]);return s.jsx(e.BodhiProvider,{client:b,basePath:u,...l,children:d})}const p="production";Object.defineProperty(exports,"BodhiExtClient",{enumerable:!0,get:()=>i.BodhiExtClient});Object.defineProperty(exports,"EXT_BUILD_MODE",{enumerable:!0,get:()=>i.EXT_BUILD_MODE});Object.defineProperty(exports,"ExtUIClient",{enumerable:!0,get:()=>i.ExtUIClient});Object.defineProperty(exports,"BodhiApiError",{enumerable:!0,get:()=>e.BodhiApiError});Object.defineProperty(exports,"BodhiBadge",{enumerable:!0,get:()=>e.BodhiBadge});Object.defineProperty(exports,"BodhiError",{enumerable:!0,get:()=>e.BodhiError});Object.defineProperty(exports,"BodhiReactContext",{enumerable:!0,get:()=>e.BodhiReactContext});Object.defineProperty(exports,"ClientCtxState",{enumerable:!0,get:()=>e.ClientCtxState});Object.defineProperty(exports,"INITIALIZING_CLIENT_CONTEXT_STATE",{enumerable:!0,get:()=>e.INITIALIZING_CLIENT_CONTEXT_STATE});Object.defineProperty(exports,"INITIAL_CLIENT_CONTEXT_STATE",{enumerable:!0,get:()=>e.INITIAL_CLIENT_CONTEXT_STATE});Object.defineProperty(exports,"LoginOptionsBuilder",{enumerable:!0,get:()=>e.LoginOptionsBuilder});Object.defineProperty(exports,"clientStateToContextState",{enumerable:!0,get:()=>e.clientStateToContextState});Object.defineProperty(exports,"createApiError",{enumerable:!0,get:()=>e.createApiError});Object.defineProperty(exports,"createOperationError",{enumerable:!0,get:()=>e.createOperationError});Object.defineProperty(exports,"isAuthError",{enumerable:!0,get:()=>e.isAuthError});Object.defineProperty(exports,"isAuthLoading",{enumerable:!0,get:()=>e.isAuthLoading});Object.defineProperty(exports,"isAuthenticated",{enumerable:!0,get:()=>e.isAuthenticated});Object.defineProperty(exports,"isClientCtxInitialized",{enumerable:!0,get:()=>e.isClientCtxInitialized});Object.defineProperty(exports,"isClientCtxInitializing",{enumerable:!0,get:()=>e.isClientCtxInitializing});Object.defineProperty(exports,"isClientCtxNotInitialized",{enumerable:!0,get:()=>e.isClientCtxNotInitialized});Object.defineProperty(exports,"isClientCtxReady",{enumerable:!0,get:()=>e.isClientCtxReady});Object.defineProperty(exports,"isClientReady",{enumerable:!0,get:()=>e.isClientReady});Object.defineProperty(exports,"isDirectState",{enumerable:!0,get:()=>e.isDirectState});Object.defineProperty(exports,"isExtensionState",{enumerable:!0,get:()=>e.isExtensionState});Object.defineProperty(exports,"isOverallReady",{enumerable:!0,get:()=>e.isOverallReady});Object.defineProperty(exports,"isWebUIClient",{enumerable:!0,get:()=>e.isWebUIClient});Object.defineProperty(exports,"unwrapResponse",{enumerable:!0,get:()=>e.unwrapResponse});Object.defineProperty(exports,"useBodhi",{enumerable:!0,get:()=>e.useBodhi});exports.BodhiProvider=O;exports.REACT_EXT_BUILD_MODE=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),i=require("@bodhiapp/bodhi-js-ext"),e=require("@bodhiapp/bodhi-js-react-core");function O({children:d,authClientId:n,clientConfig:o,client:t,basePath:u,...l}){if(!t&&!n)throw new Error('BodhiProvider requires either "client" or "authClientId" prop');const r=a.useRef(null),b=a.useMemo(()=>{if(t)return t;if(r.current)return r.current;const c={...o,basePath:o?.basePath??u};return r.current=new i.ExtUIClient(n,c),r.current},[t,n,o,u]);return s.jsx(e.BodhiProvider,{client:b,basePath:u,...l,children:d})}const p="production";Object.defineProperty(exports,"BodhiExtClient",{enumerable:!0,get:()=>i.BodhiExtClient});Object.defineProperty(exports,"EXT_BUILD_MODE",{enumerable:!0,get:()=>i.EXT_BUILD_MODE});Object.defineProperty(exports,"ExtUIClient",{enumerable:!0,get:()=>i.ExtUIClient});Object.defineProperty(exports,"BodhiApiError",{enumerable:!0,get:()=>e.BodhiApiError});Object.defineProperty(exports,"BodhiBadge",{enumerable:!0,get:()=>e.BodhiBadge});Object.defineProperty(exports,"BodhiError",{enumerable:!0,get:()=>e.BodhiError});Object.defineProperty(exports,"BodhiReactContext",{enumerable:!0,get:()=>e.BodhiReactContext});Object.defineProperty(exports,"ClientCtxState",{enumerable:!0,get:()=>e.ClientCtxState});Object.defineProperty(exports,"INITIALIZING_CLIENT_CONTEXT_STATE",{enumerable:!0,get:()=>e.INITIALIZING_CLIENT_CONTEXT_STATE});Object.defineProperty(exports,"INITIAL_CLIENT_CONTEXT_STATE",{enumerable:!0,get:()=>e.INITIAL_CLIENT_CONTEXT_STATE});Object.defineProperty(exports,"InMemoryStorage",{enumerable:!0,get:()=>e.InMemoryStorage});Object.defineProperty(exports,"LoginOptionsBuilder",{enumerable:!0,get:()=>e.LoginOptionsBuilder});Object.defineProperty(exports,"clientStateToContextState",{enumerable:!0,get:()=>e.clientStateToContextState});Object.defineProperty(exports,"createApiError",{enumerable:!0,get:()=>e.createApiError});Object.defineProperty(exports,"createOperationError",{enumerable:!0,get:()=>e.createOperationError});Object.defineProperty(exports,"isAuthError",{enumerable:!0,get:()=>e.isAuthError});Object.defineProperty(exports,"isAuthLoading",{enumerable:!0,get:()=>e.isAuthLoading});Object.defineProperty(exports,"isAuthenticated",{enumerable:!0,get:()=>e.isAuthenticated});Object.defineProperty(exports,"isClientCtxInitialized",{enumerable:!0,get:()=>e.isClientCtxInitialized});Object.defineProperty(exports,"isClientCtxInitializing",{enumerable:!0,get:()=>e.isClientCtxInitializing});Object.defineProperty(exports,"isClientCtxNotInitialized",{enumerable:!0,get:()=>e.isClientCtxNotInitialized});Object.defineProperty(exports,"isClientCtxReady",{enumerable:!0,get:()=>e.isClientCtxReady});Object.defineProperty(exports,"isClientReady",{enumerable:!0,get:()=>e.isClientReady});Object.defineProperty(exports,"isDirectState",{enumerable:!0,get:()=>e.isDirectState});Object.defineProperty(exports,"isExtensionState",{enumerable:!0,get:()=>e.isExtensionState});Object.defineProperty(exports,"isOverallReady",{enumerable:!0,get:()=>e.isOverallReady});Object.defineProperty(exports,"isWebUIClient",{enumerable:!0,get:()=>e.isWebUIClient});Object.defineProperty(exports,"unwrapResponse",{enumerable:!0,get:()=>e.unwrapResponse});Object.defineProperty(exports,"useBodhi",{enumerable:!0,get:()=>e.useBodhi});exports.BodhiProvider=O;exports.REACT_EXT_BUILD_MODE=p;
@@ -1,53 +1,54 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
- import { useRef as c, useMemo as d } from "react";
3
- import { ExtUIClient as I } from "@bodhiapp/bodhi-js-ext";
2
+ import { useRef as I, useMemo as c } from "react";
3
+ import { ExtUIClient as d } from "@bodhiapp/bodhi-js-ext";
4
4
  import { BodhiExtClient as f, EXT_BUILD_MODE as A, ExtUIClient as L } from "@bodhiapp/bodhi-js-ext";
5
5
  import { BodhiProvider as l } from "@bodhiapp/bodhi-js-react-core";
6
- import { BodhiApiError as O, BodhiBadge as R, BodhiError as D, BodhiReactContext as S, ClientCtxState as U, INITIALIZING_CLIENT_CONTEXT_STATE as g, INITIAL_CLIENT_CONTEXT_STATE as w, LoginOptionsBuilder as M, clientStateToContextState as P, createApiError as X, createOperationError as y, isAuthError as z, isAuthLoading as v, isAuthenticated as b, isClientCtxInitialized as j, isClientCtxInitializing as q, isClientCtxNotInitialized as G, isClientCtxReady as W, isClientReady as Z, isDirectState as $, isExtensionState as k, isOverallReady as F, isWebUIClient as H, unwrapResponse as J, useBodhi as K } from "@bodhiapp/bodhi-js-react-core";
6
+ import { BodhiApiError as O, BodhiBadge as R, BodhiError as S, BodhiReactContext as D, ClientCtxState as U, INITIALIZING_CLIENT_CONTEXT_STATE as g, INITIAL_CLIENT_CONTEXT_STATE as M, InMemoryStorage as w, LoginOptionsBuilder as y, clientStateToContextState as P, createApiError as X, createOperationError as z, isAuthError as v, isAuthLoading as b, isAuthenticated as j, isClientCtxInitialized as q, isClientCtxInitializing as G, isClientCtxNotInitialized as W, isClientCtxReady as Z, isClientReady as $, isDirectState as k, isExtensionState as F, isOverallReady as H, isWebUIClient as J, unwrapResponse as K, useBodhi as Q } from "@bodhiapp/bodhi-js-react-core";
7
7
  function h({ children: n, authClientId: e, clientConfig: i, client: t, basePath: o, ...s }) {
8
8
  if (!t && !e)
9
9
  throw new Error('BodhiProvider requires either "client" or "authClientId" prop');
10
- const r = c(null), E = d(() => {
10
+ const r = I(null), a = c(() => {
11
11
  if (t) return t;
12
12
  if (r.current) return r.current;
13
- const a = {
13
+ const E = {
14
14
  ...i,
15
15
  basePath: i?.basePath ?? o
16
16
  };
17
- return r.current = new I(e, a), r.current;
17
+ return r.current = new d(e, E), r.current;
18
18
  }, [t, e, i, o]);
19
- return /* @__PURE__ */ u(l, { client: E, basePath: o, ...s, children: n });
19
+ return /* @__PURE__ */ u(l, { client: a, basePath: o, ...s, children: n });
20
20
  }
21
- const p = "production";
21
+ const m = "production";
22
22
  export {
23
23
  O as BodhiApiError,
24
24
  R as BodhiBadge,
25
- D as BodhiError,
25
+ S as BodhiError,
26
26
  f as BodhiExtClient,
27
27
  h as BodhiProvider,
28
- S as BodhiReactContext,
28
+ D as BodhiReactContext,
29
29
  U as ClientCtxState,
30
30
  A as EXT_BUILD_MODE,
31
31
  L as ExtUIClient,
32
32
  g as INITIALIZING_CLIENT_CONTEXT_STATE,
33
- w as INITIAL_CLIENT_CONTEXT_STATE,
34
- M as LoginOptionsBuilder,
35
- p as REACT_EXT_BUILD_MODE,
33
+ M as INITIAL_CLIENT_CONTEXT_STATE,
34
+ w as InMemoryStorage,
35
+ y as LoginOptionsBuilder,
36
+ m as REACT_EXT_BUILD_MODE,
36
37
  P as clientStateToContextState,
37
38
  X as createApiError,
38
- y as createOperationError,
39
- z as isAuthError,
40
- v as isAuthLoading,
41
- b as isAuthenticated,
42
- j as isClientCtxInitialized,
43
- q as isClientCtxInitializing,
44
- G as isClientCtxNotInitialized,
45
- W as isClientCtxReady,
46
- Z as isClientReady,
47
- $ as isDirectState,
48
- k as isExtensionState,
49
- F as isOverallReady,
50
- H as isWebUIClient,
51
- J as unwrapResponse,
52
- K as useBodhi
39
+ z as createOperationError,
40
+ v as isAuthError,
41
+ b as isAuthLoading,
42
+ j as isAuthenticated,
43
+ q as isClientCtxInitialized,
44
+ G as isClientCtxInitializing,
45
+ W as isClientCtxNotInitialized,
46
+ Z as isClientCtxReady,
47
+ $ as isClientReady,
48
+ k as isDirectState,
49
+ F as isExtensionState,
50
+ H as isOverallReady,
51
+ J as isWebUIClient,
52
+ K as unwrapResponse,
53
+ Q as useBodhi
53
54
  };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,6 @@
6
6
  */
7
7
  export { BodhiProvider, type BodhiProviderProps } from './BodhiProvider';
8
8
  export { ExtUIClient, type ExtUIClientParams, BodhiExtClient } from '@bodhiapp/bodhi-js-ext';
9
- export { BodhiReactContext, useBodhi, type BodhiContext, type SetupState, type ClientContextState, type ClientContextStatus, INITIAL_CLIENT_CONTEXT_STATE, INITIALIZING_CLIENT_CONTEXT_STATE, ClientCtxState, clientStateToContextState, isClientCtxInitialized, isClientCtxInitializing, isClientCtxNotInitialized, isClientCtxReady, isOverallReady, type ClientState, type AuthState, type LoginOptions, type LoginProgressCallback, type LoginProgressStage, type UserScope, type FlowType, type RequestedResourcesV1, type UIClient, type LogLevel, type BodhiErrorCode, type ApiResponse, LoginOptionsBuilder, BodhiError, BodhiApiError, unwrapResponse, isDirectState, isExtensionState, isWebUIClient, isAuthError, isAuthLoading, isAuthenticated, isClientReady, createApiError, createOperationError, BodhiBadge, type BodhiBadgeProps, type BodhiBadgeSize, type BodhiBadgeVariant, } from '@bodhiapp/bodhi-js-react-core';
9
+ export { BodhiReactContext, useBodhi, type BodhiContext, type SetupState, type ClientContextState, type ClientContextStatus, INITIAL_CLIENT_CONTEXT_STATE, INITIALIZING_CLIENT_CONTEXT_STATE, ClientCtxState, clientStateToContextState, isClientCtxInitialized, isClientCtxInitializing, isClientCtxNotInitialized, isClientCtxReady, isOverallReady, type ClientState, type AuthState, type LoginOptions, type LoginProgressCallback, type LoginProgressStage, type UserScope, type FlowType, type RequestedResourcesV1, type UIClient, type LogLevel, type BodhiErrorCode, type ApiResponse, LoginOptionsBuilder, BodhiError, BodhiApiError, unwrapResponse, isDirectState, isExtensionState, isWebUIClient, isAuthError, isAuthLoading, isAuthenticated, isClientReady, createApiError, createOperationError, BodhiBadge, type BodhiBadgeProps, type BodhiBadgeSize, type BodhiBadgeVariant, InMemoryStorage, type IStorage, type InitialTokens, type StreamTextResult, } from '@bodhiapp/bodhi-js-react-core';
10
10
  export { BUILD_MODE as REACT_EXT_BUILD_MODE } from './build-info';
11
11
  export { EXT_BUILD_MODE } from '@bodhiapp/bodhi-js-ext';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@bodhiapp/bodhi-js-core/mcp");Object.defineProperty(exports,"createMcpClient",{enumerable:!0,get:()=>e.createMcpClient});
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { createMcpClient } from '@bodhiapp/bodhi-js-core/mcp';
2
+ export type { CreateMcpClientOptions, McpTransportProvider } from '@bodhiapp/bodhi-js-core/mcp';
@@ -0,0 +1,4 @@
1
+ import { createMcpClient as t } from "@bodhiapp/bodhi-js-core/mcp";
2
+ export {
3
+ t as createMcpClient
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bodhiapp/bodhi-js-react-ext",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "React bindings for Bodhi Browser SDK with ExtUIClient preset (Chrome Extension)",
5
5
  "type": "module",
6
6
  "main": "dist/bodhi-react-ext.cjs.js",
@@ -15,6 +15,11 @@
15
15
  "types": "./dist/api/index.d.ts",
16
16
  "import": "./dist/api/index.esm.js",
17
17
  "require": "./dist/api/index.cjs.js"
18
+ },
19
+ "./mcp": {
20
+ "types": "./dist/mcp.d.ts",
21
+ "import": "./dist/mcp.esm.js",
22
+ "require": "./dist/mcp.cjs.js"
18
23
  }
19
24
  },
20
25
  "files": [
@@ -42,10 +47,10 @@
42
47
  "typecheck": "tsc --noEmit"
43
48
  },
44
49
  "dependencies": {
45
- "@bodhiapp/bodhi-browser-types": "0.0.31",
46
- "@bodhiapp/setup-modal-types": "0.0.31",
47
- "@bodhiapp/bodhi-js-react-core": "0.0.31",
48
- "@bodhiapp/bodhi-js-ext": "0.0.31"
50
+ "@bodhiapp/bodhi-browser-types": "0.0.32",
51
+ "@bodhiapp/setup-modal-types": "0.0.32",
52
+ "@bodhiapp/bodhi-js-react-core": "0.0.32",
53
+ "@bodhiapp/bodhi-js-ext": "0.0.32"
49
54
  },
50
55
  "peerDependencies": {
51
56
  "react": "^18.3.0 || ^19.0.0"