@ethisyscore/extension-runtime 1.87.0 → 1.88.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/mock-host/index.cjs.map +1 -1
- package/dist/mock-host/index.js.map +1 -1
- package/dist/plugin/index.cjs +5 -0
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.d.cts +10 -1
- package/dist/plugin/index.d.ts +10 -1
- package/dist/plugin/index.js +5 -1
- package/dist/plugin/index.js.map +1 -1
- package/package.json +1 -1
package/dist/plugin/index.d.cts
CHANGED
|
@@ -208,6 +208,15 @@ declare function ExtensionRuntimeProvider({ transport, clientPush, identity, rea
|
|
|
208
208
|
* first render rather than producing silent no-ops.
|
|
209
209
|
*/
|
|
210
210
|
declare function useExtensionRuntimeTransport(override?: McpTransport): McpTransport;
|
|
211
|
+
/**
|
|
212
|
+
* Non-throwing variant of {@link useExtensionRuntimeTransport}: returns the
|
|
213
|
+
* resolved transport, or `null` when neither an override nor a provider is
|
|
214
|
+
* present. For optional, fire-and-forget consumers (e.g. an auto-injected
|
|
215
|
+
* org-format sync) that must degrade to a no-op rather than crash a surface that
|
|
216
|
+
* renders without a host transport — a standalone/mock-mode run or an isolated
|
|
217
|
+
* unit test.
|
|
218
|
+
*/
|
|
219
|
+
declare function useOptionalExtensionRuntimeTransport(override?: McpTransport): McpTransport | null;
|
|
211
220
|
|
|
212
221
|
interface UseMcpResourceOptions {
|
|
213
222
|
/**
|
|
@@ -676,4 +685,4 @@ interface UseAuthResult {
|
|
|
676
685
|
*/
|
|
677
686
|
declare function useAuth(transport: McpTransport): UseAuthResult;
|
|
678
687
|
|
|
679
|
-
export { BridgeClientContext, type ClientPushChannel, ClientPushContext, type ClientPushEvent, type ClientPushSubscribeOptions, type CreatePortMcpTransportOptions, type CreateRemoteRootOptions, type DeclarativePluginConfig, type EthisysPluginConfig, ExtensionRuntimeProvider, type ExtensionRuntimeProviderProps, type HostIdentity, HostIdentityContext, type HostIdentityUser, type HostPermission, type ItemsResponse, LocalePayload, McpTransport, PluginRealtimeContext, type PluginRealtimeSource, PortBridgeClient, type PortShim, type RemoteRoot, ThemePayload, type UseAuthResult, type UseClientPushSubscriptionOptions, type UseFrontendSessionTokenResult, type UseMcpQueryOptions, type UseMcpQueryResult, type UseMcpResourceOptions, type UseMcpResourceResult, type UseMcpToolOptions, type UseMcpToolResult, createPortMcpTransport, createRemoteRoot, decodeJwtPayload, defineDeclarativePlugin, defineEthisysPlugin, unwrapItems, useAuth, useBridgeClient, useBridgeLocale, useBridgeTheme, useClientPushSubscription, useExtensionRuntimeTransport, useFrontendSessionToken, useHostIdentity, useMcpQuery, useMcpResource, useMcpTool, usePluginRealtimeSource };
|
|
688
|
+
export { BridgeClientContext, type ClientPushChannel, ClientPushContext, type ClientPushEvent, type ClientPushSubscribeOptions, type CreatePortMcpTransportOptions, type CreateRemoteRootOptions, type DeclarativePluginConfig, type EthisysPluginConfig, ExtensionRuntimeProvider, type ExtensionRuntimeProviderProps, type HostIdentity, HostIdentityContext, type HostIdentityUser, type HostPermission, type ItemsResponse, LocalePayload, McpTransport, PluginRealtimeContext, type PluginRealtimeSource, PortBridgeClient, type PortShim, type RemoteRoot, ThemePayload, type UseAuthResult, type UseClientPushSubscriptionOptions, type UseFrontendSessionTokenResult, type UseMcpQueryOptions, type UseMcpQueryResult, type UseMcpResourceOptions, type UseMcpResourceResult, type UseMcpToolOptions, type UseMcpToolResult, createPortMcpTransport, createRemoteRoot, decodeJwtPayload, defineDeclarativePlugin, defineEthisysPlugin, unwrapItems, useAuth, useBridgeClient, useBridgeLocale, useBridgeTheme, useClientPushSubscription, useExtensionRuntimeTransport, useFrontendSessionToken, useHostIdentity, useMcpQuery, useMcpResource, useMcpTool, useOptionalExtensionRuntimeTransport, usePluginRealtimeSource };
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -208,6 +208,15 @@ declare function ExtensionRuntimeProvider({ transport, clientPush, identity, rea
|
|
|
208
208
|
* first render rather than producing silent no-ops.
|
|
209
209
|
*/
|
|
210
210
|
declare function useExtensionRuntimeTransport(override?: McpTransport): McpTransport;
|
|
211
|
+
/**
|
|
212
|
+
* Non-throwing variant of {@link useExtensionRuntimeTransport}: returns the
|
|
213
|
+
* resolved transport, or `null` when neither an override nor a provider is
|
|
214
|
+
* present. For optional, fire-and-forget consumers (e.g. an auto-injected
|
|
215
|
+
* org-format sync) that must degrade to a no-op rather than crash a surface that
|
|
216
|
+
* renders without a host transport — a standalone/mock-mode run or an isolated
|
|
217
|
+
* unit test.
|
|
218
|
+
*/
|
|
219
|
+
declare function useOptionalExtensionRuntimeTransport(override?: McpTransport): McpTransport | null;
|
|
211
220
|
|
|
212
221
|
interface UseMcpResourceOptions {
|
|
213
222
|
/**
|
|
@@ -676,4 +685,4 @@ interface UseAuthResult {
|
|
|
676
685
|
*/
|
|
677
686
|
declare function useAuth(transport: McpTransport): UseAuthResult;
|
|
678
687
|
|
|
679
|
-
export { BridgeClientContext, type ClientPushChannel, ClientPushContext, type ClientPushEvent, type ClientPushSubscribeOptions, type CreatePortMcpTransportOptions, type CreateRemoteRootOptions, type DeclarativePluginConfig, type EthisysPluginConfig, ExtensionRuntimeProvider, type ExtensionRuntimeProviderProps, type HostIdentity, HostIdentityContext, type HostIdentityUser, type HostPermission, type ItemsResponse, LocalePayload, McpTransport, PluginRealtimeContext, type PluginRealtimeSource, PortBridgeClient, type PortShim, type RemoteRoot, ThemePayload, type UseAuthResult, type UseClientPushSubscriptionOptions, type UseFrontendSessionTokenResult, type UseMcpQueryOptions, type UseMcpQueryResult, type UseMcpResourceOptions, type UseMcpResourceResult, type UseMcpToolOptions, type UseMcpToolResult, createPortMcpTransport, createRemoteRoot, decodeJwtPayload, defineDeclarativePlugin, defineEthisysPlugin, unwrapItems, useAuth, useBridgeClient, useBridgeLocale, useBridgeTheme, useClientPushSubscription, useExtensionRuntimeTransport, useFrontendSessionToken, useHostIdentity, useMcpQuery, useMcpResource, useMcpTool, usePluginRealtimeSource };
|
|
688
|
+
export { BridgeClientContext, type ClientPushChannel, ClientPushContext, type ClientPushEvent, type ClientPushSubscribeOptions, type CreatePortMcpTransportOptions, type CreateRemoteRootOptions, type DeclarativePluginConfig, type EthisysPluginConfig, ExtensionRuntimeProvider, type ExtensionRuntimeProviderProps, type HostIdentity, HostIdentityContext, type HostIdentityUser, type HostPermission, type ItemsResponse, LocalePayload, McpTransport, PluginRealtimeContext, type PluginRealtimeSource, PortBridgeClient, type PortShim, type RemoteRoot, ThemePayload, type UseAuthResult, type UseClientPushSubscriptionOptions, type UseFrontendSessionTokenResult, type UseMcpQueryOptions, type UseMcpQueryResult, type UseMcpResourceOptions, type UseMcpResourceResult, type UseMcpToolOptions, type UseMcpToolResult, createPortMcpTransport, createRemoteRoot, decodeJwtPayload, defineDeclarativePlugin, defineEthisysPlugin, unwrapItems, useAuth, useBridgeClient, useBridgeLocale, useBridgeTheme, useClientPushSubscription, useExtensionRuntimeTransport, useFrontendSessionToken, useHostIdentity, useMcpQuery, useMcpResource, useMcpTool, useOptionalExtensionRuntimeTransport, usePluginRealtimeSource };
|
package/dist/plugin/index.js
CHANGED
|
@@ -54,6 +54,10 @@ function useExtensionRuntimeTransport(override) {
|
|
|
54
54
|
}
|
|
55
55
|
return resolved;
|
|
56
56
|
}
|
|
57
|
+
function useOptionalExtensionRuntimeTransport(override) {
|
|
58
|
+
const fromContext = useContext(ExtensionRuntimeContext);
|
|
59
|
+
return override ?? fromContext ?? null;
|
|
60
|
+
}
|
|
57
61
|
function useMcpResource(uri, opts) {
|
|
58
62
|
const transport = useExtensionRuntimeTransport(opts?.transport);
|
|
59
63
|
const [data, setData] = useState(void 0);
|
|
@@ -895,6 +899,6 @@ function useAuth(transport) {
|
|
|
895
899
|
};
|
|
896
900
|
}
|
|
897
901
|
|
|
898
|
-
export { BridgeClientContext, ClientPushContext, ExtensionRuntimeProvider, HostIdentityContext, MCP_ERROR_CODES, McpToolError, PluginRealtimeContext, classifyHostError, classifyHostResponse, createPortBridgeClient, createPortMcpTransport, createRemoteRoot, decodeJwtPayload, defineDeclarativePlugin, defineEthisysPlugin, isMcpErrorCode, isMcpToolError, isRetryableMcpErrorCode, mcpErrorCodeFromHttpStatus, unwrapItems, useAuth, useBridgeClient, useBridgeLocale, useBridgeTheme, useClientPushSubscription, useExtensionRuntimeTransport, useFrontendSessionToken, useHostIdentity, useMcpQuery, useMcpResource, useMcpTool, usePluginRealtimeSource };
|
|
902
|
+
export { BridgeClientContext, ClientPushContext, ExtensionRuntimeProvider, HostIdentityContext, MCP_ERROR_CODES, McpToolError, PluginRealtimeContext, classifyHostError, classifyHostResponse, createPortBridgeClient, createPortMcpTransport, createRemoteRoot, decodeJwtPayload, defineDeclarativePlugin, defineEthisysPlugin, isMcpErrorCode, isMcpToolError, isRetryableMcpErrorCode, mcpErrorCodeFromHttpStatus, unwrapItems, useAuth, useBridgeClient, useBridgeLocale, useBridgeTheme, useClientPushSubscription, useExtensionRuntimeTransport, useFrontendSessionToken, useHostIdentity, useMcpQuery, useMcpResource, useMcpTool, useOptionalExtensionRuntimeTransport, usePluginRealtimeSource };
|
|
899
903
|
//# sourceMappingURL=index.js.map
|
|
900
904
|
//# sourceMappingURL=index.js.map
|