@xpufx/paseo-mcp-tools 0.1.3 → 0.1.4

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.
@@ -24,16 +24,23 @@ export interface ClipboardEnvironment {
24
24
  * `react-native-web` `Clipboard.setString` reports success even when its
25
25
  * `document.execCommand("copy")` fails, which leaves the previous clipboard
26
26
  * item in place while the UI claims success (xpufx-org/paseo#278); it is only
27
- * usable off-DOM (native), where it is the real platform clipboard. In a DOM
28
- * the checked `execCommand` fallback is preferred to that unverifiable path.
27
+ * usable off-DOM (native), where it is the real platform clipboard. The same
28
+ * applies to any `setStringAsync` whose DOM fallback is that unverified
29
+ * `execCommand`. In a DOM the checked `execCommand` fallback is preferred to
30
+ * those unverifiable paths.
29
31
  */
30
32
  export function clipboardTierOrder(env: ClipboardEnvironment): ClipboardTier[] {
31
33
  const tiers: ClipboardTier[] = [];
32
34
  if (env.hasNavigatorClipboard) tiers.push("navigator");
33
35
  if (env.hasHostCopyText) tiers.push("host");
34
- if (env.hasRnSetStringAsync) {
36
+ // On a DOM both RN-web paths are unverifiable: `setString` reports success
37
+ // even when its `execCommand` no-ops, and a `setStringAsync` that falls back
38
+ // to it does the same. Off-DOM they are the real native clipboard, so they
39
+ // lead there; on a DOM only the checked `execCommand` fallback is honest.
40
+ const rnDomOk = !env.isDom;
41
+ if (env.hasRnSetStringAsync && rnDomOk) {
35
42
  tiers.push("rnAsync");
36
- } else if (env.hasRnClipboard && !env.isDom) {
43
+ } else if (env.hasRnClipboard && rnDomOk) {
37
44
  tiers.push("rnSync");
38
45
  }
39
46
  tiers.push("execCommand");
@@ -0,0 +1,15 @@
1
+ import type { PluginClientContext } from "@getpaseo/plugin/client";
2
+ import { registerMcpCommands } from "./client/commands";
3
+ import { contributeClient } from "./client/pill";
4
+ import { registerMcpTimeline } from "./client/timeline";
5
+
6
+ export default function contribute(client: PluginClientContext) {
7
+ const removePill = contributeClient(client);
8
+ const removeCommands = registerMcpCommands(client);
9
+ const removeTimeline = registerMcpTimeline(client);
10
+ return () => {
11
+ removeTimeline();
12
+ removeCommands();
13
+ removePill();
14
+ };
15
+ }
@@ -0,0 +1,44 @@
1
+ import type { PluginServerContext } from "@getpaseo/plugin/server";
2
+ import {
3
+ createCallMcpToolHandler,
4
+ createDiagnoseMcpHandler,
5
+ createHealthHandler,
6
+ createListMcpHandler,
7
+ createReadMcpHandler,
8
+ log,
9
+ } from "./server/mcp";
10
+ import {
11
+ callMcpTool,
12
+ checkMcpHealth,
13
+ diagnoseMcp,
14
+ listMcp,
15
+ mcpToolsSettingsContract,
16
+ readMcp,
17
+ } from "./shared/mcp";
18
+ import { settingsHandlers, settingsStorage } from "./server/settings";
19
+ import { GATEWAY_SERVER_NAME, injectGatewayIntoCreateRequest } from "./server/inject";
20
+
21
+ export default function contribute(server: PluginServerContext) {
22
+ server.handle(listMcp, createListMcpHandler());
23
+ server.handle(readMcp, createReadMcpHandler());
24
+ server.handle(checkMcpHealth, createHealthHandler());
25
+ server.handle(callMcpTool, createCallMcpToolHandler());
26
+ server.handle(diagnoseMcp, createDiagnoseMcpHandler());
27
+ server.handle(mcpToolsSettingsContract.get, settingsHandlers.get);
28
+ server.handle(mcpToolsSettingsContract.update, settingsHandlers.update);
29
+ server.handle(mcpToolsSettingsContract.reset, settingsHandlers.reset);
30
+ server.before("agent.create", ({ request }) => {
31
+ const settings = settingsStorage.read();
32
+ const next = injectGatewayIntoCreateRequest(request, {
33
+ enabled: settings.gatewayInject,
34
+ url: settings.gatewayUrl,
35
+ });
36
+ if (next) {
37
+ log.info(`Injected ${GATEWAY_SERVER_NAME} MCP server into agent.create`, {
38
+ provider: next.config.provider,
39
+ });
40
+ }
41
+ return next;
42
+ });
43
+ return () => {};
44
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xpufx/paseo-mcp-tools",
3
3
  "private": false,
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "license": "MIT",
6
6
  "scripts": {
7
7
  "stamp": "node scripts/version.mjs",
@@ -24,6 +24,8 @@
24
24
  "paseo-plugin.json",
25
25
  "README.md",
26
26
  "LICENSE",
27
+ "index.client.tsx",
28
+ "index.server.ts",
27
29
  "client",
28
30
  "server",
29
31
  "shared",