@xpufx/paseo-mcp-tools 0.1.3 → 0.1.5
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/client/mcp-query.tsx +1 -1
- package/client/pill.tsx +2 -2
- package/client/vendor/paseo-plugin-helper/utils/clipboard.ts +11 -4
- package/index.client.tsx +15 -0
- package/index.server.ts +44 -0
- package/package.json +3 -1
- package/server/discovery/extract.ts +1 -1
- package/server/health/health.ts +2 -2
- package/server/mcp.ts +1 -1
- package/server/providers/opencode.ts +2 -2
- package/server/settings.ts +1 -1
- package/shared/mcp.ts +1 -1
package/client/mcp-query.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { REFRESH_INTERVALS, useRpcQuery, type RefreshRate } from "paseo-plugin-helper/
|
|
1
|
+
import { REFRESH_INTERVALS, useRpcQuery, type RefreshRate } from "./vendor/paseo-plugin-helper/index";
|
|
2
2
|
import { checkMcpHealth, listMcp } from "../shared/mcp";
|
|
3
3
|
|
|
4
4
|
export function useMcpQuery(agentId: string) {
|
package/client/pill.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { Icon, useToast, ScrollView, FlatList, TextInput as HostTextInput, copyT
|
|
|
3
3
|
import {
|
|
4
4
|
initClientHelpers,
|
|
5
5
|
type ComposerPillRegistrar,
|
|
6
|
-
} from "paseo-plugin-helper/
|
|
6
|
+
} from "./vendor/paseo-plugin-helper/index";
|
|
7
7
|
|
|
8
8
|
initClientHelpers({ Icon, Modal, useRpc, useToast, copyText, ScrollView, FlatList, TextInput: HostTextInput });
|
|
9
9
|
import { useMemo, useState } from "react";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
type RenderModalProps,
|
|
35
35
|
type RenderPillProps,
|
|
36
36
|
type TabItem,
|
|
37
|
-
} from "paseo-plugin-helper/
|
|
37
|
+
} from "./vendor/paseo-plugin-helper/index";
|
|
38
38
|
import { useMcpHealthQuery, useMcpQuery } from "./mcp-query";
|
|
39
39
|
import {
|
|
40
40
|
callMcpTool,
|
|
@@ -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.
|
|
28
|
-
*
|
|
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
|
-
|
|
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 &&
|
|
43
|
+
} else if (env.hasRnClipboard && rnDomOk) {
|
|
37
44
|
tiers.push("rnSync");
|
|
38
45
|
}
|
|
39
46
|
tiers.push("execCommand");
|
package/index.client.tsx
ADDED
|
@@ -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
|
+
}
|
package/index.server.ts
ADDED
|
@@ -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.
|
|
4
|
+
"version": "0.1.5",
|
|
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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { redactSecrets, tryParseJsonc } from "paseo-plugin-helper/
|
|
3
|
+
import { redactSecrets, tryParseJsonc } from "../vendor/paseo-plugin-helper/index";
|
|
4
4
|
import type { McpServer, DiagnosticStep } from "./types";
|
|
5
5
|
|
|
6
6
|
export interface CandidatePath {
|
package/server/health/health.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpClient } from "paseo-plugin-helper/mcp";
|
|
2
|
-
import { withTimeout } from "paseo-plugin-helper/
|
|
1
|
+
import { McpClient } from "../vendor/paseo-plugin-helper/mcp/index";
|
|
2
|
+
import { withTimeout } from "../../shared/vendor/paseo-plugin-helper/index";
|
|
3
3
|
import type { McpServer } from "../../shared/mcp";
|
|
4
4
|
|
|
5
5
|
// GTD: generic health check that works with *every* MCP.
|
package/server/mcp.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { paseo as paseoProbe } from "./providers/catalog";
|
|
|
11
11
|
import { PLUGIN_VERSION } from "../shared/version";
|
|
12
12
|
// Direct source import. The helper MCP client has zero runtime deps,
|
|
13
13
|
// so no bundling step is needed for the daemon to resolve it.
|
|
14
|
-
import { createPluginLogger, PluginStorage, redactSecrets } from "paseo-plugin-helper/
|
|
14
|
+
import { createPluginLogger, PluginStorage, redactSecrets } from "./vendor/paseo-plugin-helper/index";
|
|
15
15
|
import { checkMany, checkMcpServerHealth, callMcpServerTool } from "./health/health";
|
|
16
16
|
|
|
17
17
|
type McpServer = z.infer<typeof McpServerSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { safeSpawn } from "paseo-plugin-helper/
|
|
4
|
-
import { stripAnsi } from "paseo-plugin-helper/
|
|
3
|
+
import { safeSpawn } from "../vendor/paseo-plugin-helper/index";
|
|
4
|
+
import { stripAnsi } from "../../shared/vendor/paseo-plugin-helper/index";
|
|
5
5
|
import type { McpProbe, ProbeContext, McpServer } from "../discovery/types";
|
|
6
6
|
import { matchesOpencodeFamily } from "./family";
|
|
7
7
|
import { redact } from "../discovery/extract";
|
package/server/settings.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginStorage, createSettingsHandlers } from "paseo-plugin-helper/
|
|
1
|
+
import { PluginStorage, createSettingsHandlers } from "./vendor/paseo-plugin-helper/index";
|
|
2
2
|
import { log } from "./mcp";
|
|
3
3
|
import { mcpToolsSettingsContract, type McpToolsSettings } from "../shared/mcp";
|
|
4
4
|
|
package/shared/mcp.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { defineContract, defineSettingsContract } from "paseo-plugin-helper/
|
|
2
|
+
import { defineContract, defineSettingsContract } from "./vendor/paseo-plugin-helper/index";
|
|
3
3
|
|
|
4
4
|
export const McpSourceSchema = z.object({
|
|
5
5
|
kind: z.enum(["project", "repo", "personal", "global", "paseo", "session"]),
|