rulesync 0.41.0 → 0.43.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/{chunk-SXEFNT27.js → chunk-2FR4Z37J.js} +1 -1
- package/dist/{chunk-CUKKFQFO.js → chunk-B3627VQY.js} +9 -7
- package/dist/{chunk-PPX47BRK.js → chunk-RL3TE3EZ.js} +6 -6
- package/dist/{chunk-QR656A7R.js → chunk-TCK42GOL.js} +2 -2
- package/dist/chunk-THWXK5Z2.js +35 -0
- package/dist/{chunk-XN7RGMJW.js → chunk-XHRBWFGI.js} +2 -2
- package/dist/{chunk-4SFPBBIB.js → chunk-ZMAL5LIX.js} +8 -3
- package/dist/{claude-JS6ARGB3.js → claudecode-ITHKV345.js} +2 -2
- package/dist/{cline-MM3R4QQE.js → cline-PKE6TYNJ.js} +2 -2
- package/dist/{copilot-NLSI3ID7.js → copilot-5JP6D4NO.js} +2 -2
- package/dist/{cursor-AU3PRMGD.js → cursor-RHFDG6T2.js} +2 -2
- package/dist/{geminicli-LINS3RMZ.js → geminicli-B3FFO5WV.js} +2 -2
- package/dist/index.cjs +143 -182
- package/dist/index.js +111 -129
- package/dist/{roo-KUGAURJB.js → roo-UOTKEOH7.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-6YNGMPAL.js +0 -56
package/package.json
CHANGED
package/dist/chunk-6YNGMPAL.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// src/schemas/mcp.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var ToolTargetSchema = z.enum([
|
|
4
|
-
"copilot",
|
|
5
|
-
"cursor",
|
|
6
|
-
"cline",
|
|
7
|
-
"claudecode",
|
|
8
|
-
"claude",
|
|
9
|
-
"roo",
|
|
10
|
-
"geminicli"
|
|
11
|
-
]);
|
|
12
|
-
var WildcardTargetSchema = z.tuple([z.literal("*")]);
|
|
13
|
-
var SpecificTargetsSchema = z.array(ToolTargetSchema);
|
|
14
|
-
var RulesyncTargetsSchema = z.union([SpecificTargetsSchema, WildcardTargetSchema]);
|
|
15
|
-
var McpTransportTypeSchema = z.enum(["stdio", "sse", "http"]);
|
|
16
|
-
var McpServerBaseSchema = z.object({
|
|
17
|
-
command: z.string().optional(),
|
|
18
|
-
args: z.array(z.string()).optional(),
|
|
19
|
-
url: z.string().optional(),
|
|
20
|
-
httpUrl: z.string().optional(),
|
|
21
|
-
env: z.record(z.string()).optional(),
|
|
22
|
-
disabled: z.boolean().optional(),
|
|
23
|
-
networkTimeout: z.number().optional(),
|
|
24
|
-
timeout: z.number().optional(),
|
|
25
|
-
trust: z.boolean().optional(),
|
|
26
|
-
cwd: z.string().optional(),
|
|
27
|
-
transport: McpTransportTypeSchema.optional(),
|
|
28
|
-
type: z.enum(["sse", "streamable-http"]).optional(),
|
|
29
|
-
alwaysAllow: z.array(z.string()).optional(),
|
|
30
|
-
tools: z.array(z.string()).optional()
|
|
31
|
-
});
|
|
32
|
-
var RulesyncMcpServerSchema = McpServerBaseSchema.extend({
|
|
33
|
-
targets: RulesyncTargetsSchema.optional()
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// src/utils/mcp-helpers.ts
|
|
37
|
-
function shouldIncludeServer(server, targetTool) {
|
|
38
|
-
if (!server.targets || server.targets.length === 0) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
const parsedTargets = RulesyncTargetsSchema.parse(server.targets);
|
|
42
|
-
if (parsedTargets.length === 1 && parsedTargets[0] === "*") {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
const validatedTool = ToolTargetSchema.parse(targetTool);
|
|
46
|
-
for (const target of parsedTargets) {
|
|
47
|
-
if (target === validatedTool) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
shouldIncludeServer
|
|
56
|
-
};
|