@ethisyscore/extension-runtime 1.136.0 → 1.137.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/README.md +2 -2
- package/dist/MockPluginStorage-BM3bq99B.d.cts +35 -0
- package/dist/MockPluginStorage-BndTX2RR.d.ts +35 -0
- package/dist/{bridge-client-RJOl8WlU.d.ts → bridge-client-CkxYcZcm.d.ts} +1 -1
- package/dist/{bridge-client-D9EYFq1l.d.cts → bridge-client-DkogtCvn.d.cts} +1 -1
- package/dist/{bridge-envelopes-M5a42rAy.d.cts → bridge-envelopes-BcKu-nQm.d.cts} +72 -1
- package/dist/{bridge-envelopes-M5a42rAy.d.ts → bridge-envelopes-BcKu-nQm.d.ts} +72 -1
- package/dist/host/index.cjs +57 -2
- 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 +57 -2
- package/dist/host/index.js.map +1 -1
- package/dist/mock-host/cli.cjs +273 -7
- package/dist/mock-host/cli.cjs.map +1 -1
- package/dist/mock-host/cli.d.cts +10 -3
- package/dist/mock-host/cli.d.ts +10 -3
- package/dist/mock-host/cli.js +272 -8
- package/dist/mock-host/cli.js.map +1 -1
- package/dist/mock-host/index.cjs +236 -1
- package/dist/mock-host/index.cjs.map +1 -1
- package/dist/mock-host/index.d.cts +14 -4
- package/dist/mock-host/index.d.ts +14 -4
- package/dist/mock-host/index.js +236 -2
- package/dist/mock-host/index.js.map +1 -1
- package/dist/plugin/index.cjs +378 -100
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.d.cts +171 -6
- package/dist/plugin/index.d.ts +171 -6
- package/dist/plugin/index.js +366 -101
- package/dist/plugin/index.js.map +1 -1
- package/dist/{transport-UaoDRdm3.d.cts → transport-D1lE-5nt.d.cts} +30 -3
- package/dist/{transport-CFzJQiFG.d.ts → transport-INVtDo2s.d.ts} +30 -3
- package/package.json +1 -1
package/dist/host/index.d.cts
CHANGED
|
@@ -3,12 +3,12 @@ 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,
|
|
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,
|
|
6
|
+
import { M as McpHttpClient, g as VersionSkew } from '../transport-D1lE-5nt.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, f as McpUploadToStorageRequest, V as VERSION_MISMATCH_REASON, h as VersionSkewSource, W as WORKER_TRANSPORT_PROTOCOL, i as WorkerCtor, j as WorkerHandshakePayload, k as WorkerLike, l as WorkerRemoteDomTransport, m as WorkerRemoteDomTransportOptions, n as detectVersionSkew } from '../transport-D1lE-5nt.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';
|
|
11
|
-
import '../bridge-envelopes-
|
|
11
|
+
import '../bridge-envelopes-BcKu-nQm.cjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Resolution context for `var` references. Keys are looked up via dot-path
|
package/dist/host/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ 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,
|
|
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,
|
|
6
|
+
import { M as McpHttpClient, g as VersionSkew } from '../transport-INVtDo2s.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, f as McpUploadToStorageRequest, V as VERSION_MISMATCH_REASON, h as VersionSkewSource, W as WORKER_TRANSPORT_PROTOCOL, i as WorkerCtor, j as WorkerHandshakePayload, k as WorkerLike, l as WorkerRemoteDomTransport, m as WorkerRemoteDomTransportOptions, n as detectVersionSkew } from '../transport-INVtDo2s.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';
|
|
11
|
-
import '../bridge-envelopes-
|
|
11
|
+
import '../bridge-envelopes-BcKu-nQm.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Resolution context for `var` references. Keys are looked up via dot-path
|
package/dist/host/index.js
CHANGED
|
@@ -692,6 +692,9 @@ var WorkerRemoteDomTransport = class {
|
|
|
692
692
|
case "ethisys:mcp:uploadDocument":
|
|
693
693
|
this.dispatchMcp(message, "ethisys:mcp:uploadDocument:result", (m) => this.handleUploadDocument(m));
|
|
694
694
|
return;
|
|
695
|
+
case "ethisys:mcp:uploadToStorage":
|
|
696
|
+
this.dispatchMcp(message, "ethisys:mcp:uploadToStorage:result", (m) => this.handleUploadToStorage(m));
|
|
697
|
+
return;
|
|
695
698
|
case "ethisys:mcp:abort":
|
|
696
699
|
this.inFlightAborts.get(message.id ?? "")?.abort();
|
|
697
700
|
return;
|
|
@@ -929,11 +932,63 @@ var WorkerRemoteDomTransport = class {
|
|
|
929
932
|
this.replyError(message.id, "ethisys:mcp:uploadDocument:result", err);
|
|
930
933
|
}
|
|
931
934
|
}
|
|
932
|
-
|
|
935
|
+
async handleUploadToStorage(message) {
|
|
936
|
+
const resultType = "ethisys:mcp:uploadToStorage:result";
|
|
937
|
+
let token;
|
|
938
|
+
try {
|
|
939
|
+
token = await this.capabilityTokenProvider();
|
|
940
|
+
} catch (err) {
|
|
941
|
+
this.replyError(message.id, resultType, err, true);
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
if (this.disposed) {
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
try {
|
|
948
|
+
const result = await this.mcpClient.fetch({
|
|
949
|
+
kind: "uploadToStorage",
|
|
950
|
+
meta: message.meta,
|
|
951
|
+
buffer: message.buffer,
|
|
952
|
+
capabilityToken: token,
|
|
953
|
+
signal: this.requestSignal(message.id)
|
|
954
|
+
});
|
|
955
|
+
this.reportVersionSkew(result);
|
|
956
|
+
this.safePostMessage({
|
|
957
|
+
id: message.id,
|
|
958
|
+
type: resultType,
|
|
959
|
+
ok: result.ok,
|
|
960
|
+
data: result.data,
|
|
961
|
+
error: result.error,
|
|
962
|
+
code: classifyHostResponse(result),
|
|
963
|
+
// The HTTP status, on failure only. A bare number carries no host internals, and it
|
|
964
|
+
// is the only way the plugin can tell 413 (file too large) from 507 (quota) from 503
|
|
965
|
+
// (storage lock busy): the closed MCP code folds all three into `internal`/`unavailable`.
|
|
966
|
+
...!result.ok && typeof result.status === "number" ? { status: result.status } : {}
|
|
967
|
+
});
|
|
968
|
+
} catch (err) {
|
|
969
|
+
this.replyError(message.id, resultType, err, true);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
replyError(id, type, err, includeStatus = false) {
|
|
933
973
|
const message = err instanceof Error ? err.message : "MCP request failed";
|
|
934
|
-
|
|
974
|
+
const status = includeStatus ? statusOf(err) : void 0;
|
|
975
|
+
this.safePostMessage({
|
|
976
|
+
id,
|
|
977
|
+
type,
|
|
978
|
+
ok: false,
|
|
979
|
+
error: message,
|
|
980
|
+
code: classifyHostError(err),
|
|
981
|
+
...status !== void 0 ? { status } : {}
|
|
982
|
+
});
|
|
935
983
|
}
|
|
936
984
|
};
|
|
985
|
+
function statusOf(err) {
|
|
986
|
+
if (err === null || typeof err !== "object") {
|
|
987
|
+
return void 0;
|
|
988
|
+
}
|
|
989
|
+
const candidate = err;
|
|
990
|
+
return typeof candidate.status === "number" ? candidate.status : typeof candidate.statusCode === "number" ? candidate.statusCode : void 0;
|
|
991
|
+
}
|
|
937
992
|
var IFRAME_BRIDGE_PROTOCOL = "ethisys.iframe.bridge.v1";
|
|
938
993
|
var InboundEnvelope = z.discriminatedUnion("type", [
|
|
939
994
|
z.object({ type: z.literal("ethisys:mcp:invokeTool"), id: z.string().min(1), name: z.string().min(1), args: z.unknown(), nonce: z.string() }),
|