@ethisyscore/extension-runtime 1.117.0 → 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 +1 -1
package/dist/mock-host/cli.cjs
CHANGED
|
@@ -426,6 +426,9 @@ var WorkerRemoteDomTransport = class {
|
|
|
426
426
|
case "ethisys:mcp:invokeTool":
|
|
427
427
|
this.dispatchMcp(message, "ethisys:mcp:invokeTool:result", (m) => this.handleInvokeTool(m));
|
|
428
428
|
return;
|
|
429
|
+
case "ethisys:mcp:invokeOperation":
|
|
430
|
+
this.dispatchMcp(message, "ethisys:mcp:invokeOperation:result", (m) => this.handleInvokeOperation(m));
|
|
431
|
+
return;
|
|
429
432
|
case "ethisys:mcp:getResource":
|
|
430
433
|
this.dispatchMcp(message, "ethisys:mcp:getResource:result", (m) => this.handleGetResource(m));
|
|
431
434
|
return;
|
|
@@ -523,6 +526,47 @@ var WorkerRemoteDomTransport = class {
|
|
|
523
526
|
} catch {
|
|
524
527
|
}
|
|
525
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* The module-address twin of {@link handleInvokeTool}. Identical in every respect a reader
|
|
531
|
+
* should care about - same token mint, same disposed-before-token short circuit, same
|
|
532
|
+
* token-never-crosses-the-port rule - and deliberately NOT folded into one method with a
|
|
533
|
+
* branch: the two differ only in the request kind they build, and a shared method would put
|
|
534
|
+
* that branch inside the one place where getting the token handling wrong is unrecoverable.
|
|
535
|
+
*/
|
|
536
|
+
async handleInvokeOperation(message) {
|
|
537
|
+
let token;
|
|
538
|
+
try {
|
|
539
|
+
token = await this.capabilityTokenProvider();
|
|
540
|
+
} catch (err) {
|
|
541
|
+
this.replyError(message.id, "ethisys:mcp:invokeOperation:result", err);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
if (this.disposed) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
try {
|
|
548
|
+
const result = await this.mcpClient.fetch({
|
|
549
|
+
kind: "invokeOperation",
|
|
550
|
+
moduleKey: message.moduleKey,
|
|
551
|
+
operationKey: message.operationKey,
|
|
552
|
+
fallbackToolName: message.fallbackToolName,
|
|
553
|
+
args: message.args,
|
|
554
|
+
capabilityToken: token,
|
|
555
|
+
signal: this.requestSignal(message.id)
|
|
556
|
+
});
|
|
557
|
+
this.reportVersionSkew(result);
|
|
558
|
+
this.safePostMessage({
|
|
559
|
+
id: message.id,
|
|
560
|
+
type: "ethisys:mcp:invokeOperation:result",
|
|
561
|
+
ok: result.ok,
|
|
562
|
+
data: result.data,
|
|
563
|
+
error: result.error,
|
|
564
|
+
code: classifyHostResponse(result)
|
|
565
|
+
});
|
|
566
|
+
} catch (err) {
|
|
567
|
+
this.replyError(message.id, "ethisys:mcp:invokeOperation:result", err);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
526
570
|
async handleInvokeTool(message) {
|
|
527
571
|
let token;
|
|
528
572
|
try {
|
|
@@ -958,7 +1002,12 @@ var defaultMockMcpClient = {
|
|
|
958
1002
|
}
|
|
959
1003
|
};
|
|
960
1004
|
}
|
|
961
|
-
const echo = req.kind === "invokeTool" ? { tool: req.name, args: req.args } :
|
|
1005
|
+
const echo = req.kind === "invokeTool" ? { tool: req.name, args: req.args } : req.kind === "invokeOperation" ? {
|
|
1006
|
+
module: req.moduleKey,
|
|
1007
|
+
operation: req.operationKey,
|
|
1008
|
+
tool: req.fallbackToolName,
|
|
1009
|
+
args: req.args
|
|
1010
|
+
} : { resource: req.uri };
|
|
962
1011
|
return { ok: true, data: { mockHost: true, ...echo } };
|
|
963
1012
|
}
|
|
964
1013
|
};
|