@ethisyscore/extension-runtime 1.116.1 → 1.118.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/host/index.cjs +90 -1
- package/dist/host/index.cjs.map +1 -1
- package/dist/host/index.d.cts +10 -2
- package/dist/host/index.d.ts +10 -2
- package/dist/host/index.js +90 -1
- package/dist/host/index.js.map +1 -1
- package/dist/mock-host/cli.cjs +50 -1
- package/dist/mock-host/cli.cjs.map +1 -1
- package/dist/mock-host/cli.d.cts +1 -1
- package/dist/mock-host/cli.d.ts +1 -1
- package/dist/mock-host/cli.js +50 -1
- package/dist/mock-host/cli.js.map +1 -1
- package/dist/plugin/index.cjs +11 -1
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.js +11 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/{transport-Cjpb_qPo.d.cts → transport-DDPhdaXn.d.cts} +28 -0
- package/dist/{transport-B9mwIXYs.d.ts → transport-pNTjXJ3R.d.ts} +28 -0
- package/package.json +2 -2
package/dist/host/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { C as ComponentRegistry } from '../registry-DpCx_LxF.cjs';
|
|
|
3
3
|
export { P as PrimitiveProps } from '../registry-DpCx_LxF.cjs';
|
|
4
4
|
import { SduiNode } from '@ethisyscore/protocol';
|
|
5
5
|
export { PrimitiveName, SduiNode } from '@ethisyscore/protocol';
|
|
6
|
-
import { M as McpHttpClient, f as VersionSkew } from '../transport-
|
|
7
|
-
export { C as CAPABILITY_REJECTION_REASON_HEADER, D as DEFAULT_MAX_CONCURRENT_MCP_REQUESTS, E as EXTENSION_ACTIVE_VERSION_HEADER, a as EXTENSION_VERSION_HEADER, I as InputEventPayload, b as McpHttpRequest, c as McpHttpResponse, d as McpResponseMetadata, e as McpUploadRequest, V as VERSION_MISMATCH_REASON, g as VersionSkewSource, W as WORKER_TRANSPORT_PROTOCOL, h as WorkerCtor, i as WorkerHandshakePayload, j as WorkerLike, k as WorkerRemoteDomTransport, l as WorkerRemoteDomTransportOptions, m as detectVersionSkew } from '../transport-
|
|
6
|
+
import { M as McpHttpClient, f as VersionSkew } from '../transport-DDPhdaXn.cjs';
|
|
7
|
+
export { C as CAPABILITY_REJECTION_REASON_HEADER, D as DEFAULT_MAX_CONCURRENT_MCP_REQUESTS, E as EXTENSION_ACTIVE_VERSION_HEADER, a as EXTENSION_VERSION_HEADER, I as InputEventPayload, b as McpHttpRequest, c as McpHttpResponse, d as McpResponseMetadata, e as McpUploadRequest, V as VERSION_MISMATCH_REASON, g as VersionSkewSource, W as WORKER_TRANSPORT_PROTOCOL, h as WorkerCtor, i as WorkerHandshakePayload, j as WorkerLike, k as WorkerRemoteDomTransport, l as WorkerRemoteDomTransportOptions, m as detectVersionSkew } from '../transport-DDPhdaXn.cjs';
|
|
8
8
|
export { RemoteReceiver, RemoteReceiverComment, RemoteReceiverElement, RemoteReceiverNode, RemoteReceiverParent, RemoteReceiverRoot, RemoteReceiverText } from '@remote-dom/core/receivers';
|
|
9
9
|
export { RemoteComponentRendererMap, RemoteComponentRendererProps, RemoteRootRenderer, RemoteRootRendererProps, createRemoteComponentRenderer } from '@remote-dom/react/host';
|
|
10
10
|
export { M as MCP_ERROR_CODES, a as McpErrorCode, b as McpToolError, c as classifyHostError, d as classifyHostResponse, i as isMcpErrorCode, e as isMcpToolError, f as isRetryableMcpErrorCode, m as mcpErrorCodeFromHttpStatus } from '../mcp-error-CCZQd8Xl.cjs';
|
|
@@ -358,6 +358,14 @@ declare class IframeBridgeTransport {
|
|
|
358
358
|
private handlePortMessage;
|
|
359
359
|
private isRateLimited;
|
|
360
360
|
private dispatchMcp;
|
|
361
|
+
/**
|
|
362
|
+
* The module-address twin of {@link handleInvokeTool}: same token mint, same
|
|
363
|
+
* disposed-before-token short circuit, same rule that no token ever rides the reply. Kept as its
|
|
364
|
+
* own method rather than a branch inside invokeTool, because the two differ only in the request
|
|
365
|
+
* they build and a shared body would put that branch in the one place where mishandling the
|
|
366
|
+
* token is unrecoverable.
|
|
367
|
+
*/
|
|
368
|
+
private handleInvokeOperation;
|
|
361
369
|
private handleInvokeTool;
|
|
362
370
|
/**
|
|
363
371
|
* Raises the skew callback the first time this surface is seen to be running against a version
|
package/dist/host/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { C as ComponentRegistry } from '../registry-DpCx_LxF.js';
|
|
|
3
3
|
export { P as PrimitiveProps } from '../registry-DpCx_LxF.js';
|
|
4
4
|
import { SduiNode } from '@ethisyscore/protocol';
|
|
5
5
|
export { PrimitiveName, SduiNode } from '@ethisyscore/protocol';
|
|
6
|
-
import { M as McpHttpClient, f as VersionSkew } from '../transport-
|
|
7
|
-
export { C as CAPABILITY_REJECTION_REASON_HEADER, D as DEFAULT_MAX_CONCURRENT_MCP_REQUESTS, E as EXTENSION_ACTIVE_VERSION_HEADER, a as EXTENSION_VERSION_HEADER, I as InputEventPayload, b as McpHttpRequest, c as McpHttpResponse, d as McpResponseMetadata, e as McpUploadRequest, V as VERSION_MISMATCH_REASON, g as VersionSkewSource, W as WORKER_TRANSPORT_PROTOCOL, h as WorkerCtor, i as WorkerHandshakePayload, j as WorkerLike, k as WorkerRemoteDomTransport, l as WorkerRemoteDomTransportOptions, m as detectVersionSkew } from '../transport-
|
|
6
|
+
import { M as McpHttpClient, f as VersionSkew } from '../transport-pNTjXJ3R.js';
|
|
7
|
+
export { C as CAPABILITY_REJECTION_REASON_HEADER, D as DEFAULT_MAX_CONCURRENT_MCP_REQUESTS, E as EXTENSION_ACTIVE_VERSION_HEADER, a as EXTENSION_VERSION_HEADER, I as InputEventPayload, b as McpHttpRequest, c as McpHttpResponse, d as McpResponseMetadata, e as McpUploadRequest, V as VERSION_MISMATCH_REASON, g as VersionSkewSource, W as WORKER_TRANSPORT_PROTOCOL, h as WorkerCtor, i as WorkerHandshakePayload, j as WorkerLike, k as WorkerRemoteDomTransport, l as WorkerRemoteDomTransportOptions, m as detectVersionSkew } from '../transport-pNTjXJ3R.js';
|
|
8
8
|
export { RemoteReceiver, RemoteReceiverComment, RemoteReceiverElement, RemoteReceiverNode, RemoteReceiverParent, RemoteReceiverRoot, RemoteReceiverText } from '@remote-dom/core/receivers';
|
|
9
9
|
export { RemoteComponentRendererMap, RemoteComponentRendererProps, RemoteRootRenderer, RemoteRootRendererProps, createRemoteComponentRenderer } from '@remote-dom/react/host';
|
|
10
10
|
export { M as MCP_ERROR_CODES, a as McpErrorCode, b as McpToolError, c as classifyHostError, d as classifyHostResponse, i as isMcpErrorCode, e as isMcpToolError, f as isRetryableMcpErrorCode, m as mcpErrorCodeFromHttpStatus } from '../mcp-error-CCZQd8Xl.js';
|
|
@@ -358,6 +358,14 @@ declare class IframeBridgeTransport {
|
|
|
358
358
|
private handlePortMessage;
|
|
359
359
|
private isRateLimited;
|
|
360
360
|
private dispatchMcp;
|
|
361
|
+
/**
|
|
362
|
+
* The module-address twin of {@link handleInvokeTool}: same token mint, same
|
|
363
|
+
* disposed-before-token short circuit, same rule that no token ever rides the reply. Kept as its
|
|
364
|
+
* own method rather than a branch inside invokeTool, because the two differ only in the request
|
|
365
|
+
* they build and a shared body would put that branch in the one place where mishandling the
|
|
366
|
+
* token is unrecoverable.
|
|
367
|
+
*/
|
|
368
|
+
private handleInvokeOperation;
|
|
361
369
|
private handleInvokeTool;
|
|
362
370
|
/**
|
|
363
371
|
* Raises the skew callback the first time this surface is seen to be running against a version
|
package/dist/host/index.js
CHANGED
|
@@ -683,6 +683,9 @@ var WorkerRemoteDomTransport = class {
|
|
|
683
683
|
case "ethisys:mcp:invokeTool":
|
|
684
684
|
this.dispatchMcp(message, "ethisys:mcp:invokeTool:result", (m) => this.handleInvokeTool(m));
|
|
685
685
|
return;
|
|
686
|
+
case "ethisys:mcp:invokeOperation":
|
|
687
|
+
this.dispatchMcp(message, "ethisys:mcp:invokeOperation:result", (m) => this.handleInvokeOperation(m));
|
|
688
|
+
return;
|
|
686
689
|
case "ethisys:mcp:getResource":
|
|
687
690
|
this.dispatchMcp(message, "ethisys:mcp:getResource:result", (m) => this.handleGetResource(m));
|
|
688
691
|
return;
|
|
@@ -780,6 +783,47 @@ var WorkerRemoteDomTransport = class {
|
|
|
780
783
|
} catch {
|
|
781
784
|
}
|
|
782
785
|
}
|
|
786
|
+
/**
|
|
787
|
+
* The module-address twin of {@link handleInvokeTool}. Identical in every respect a reader
|
|
788
|
+
* should care about - same token mint, same disposed-before-token short circuit, same
|
|
789
|
+
* token-never-crosses-the-port rule - and deliberately NOT folded into one method with a
|
|
790
|
+
* branch: the two differ only in the request kind they build, and a shared method would put
|
|
791
|
+
* that branch inside the one place where getting the token handling wrong is unrecoverable.
|
|
792
|
+
*/
|
|
793
|
+
async handleInvokeOperation(message) {
|
|
794
|
+
let token;
|
|
795
|
+
try {
|
|
796
|
+
token = await this.capabilityTokenProvider();
|
|
797
|
+
} catch (err) {
|
|
798
|
+
this.replyError(message.id, "ethisys:mcp:invokeOperation:result", err);
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
if (this.disposed) {
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
try {
|
|
805
|
+
const result = await this.mcpClient.fetch({
|
|
806
|
+
kind: "invokeOperation",
|
|
807
|
+
moduleKey: message.moduleKey,
|
|
808
|
+
operationKey: message.operationKey,
|
|
809
|
+
fallbackToolName: message.fallbackToolName,
|
|
810
|
+
args: message.args,
|
|
811
|
+
capabilityToken: token,
|
|
812
|
+
signal: this.requestSignal(message.id)
|
|
813
|
+
});
|
|
814
|
+
this.reportVersionSkew(result);
|
|
815
|
+
this.safePostMessage({
|
|
816
|
+
id: message.id,
|
|
817
|
+
type: "ethisys:mcp:invokeOperation:result",
|
|
818
|
+
ok: result.ok,
|
|
819
|
+
data: result.data,
|
|
820
|
+
error: result.error,
|
|
821
|
+
code: classifyHostResponse(result)
|
|
822
|
+
});
|
|
823
|
+
} catch (err) {
|
|
824
|
+
this.replyError(message.id, "ethisys:mcp:invokeOperation:result", err);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
783
827
|
async handleInvokeTool(message) {
|
|
784
828
|
let token;
|
|
785
829
|
try {
|
|
@@ -892,6 +936,7 @@ var WorkerRemoteDomTransport = class {
|
|
|
892
936
|
var IFRAME_BRIDGE_PROTOCOL = "ethisys.iframe.bridge.v1";
|
|
893
937
|
var InboundEnvelope = z.discriminatedUnion("type", [
|
|
894
938
|
z.object({ type: z.literal("ethisys:mcp:invokeTool"), id: z.string().min(1), name: z.string().min(1), args: z.unknown(), nonce: z.string() }),
|
|
939
|
+
z.object({ type: z.literal("ethisys:mcp:invokeOperation"), id: z.string().min(1), moduleKey: z.string().min(1), operationKey: z.string().min(1), fallbackToolName: z.string().min(1), args: z.unknown(), nonce: z.string() }),
|
|
895
940
|
z.object({ type: z.literal("ethisys:mcp:getResource"), id: z.string().min(1), uri: z.string().min(1), nonce: z.string() }),
|
|
896
941
|
z.object({ type: z.literal("ethisys:event"), name: z.string().min(1), payload: z.unknown(), nonce: z.string() })
|
|
897
942
|
]);
|
|
@@ -1019,7 +1064,7 @@ var IframeBridgeTransport = class {
|
|
|
1019
1064
|
}
|
|
1020
1065
|
if (this.isRateLimited()) {
|
|
1021
1066
|
this.onSecurityEvent?.({ reason: "rate-limit-exceeded", type: message.type });
|
|
1022
|
-
if (message.type === "ethisys:mcp:invokeTool" || message.type === "ethisys:mcp:getResource") {
|
|
1067
|
+
if (message.type === "ethisys:mcp:invokeTool" || message.type === "ethisys:mcp:invokeOperation" || message.type === "ethisys:mcp:getResource") {
|
|
1023
1068
|
this.safePostMessage({
|
|
1024
1069
|
id: message.id,
|
|
1025
1070
|
type: `${message.type}:result`,
|
|
@@ -1033,6 +1078,9 @@ var IframeBridgeTransport = class {
|
|
|
1033
1078
|
case "ethisys:mcp:invokeTool":
|
|
1034
1079
|
this.dispatchMcp(message, "ethisys:mcp:invokeTool:result", (m) => this.handleInvokeTool(m));
|
|
1035
1080
|
return;
|
|
1081
|
+
case "ethisys:mcp:invokeOperation":
|
|
1082
|
+
this.dispatchMcp(message, "ethisys:mcp:invokeOperation:result", (m) => this.handleInvokeOperation(m));
|
|
1083
|
+
return;
|
|
1036
1084
|
case "ethisys:mcp:getResource":
|
|
1037
1085
|
this.dispatchMcp(message, "ethisys:mcp:getResource:result", (m) => this.handleGetResource(m));
|
|
1038
1086
|
return;
|
|
@@ -1067,6 +1115,47 @@ var IframeBridgeTransport = class {
|
|
|
1067
1115
|
this.inFlightMcpRequests = Math.max(0, this.inFlightMcpRequests - 1);
|
|
1068
1116
|
});
|
|
1069
1117
|
}
|
|
1118
|
+
/**
|
|
1119
|
+
* The module-address twin of {@link handleInvokeTool}: same token mint, same
|
|
1120
|
+
* disposed-before-token short circuit, same rule that no token ever rides the reply. Kept as its
|
|
1121
|
+
* own method rather than a branch inside invokeTool, because the two differ only in the request
|
|
1122
|
+
* they build and a shared body would put that branch in the one place where mishandling the
|
|
1123
|
+
* token is unrecoverable.
|
|
1124
|
+
*/
|
|
1125
|
+
async handleInvokeOperation(message) {
|
|
1126
|
+
let token;
|
|
1127
|
+
try {
|
|
1128
|
+
token = await this.capabilityTokenProvider();
|
|
1129
|
+
} catch (err) {
|
|
1130
|
+
this.replyError(message.id, "ethisys:mcp:invokeOperation:result", err);
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
if (this.disposed) {
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
try {
|
|
1137
|
+
const result = await this.mcpClient.fetch({
|
|
1138
|
+
kind: "invokeOperation",
|
|
1139
|
+
moduleKey: message.moduleKey,
|
|
1140
|
+
operationKey: message.operationKey,
|
|
1141
|
+
fallbackToolName: message.fallbackToolName,
|
|
1142
|
+
args: message.args,
|
|
1143
|
+
capabilityToken: token,
|
|
1144
|
+
signal: this.abortController.signal
|
|
1145
|
+
});
|
|
1146
|
+
this.reportVersionSkew(result);
|
|
1147
|
+
this.safePostMessage({
|
|
1148
|
+
id: message.id,
|
|
1149
|
+
type: "ethisys:mcp:invokeOperation:result",
|
|
1150
|
+
ok: result.ok,
|
|
1151
|
+
data: result.data,
|
|
1152
|
+
error: result.error,
|
|
1153
|
+
code: classifyHostResponse(result)
|
|
1154
|
+
});
|
|
1155
|
+
} catch (err) {
|
|
1156
|
+
this.replyError(message.id, "ethisys:mcp:invokeOperation:result", err);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1070
1159
|
async handleInvokeTool(message) {
|
|
1071
1160
|
let token;
|
|
1072
1161
|
try {
|