@ethisyscore/extension-runtime 1.123.0 → 1.125.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/{bridge-client-D0fogVGd.d.cts → bridge-client-D9EYFq1l.d.cts} +1 -1
- package/dist/{bridge-client-tIK_iYT9.d.ts → bridge-client-RJOl8WlU.d.ts} +1 -1
- package/dist/{bridge-envelopes-DAuew-fU.d.cts → bridge-envelopes-M5a42rAy.d.cts} +24 -1
- package/dist/{bridge-envelopes-DAuew-fU.d.ts → bridge-envelopes-M5a42rAy.d.ts} +24 -1
- package/dist/host/index.cjs +7 -1
- package/dist/host/index.cjs.map +1 -1
- package/dist/host/index.d.cts +3 -3
- package/dist/host/index.d.ts +3 -3
- package/dist/host/index.js +7 -1
- package/dist/host/index.js.map +1 -1
- package/dist/mock-host/cli.cjs +8 -1
- package/dist/mock-host/cli.cjs.map +1 -1
- package/dist/mock-host/cli.d.cts +2 -2
- package/dist/mock-host/cli.d.ts +2 -2
- package/dist/mock-host/cli.js +8 -1
- package/dist/mock-host/cli.js.map +1 -1
- package/dist/mock-host/index.d.cts +2 -2
- package/dist/mock-host/index.d.ts +2 -2
- package/dist/plugin/index.cjs +17 -10
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.d.cts +46 -6
- package/dist/plugin/index.d.ts +46 -6
- package/dist/plugin/index.js +17 -10
- package/dist/plugin/index.js.map +1 -1
- package/dist/{transport-DDPhdaXn.d.cts → transport-CFzJQiFG.d.ts} +16 -1
- package/dist/{transport-pNTjXJ3R.d.ts → transport-UaoDRdm3.d.cts} +16 -1
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
2
|
import { C as ComponentRegistry } from '../registry-DpCx_LxF.cjs';
|
|
3
3
|
import { SduiNode } from '@ethisyscore/protocol';
|
|
4
|
-
import { M as McpTransport, U as UploadDocumentMeta, f as UploadDocumentResult } from '../bridge-envelopes-
|
|
5
|
-
import { P as PortBridgeClient, T as ThemePayload, L as LocalePayload, D as DensityPayload, A as A11yPayload, N as NavPayload, S as SessionTokenPayload } from '../bridge-client-
|
|
4
|
+
import { M as McpTransport, U as UploadDocumentMeta, f as UploadDocumentResult } from '../bridge-envelopes-M5a42rAy.cjs';
|
|
5
|
+
import { P as PortBridgeClient, T as ThemePayload, L as LocalePayload, D as DensityPayload, A as A11yPayload, N as NavPayload, S as SessionTokenPayload } from '../bridge-client-D9EYFq1l.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Handler for a mocked tool invocation. The handler receives the request
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
2
|
import { C as ComponentRegistry } from '../registry-DpCx_LxF.js';
|
|
3
3
|
import { SduiNode } from '@ethisyscore/protocol';
|
|
4
|
-
import { M as McpTransport, U as UploadDocumentMeta, f as UploadDocumentResult } from '../bridge-envelopes-
|
|
5
|
-
import { P as PortBridgeClient, T as ThemePayload, L as LocalePayload, D as DensityPayload, A as A11yPayload, N as NavPayload, S as SessionTokenPayload } from '../bridge-client-
|
|
4
|
+
import { M as McpTransport, U as UploadDocumentMeta, f as UploadDocumentResult } from '../bridge-envelopes-M5a42rAy.js';
|
|
5
|
+
import { P as PortBridgeClient, T as ThemePayload, L as LocalePayload, D as DensityPayload, A as A11yPayload, N as NavPayload, S as SessionTokenPayload } from '../bridge-client-RJOl8WlU.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Handler for a mocked tool invocation. The handler receives the request
|
package/dist/plugin/index.cjs
CHANGED
|
@@ -78,7 +78,7 @@ function useModuleTool(moduleKey, operationKey, fallbackToolName, opts) {
|
|
|
78
78
|
};
|
|
79
79
|
}, []);
|
|
80
80
|
const invoke = react.useCallback(
|
|
81
|
-
async (req) => {
|
|
81
|
+
async (req, fallbackReq) => {
|
|
82
82
|
const controller = new AbortController();
|
|
83
83
|
controllerRef.current?.abort();
|
|
84
84
|
controllerRef.current = controller;
|
|
@@ -97,7 +97,8 @@ function useModuleTool(moduleKey, operationKey, fallbackToolName, opts) {
|
|
|
97
97
|
operationKey,
|
|
98
98
|
fallbackToolName,
|
|
99
99
|
req,
|
|
100
|
-
controller.signal
|
|
100
|
+
controller.signal,
|
|
101
|
+
fallbackReq
|
|
101
102
|
);
|
|
102
103
|
if (mountedRef.current && !controller.signal.aborted) {
|
|
103
104
|
setLoading(false);
|
|
@@ -118,12 +119,13 @@ function useModuleTool(moduleKey, operationKey, fallbackToolName, opts) {
|
|
|
118
119
|
}
|
|
119
120
|
function useModuleQuery(moduleKey, operationKey, fallbackToolName, args, options) {
|
|
120
121
|
const enabled = options?.enabled ?? true;
|
|
122
|
+
const fallbackArgs = options?.fallbackArgs;
|
|
121
123
|
const { invoke } = useModuleTool(moduleKey, operationKey, fallbackToolName);
|
|
122
124
|
const [data, setData] = react.useState(void 0);
|
|
123
125
|
const [loading, setLoading] = react.useState(enabled);
|
|
124
126
|
const [error, setError] = react.useState(void 0);
|
|
125
127
|
const [tick, setTick] = react.useState(0);
|
|
126
|
-
const argsKey = JSON.stringify(args);
|
|
128
|
+
const argsKey = JSON.stringify([args, fallbackArgs]);
|
|
127
129
|
react.useEffect(() => {
|
|
128
130
|
if (!enabled) {
|
|
129
131
|
setLoading(false);
|
|
@@ -131,7 +133,7 @@ function useModuleQuery(moduleKey, operationKey, fallbackToolName, args, options
|
|
|
131
133
|
}
|
|
132
134
|
let cancelled = false;
|
|
133
135
|
setLoading(true);
|
|
134
|
-
invoke(args).then((result) => {
|
|
136
|
+
invoke(args, fallbackArgs).then((result) => {
|
|
135
137
|
if (cancelled) {
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
@@ -737,12 +739,17 @@ function createPortMcpTransport(port, options = {}) {
|
|
|
737
739
|
const data = await send(WIRE_INVOKE_TOOL_REQUEST, { name, args }, signal);
|
|
738
740
|
return data;
|
|
739
741
|
},
|
|
740
|
-
async invokeOperation(moduleKey, operationKey, fallbackToolName, args, signal) {
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
742
|
+
async invokeOperation(moduleKey, operationKey, fallbackToolName, args, signal, fallbackArgs) {
|
|
743
|
+
const body = {
|
|
744
|
+
moduleKey,
|
|
745
|
+
operationKey,
|
|
746
|
+
fallbackToolName,
|
|
747
|
+
args
|
|
748
|
+
};
|
|
749
|
+
if (fallbackArgs !== void 0) {
|
|
750
|
+
body.fallbackArgs = fallbackArgs;
|
|
751
|
+
}
|
|
752
|
+
const data = await send(WIRE_INVOKE_OPERATION_REQUEST, body, signal);
|
|
746
753
|
return data;
|
|
747
754
|
},
|
|
748
755
|
async uploadDocument(meta, buffer, signal) {
|