@panproto/mcp-server 0.2.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 +140 -0
- package/dist/cli.d.ts +29 -0
- package/dist/cli.js +65 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/migration-plan.d.ts +2 -0
- package/dist/prompts/migration-plan.js +73 -0
- package/dist/prompts/migration-plan.js.map +1 -0
- package/dist/resources/codecs.d.ts +1 -0
- package/dist/resources/codecs.js +32 -0
- package/dist/resources/codecs.js.map +1 -0
- package/dist/resources/grammars.d.ts +1 -0
- package/dist/resources/grammars.js +22 -0
- package/dist/resources/grammars.js.map +1 -0
- package/dist/resources/protocols.d.ts +2 -0
- package/dist/resources/protocols.js +67 -0
- package/dist/resources/protocols.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +39 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/convert.d.ts +2 -0
- package/dist/tools/convert.js +55 -0
- package/dist/tools/convert.js.map +1 -0
- package/dist/tools/diff.d.ts +2 -0
- package/dist/tools/diff.js +30 -0
- package/dist/tools/diff.js.map +1 -0
- package/dist/tools/enrich.d.ts +2 -0
- package/dist/tools/enrich.js +24 -0
- package/dist/tools/enrich.js.map +1 -0
- package/dist/tools/expr.d.ts +2 -0
- package/dist/tools/expr.js +25 -0
- package/dist/tools/expr.js.map +1 -0
- package/dist/tools/lens.d.ts +2 -0
- package/dist/tools/lens.js +72 -0
- package/dist/tools/lens.js.map +1 -0
- package/dist/tools/migration.d.ts +2 -0
- package/dist/tools/migration.js +64 -0
- package/dist/tools/migration.js.map +1 -0
- package/dist/tools/parse.d.ts +2 -0
- package/dist/tools/parse.js +26 -0
- package/dist/tools/parse.js.map +1 -0
- package/dist/tools/schema.d.ts +2 -0
- package/dist/tools/schema.js +48 -0
- package/dist/tools/schema.js.map +1 -0
- package/dist/tools/vcs.d.ts +2 -0
- package/dist/tools/vcs.js +54 -0
- package/dist/tools/vcs.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# @panproto/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for panproto, exposing schema migration operations to Claude Desktop, VS Code, and other MCP-compatible clients.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -g @panproto/mcp-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires the `schema` CLI to be installed and available on `$PATH`.
|
|
12
|
+
|
|
13
|
+
## Configuration
|
|
14
|
+
|
|
15
|
+
### Claude Desktop
|
|
16
|
+
|
|
17
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"panproto": {
|
|
23
|
+
"command": "panproto-mcp-server"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### VS Code
|
|
30
|
+
|
|
31
|
+
Add to `.vscode/settings.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"claude.mcpServers": {
|
|
36
|
+
"panproto": {
|
|
37
|
+
"command": "panproto-mcp-server"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Tools (30)
|
|
44
|
+
|
|
45
|
+
### Schema
|
|
46
|
+
| Tool | Description |
|
|
47
|
+
|------|-------------|
|
|
48
|
+
| `panproto_validate` | Validate a schema against a protocol |
|
|
49
|
+
| `panproto_normalize` | Canonicalize a schema |
|
|
50
|
+
| `panproto_scaffold` | Generate test data from protocol theory |
|
|
51
|
+
| `panproto_typecheck` | Type-check a migration at the GAT level |
|
|
52
|
+
| `panproto_health` | Check CLI installation and version |
|
|
53
|
+
|
|
54
|
+
### Migration
|
|
55
|
+
| Tool | Description |
|
|
56
|
+
|------|-------------|
|
|
57
|
+
| `panproto_check_existence` | Check migration existence conditions |
|
|
58
|
+
| `panproto_lift` | Apply migration to a data record |
|
|
59
|
+
| `panproto_auto_migrate` | Discover a migration via CSP search |
|
|
60
|
+
| `panproto_integrate` | Compute pushout of two schemas |
|
|
61
|
+
|
|
62
|
+
### Diff
|
|
63
|
+
| Tool | Description |
|
|
64
|
+
|------|-------------|
|
|
65
|
+
| `panproto_diff` | Structural diff with rename detection |
|
|
66
|
+
| `panproto_classify` | Classify change compatibility |
|
|
67
|
+
|
|
68
|
+
### Lens
|
|
69
|
+
| Tool | Description |
|
|
70
|
+
|------|-------------|
|
|
71
|
+
| `panproto_lens_generate` | Auto-generate a protolens chain |
|
|
72
|
+
| `panproto_lens_apply` | Apply lens (forward or backward) |
|
|
73
|
+
| `panproto_lens_verify` | Verify round-trip laws |
|
|
74
|
+
| `panproto_lens_compose` | Compose two chains |
|
|
75
|
+
| `panproto_lens_inspect` | Inspect chain steps and effects |
|
|
76
|
+
|
|
77
|
+
### Data
|
|
78
|
+
| Tool | Description |
|
|
79
|
+
|------|-------------|
|
|
80
|
+
| `panproto_convert` | Convert data between schemas |
|
|
81
|
+
| `panproto_batch_migrate` | Migrate a directory via VCS history |
|
|
82
|
+
| `panproto_data_status` | Report data staleness |
|
|
83
|
+
|
|
84
|
+
### Parse
|
|
85
|
+
| Tool | Description |
|
|
86
|
+
|------|-------------|
|
|
87
|
+
| `panproto_parse_file` | Parse source file (248 languages) |
|
|
88
|
+
| `panproto_parse_project` | Parse directory into project schema |
|
|
89
|
+
| `panproto_parse_emit` | Round-trip parse and emit |
|
|
90
|
+
|
|
91
|
+
### Expression
|
|
92
|
+
| Tool | Description |
|
|
93
|
+
|------|-------------|
|
|
94
|
+
| `panproto_eval_expr` | Evaluate an expression |
|
|
95
|
+
| `panproto_parse_expr` | Parse expression to AST |
|
|
96
|
+
| `panproto_fmt_expr` | Pretty-print expression |
|
|
97
|
+
|
|
98
|
+
### VCS
|
|
99
|
+
| Tool | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `panproto_vcs_status` | Show VCS status |
|
|
102
|
+
| `panproto_vcs_log` | Show commit history |
|
|
103
|
+
| `panproto_vcs_diff` | Diff schema versions |
|
|
104
|
+
| `panproto_vcs_blame` | Attribute elements to commits |
|
|
105
|
+
|
|
106
|
+
### Enrichment
|
|
107
|
+
| Tool | Description |
|
|
108
|
+
|------|-------------|
|
|
109
|
+
| `panproto_enrich_add_default` | Add default value to a vertex |
|
|
110
|
+
| `panproto_enrich_add_coercion` | Add type coercion expression |
|
|
111
|
+
| `panproto_enrich_list` | List all enrichments |
|
|
112
|
+
|
|
113
|
+
## Resources (3)
|
|
114
|
+
|
|
115
|
+
| URI | Description |
|
|
116
|
+
|-----|-------------|
|
|
117
|
+
| `panproto://protocols` | 50 protocol definitions |
|
|
118
|
+
| `panproto://codecs` | 50+ I/O codecs |
|
|
119
|
+
| `panproto://grammars` | 248 language parsers |
|
|
120
|
+
|
|
121
|
+
## Prompts (3)
|
|
122
|
+
|
|
123
|
+
| Prompt | Description |
|
|
124
|
+
|--------|-------------|
|
|
125
|
+
| `migration-plan` | Plan a migration between two schemas |
|
|
126
|
+
| `schema-review` | Review a schema for best practices |
|
|
127
|
+
| `compatibility-report` | Analyze cross-protocol compatibility |
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
npm install
|
|
133
|
+
npm run dev # run with tsx (hot reload)
|
|
134
|
+
npm run build # compile TypeScript
|
|
135
|
+
npm start # run compiled output
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface ExecOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Execute the panproto CLI (`schema` command) and return stdout.
|
|
7
|
+
* Throws on non-zero exit with stderr as the error message.
|
|
8
|
+
*/
|
|
9
|
+
export declare function execCli(...argsAndOptions: Array<string | ExecOptions>): Promise<string>;
|
|
10
|
+
/** Content helper for tool responses. */
|
|
11
|
+
export declare function textContent(text: string): {
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
/** Wrap a tool handler with consistent error handling. */
|
|
18
|
+
export declare function withErrorBoundary<T>(fn: (args: T) => Promise<{
|
|
19
|
+
content: Array<{
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}>;
|
|
23
|
+
}>): (args: T) => Promise<{
|
|
24
|
+
content: Array<{
|
|
25
|
+
type: "text";
|
|
26
|
+
text: string;
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
29
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
const execFileAsync = promisify(execFile);
|
|
4
|
+
const DEBUG = process.env.DEBUG?.includes("panproto") ?? false;
|
|
5
|
+
/**
|
|
6
|
+
* Execute the panproto CLI (`schema` command) and return stdout.
|
|
7
|
+
* Throws on non-zero exit with stderr as the error message.
|
|
8
|
+
*/
|
|
9
|
+
export async function execCli(...argsAndOptions) {
|
|
10
|
+
const options = {};
|
|
11
|
+
const args = [];
|
|
12
|
+
for (const item of argsAndOptions) {
|
|
13
|
+
if (typeof item === "string") {
|
|
14
|
+
args.push(item);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
Object.assign(options, item);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (DEBUG) {
|
|
21
|
+
console.error(`[panproto] schema ${args.join(" ")}`);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const { stdout } = await execFileAsync("schema", args, {
|
|
25
|
+
cwd: options.cwd,
|
|
26
|
+
timeout: options.timeout ?? 30_000,
|
|
27
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
28
|
+
});
|
|
29
|
+
return stdout.trim();
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const message = extractErrorMessage(error);
|
|
33
|
+
if (DEBUG) {
|
|
34
|
+
console.error(`[panproto] error: ${message}`);
|
|
35
|
+
}
|
|
36
|
+
throw new Error(message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function extractErrorMessage(error) {
|
|
40
|
+
if (error instanceof Error) {
|
|
41
|
+
const execError = error;
|
|
42
|
+
if (execError.stderr?.trim()) {
|
|
43
|
+
return execError.stderr.trim();
|
|
44
|
+
}
|
|
45
|
+
return execError.message;
|
|
46
|
+
}
|
|
47
|
+
return "CLI execution failed";
|
|
48
|
+
}
|
|
49
|
+
/** Content helper for tool responses. */
|
|
50
|
+
export function textContent(text) {
|
|
51
|
+
return { content: [{ type: "text", text }] };
|
|
52
|
+
}
|
|
53
|
+
/** Wrap a tool handler with consistent error handling. */
|
|
54
|
+
export function withErrorBoundary(fn) {
|
|
55
|
+
return async (args) => {
|
|
56
|
+
try {
|
|
57
|
+
return await fn(args);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
61
|
+
return textContent(`Error: ${message}`);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE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,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,KAAmD,CAAC;QACtE,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;YAC7B,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACjC,CAAC;QACD,OAAO,SAAS,CAAC,OAAO,CAAC;IAC3B,CAAC;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACxD,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,iBAAiB,CAC/B,EAA4E;IAE5E,OAAO,KAAK,EAAE,IAAO,EAAE,EAAE;QACvB,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAC3D,OAAO,WAAW,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createServer } from "./server.js";
|
|
3
|
+
async function main() {
|
|
4
|
+
const server = await createServer();
|
|
5
|
+
await server.listen();
|
|
6
|
+
}
|
|
7
|
+
main().catch((error) => {
|
|
8
|
+
console.error("Fatal error:", error);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;IACpC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;AACxB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export function registerPrompts(server) {
|
|
3
|
+
server.prompt("migration-plan", "Generate a structured prompt for planning a schema migration", {
|
|
4
|
+
src_path: z.string().describe("Path to source schema"),
|
|
5
|
+
tgt_path: z.string().describe("Path to target schema"),
|
|
6
|
+
}, async ({ src_path, tgt_path }) => ({
|
|
7
|
+
messages: [
|
|
8
|
+
{
|
|
9
|
+
role: "user",
|
|
10
|
+
content: {
|
|
11
|
+
type: "text",
|
|
12
|
+
text: `I need to migrate from schema "${src_path}" to schema "${tgt_path}".
|
|
13
|
+
|
|
14
|
+
Please:
|
|
15
|
+
1. Run \`schema diff --src "${src_path}" --tgt "${tgt_path}"\` to see what changed
|
|
16
|
+
2. Run \`schema check --src "${src_path}" --tgt "${tgt_path}"\` to classify compatibility
|
|
17
|
+
3. Attempt auto-generation with \`schema lens generate "${src_path}" "${tgt_path}"\`
|
|
18
|
+
4. If auto-generation fails, recommend a manual combinator sequence
|
|
19
|
+
5. Provide a step-by-step migration plan with CLI commands
|
|
20
|
+
6. Suggest how to verify the migration with lens law checks`,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
}));
|
|
25
|
+
server.prompt("schema-review", "Generate a structured prompt for reviewing a schema", {
|
|
26
|
+
schema_path: z.string().describe("Path to schema file"),
|
|
27
|
+
protocol: z.string().describe("Protocol name"),
|
|
28
|
+
}, async ({ schema_path, protocol }) => ({
|
|
29
|
+
messages: [
|
|
30
|
+
{
|
|
31
|
+
role: "user",
|
|
32
|
+
content: {
|
|
33
|
+
type: "text",
|
|
34
|
+
text: `Please review the schema at "${schema_path}" (protocol: ${protocol}).
|
|
35
|
+
|
|
36
|
+
Check for:
|
|
37
|
+
1. Validation: run \`schema validate --protocol ${protocol} "${schema_path}"\`
|
|
38
|
+
2. Constraint coverage: are critical fields properly constrained?
|
|
39
|
+
3. Naming conventions: do names follow ${protocol} conventions?
|
|
40
|
+
4. Migration-friendliness: will this schema be easy to evolve?
|
|
41
|
+
5. Protocol-specific best practices
|
|
42
|
+
|
|
43
|
+
Provide a structured review with Critical Issues, Suggestions, and Positives.`,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}));
|
|
48
|
+
server.prompt("compatibility-report", "Generate a prompt for cross-protocol compatibility analysis", {
|
|
49
|
+
schema_a_path: z.string().describe("Path to first schema"),
|
|
50
|
+
schema_b_path: z.string().describe("Path to second schema"),
|
|
51
|
+
}, async ({ schema_a_path, schema_b_path }) => ({
|
|
52
|
+
messages: [
|
|
53
|
+
{
|
|
54
|
+
role: "user",
|
|
55
|
+
content: {
|
|
56
|
+
type: "text",
|
|
57
|
+
text: `Analyze the compatibility between schemas "${schema_a_path}" and "${schema_b_path}".
|
|
58
|
+
|
|
59
|
+
These may be different versions of the same schema, or schemas in different protocols.
|
|
60
|
+
|
|
61
|
+
Please:
|
|
62
|
+
1. Identify the protocol of each schema
|
|
63
|
+
2. Run \`schema diff --src "${schema_a_path}" --tgt "${schema_b_path}"\`
|
|
64
|
+
3. Classify the change (compatible, backward-compatible, breaking)
|
|
65
|
+
4. If cross-protocol, analyze what is preserved, approximated, and lost
|
|
66
|
+
5. Test bidirectional migration feasibility
|
|
67
|
+
6. Produce a compatibility matrix`,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=migration-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-plan.js","sourceRoot":"","sources":["../../src/prompts/migration-plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,MAAM,CACX,gBAAgB,EAChB,8DAA8D,EAC9D;QACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KACvD,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QACjC,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,kCAAkC,QAAQ,gBAAgB,QAAQ;;;8BAGtD,QAAQ,YAAY,QAAQ;+BAC3B,QAAQ,YAAY,QAAQ;0DACD,QAAQ,MAAM,QAAQ;;;4DAGpB;iBACjD;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,eAAe,EACf,qDAAqD,EACrD;QACE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QACvD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;KAC/C,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QACpC,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,gCAAgC,WAAW,gBAAgB,QAAQ;;;kDAGnC,QAAQ,KAAK,WAAW;;yCAEjC,QAAQ;;;;8EAI6B;iBACnE;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,sBAAsB,EACtB,6DAA6D,EAC7D;QACE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QAC1D,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KAC5D,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3C,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,8CAA8C,aAAa,UAAU,aAAa;;;;;;8BAMtE,aAAa,YAAY,aAAa;;;;kCAIlC;iBACvB;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CODEC_CATALOG = "panproto provides 50+ I/O codecs for parsing and emitting instance data.\n\nCodecs are organized by pathway:\n\nJSON pathway (SIMD-accelerated via simd-json):\n json, json-schema, geojson, json-api, atproto-lexicon, openapi, asyncapi\n\nXML pathway (zero-copy via quick-xml):\n xml, html, svg, rss, atom, docx, odf, fhir-xml, naf\n\nTabular pathway (memchr-accelerated):\n csv, tsv, parquet, arrow, dataframe\n\nBinary:\n protobuf, flatbuffers, avro, msgpack, bson, bond, asn1, thrift\n\nGraph:\n graphql, neo4j-cypher\n\nRelational:\n sql-ddl, sql-dml, cassandra-cql, dynamodb-json, redis-commands\n\nConfig:\n yaml, toml, hcl, k8s-crd, docker-compose, cloudformation, ansible\n\nDomain:\n vcard, ical, edi-x12, swift-mt, conll-u, brat, ontonotes\n\nEach codec implements InstanceParser (bytes to Instance) and InstanceEmitter (Instance to bytes).";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Codec resource is registered via the protocols resource module.
|
|
2
|
+
// This file provides the codec catalog for direct import if needed.
|
|
3
|
+
export const CODEC_CATALOG = `panproto provides 50+ I/O codecs for parsing and emitting instance data.
|
|
4
|
+
|
|
5
|
+
Codecs are organized by pathway:
|
|
6
|
+
|
|
7
|
+
JSON pathway (SIMD-accelerated via simd-json):
|
|
8
|
+
json, json-schema, geojson, json-api, atproto-lexicon, openapi, asyncapi
|
|
9
|
+
|
|
10
|
+
XML pathway (zero-copy via quick-xml):
|
|
11
|
+
xml, html, svg, rss, atom, docx, odf, fhir-xml, naf
|
|
12
|
+
|
|
13
|
+
Tabular pathway (memchr-accelerated):
|
|
14
|
+
csv, tsv, parquet, arrow, dataframe
|
|
15
|
+
|
|
16
|
+
Binary:
|
|
17
|
+
protobuf, flatbuffers, avro, msgpack, bson, bond, asn1, thrift
|
|
18
|
+
|
|
19
|
+
Graph:
|
|
20
|
+
graphql, neo4j-cypher
|
|
21
|
+
|
|
22
|
+
Relational:
|
|
23
|
+
sql-ddl, sql-dml, cassandra-cql, dynamodb-json, redis-commands
|
|
24
|
+
|
|
25
|
+
Config:
|
|
26
|
+
yaml, toml, hcl, k8s-crd, docker-compose, cloudformation, ansible
|
|
27
|
+
|
|
28
|
+
Domain:
|
|
29
|
+
vcard, ical, edi-x12, swift-mt, conll-u, brat, ontonotes
|
|
30
|
+
|
|
31
|
+
Each codec implements InstanceParser (bytes to Instance) and InstanceEmitter (Instance to bytes).`;
|
|
32
|
+
//# sourceMappingURL=codecs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../src/resources/codecs.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,oEAAoE;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;kGA4BqE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GRAMMAR_CATALOG = "panproto supports full-AST parsing for 248 programming languages via tree-sitter grammars.\n\nTop languages by category:\n\nSystems: C, C++, Rust, Go, Zig, D, Nim\nWeb: TypeScript, JavaScript, HTML, CSS, SCSS, Svelte, Vue\nBackend: Python, Ruby, Java, Kotlin, C#, PHP, Perl\nFunctional: Haskell, OCaml, Elixir, Clojure, Erlang, F#, Lean\nData: SQL, JSON, YAML, TOML, XML, CSV\nSchema: Protobuf, GraphQL, Thrift, Avro\nConfig: Dockerfile, HCL (Terraform), Nix, CMake\nShell: Bash, Zsh, Fish, PowerShell\nMobile: Swift, Dart, Objective-C, Kotlin\nScientific: R, Julia, MATLAB, Fortran, LaTeX\nMarkup: Markdown, reStructuredText, AsciiDoc, Org\n\nEach grammar auto-derives a GAT theory (sorts from node types, operations from field names).\nThe generic AstWalker handles all languages; no per-language code needed.\nInterstitial text capture enables exact round-trip emission.";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Grammar resource provides the catalog of supported tree-sitter languages.
|
|
2
|
+
// Registered via the protocols resource module.
|
|
3
|
+
export const GRAMMAR_CATALOG = `panproto supports full-AST parsing for 248 programming languages via tree-sitter grammars.
|
|
4
|
+
|
|
5
|
+
Top languages by category:
|
|
6
|
+
|
|
7
|
+
Systems: C, C++, Rust, Go, Zig, D, Nim
|
|
8
|
+
Web: TypeScript, JavaScript, HTML, CSS, SCSS, Svelte, Vue
|
|
9
|
+
Backend: Python, Ruby, Java, Kotlin, C#, PHP, Perl
|
|
10
|
+
Functional: Haskell, OCaml, Elixir, Clojure, Erlang, F#, Lean
|
|
11
|
+
Data: SQL, JSON, YAML, TOML, XML, CSV
|
|
12
|
+
Schema: Protobuf, GraphQL, Thrift, Avro
|
|
13
|
+
Config: Dockerfile, HCL (Terraform), Nix, CMake
|
|
14
|
+
Shell: Bash, Zsh, Fish, PowerShell
|
|
15
|
+
Mobile: Swift, Dart, Objective-C, Kotlin
|
|
16
|
+
Scientific: R, Julia, MATLAB, Fortran, LaTeX
|
|
17
|
+
Markup: Markdown, reStructuredText, AsciiDoc, Org
|
|
18
|
+
|
|
19
|
+
Each grammar auto-derives a GAT theory (sorts from node types, operations from field names).
|
|
20
|
+
The generic AstWalker handles all languages; no per-language code needed.
|
|
21
|
+
Interstitial text capture enables exact round-trip emission.`;
|
|
22
|
+
//# sourceMappingURL=grammars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammars.js","sourceRoot":"","sources":["../../src/resources/grammars.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,gDAAgD;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;6DAkB8B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { execCli } from "../cli.js";
|
|
2
|
+
import { CODEC_CATALOG } from "./codecs.js";
|
|
3
|
+
import { GRAMMAR_CATALOG } from "./grammars.js";
|
|
4
|
+
export function registerResources(server) {
|
|
5
|
+
server.resource("protocols", "panproto://protocols", async () => {
|
|
6
|
+
try {
|
|
7
|
+
const result = await execCli("validate", "--list-protocols");
|
|
8
|
+
return {
|
|
9
|
+
contents: [
|
|
10
|
+
{
|
|
11
|
+
uri: "panproto://protocols",
|
|
12
|
+
mimeType: "text/plain",
|
|
13
|
+
text: `panproto supports 50 semantic protocol definitions.\n\n${result}`,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return {
|
|
20
|
+
contents: [
|
|
21
|
+
{
|
|
22
|
+
uri: "panproto://protocols",
|
|
23
|
+
mimeType: "text/plain",
|
|
24
|
+
text: PROTOCOL_LIST,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
server.resource("codecs", "panproto://codecs", async () => ({
|
|
31
|
+
contents: [
|
|
32
|
+
{
|
|
33
|
+
uri: "panproto://codecs",
|
|
34
|
+
mimeType: "text/plain",
|
|
35
|
+
text: CODEC_CATALOG,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}));
|
|
39
|
+
server.resource("grammars", "panproto://grammars", async () => ({
|
|
40
|
+
contents: [
|
|
41
|
+
{
|
|
42
|
+
uri: "panproto://grammars",
|
|
43
|
+
mimeType: "text/plain",
|
|
44
|
+
text: GRAMMAR_CATALOG,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
const PROTOCOL_LIST = `panproto supports 50 semantic protocol definitions:
|
|
50
|
+
|
|
51
|
+
Serialization: Avro, FlatBuffers, ASN.1, Bond, MsgPack
|
|
52
|
+
Data Schema: JSON Schema, CDDL, BSON
|
|
53
|
+
API: OpenAPI, AsyncAPI, JSON:API, RAML
|
|
54
|
+
Database: SQL, MongoDB, Cassandra, DynamoDB, Neo4j, Redis
|
|
55
|
+
Social/Web: ATProto, RSS/Atom
|
|
56
|
+
Documents: DOCX, ODF
|
|
57
|
+
Data Science: Parquet, Arrow, DataFrame
|
|
58
|
+
Geospatial: GeoJSON
|
|
59
|
+
Healthcare: FHIR
|
|
60
|
+
Contact: vCard, iCal
|
|
61
|
+
Finance: EDI X12, SWIFT MT
|
|
62
|
+
Config: K8s CRD, Docker Compose, CloudFormation, Ansible
|
|
63
|
+
Annotation: brat, CoNLL-U, NAF, OntoNotes
|
|
64
|
+
Code: Protobuf, GraphQL, Thrift
|
|
65
|
+
|
|
66
|
+
Each protocol is a pair of GATs (Generalized Algebraic Theories) composed from building-block theories via colimit.`;
|
|
67
|
+
//# sourceMappingURL=protocols.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocols.js","sourceRoot":"","sources":["../../src/resources/protocols.ts"],"names":[],"mappings":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}
|
package/dist/server.d.ts
ADDED
package/dist/server.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { registerSchemaTools } from "./tools/schema.js";
|
|
4
|
+
import { registerMigrationTools } from "./tools/migration.js";
|
|
5
|
+
import { registerDiffTools } from "./tools/diff.js";
|
|
6
|
+
import { registerLensTools } from "./tools/lens.js";
|
|
7
|
+
import { registerConvertTools } from "./tools/convert.js";
|
|
8
|
+
import { registerParseTools } from "./tools/parse.js";
|
|
9
|
+
import { registerExprTools } from "./tools/expr.js";
|
|
10
|
+
import { registerVcsTools } from "./tools/vcs.js";
|
|
11
|
+
import { registerEnrichTools } from "./tools/enrich.js";
|
|
12
|
+
import { registerResources } from "./resources/protocols.js";
|
|
13
|
+
import { registerPrompts } from "./prompts/migration-plan.js";
|
|
14
|
+
export async function createServer() {
|
|
15
|
+
const server = new McpServer({
|
|
16
|
+
name: "panproto",
|
|
17
|
+
version: "0.2.0",
|
|
18
|
+
});
|
|
19
|
+
// Register all tool groups
|
|
20
|
+
registerSchemaTools(server);
|
|
21
|
+
registerMigrationTools(server);
|
|
22
|
+
registerDiffTools(server);
|
|
23
|
+
registerLensTools(server);
|
|
24
|
+
registerConvertTools(server);
|
|
25
|
+
registerParseTools(server);
|
|
26
|
+
registerExprTools(server);
|
|
27
|
+
registerVcsTools(server);
|
|
28
|
+
registerEnrichTools(server);
|
|
29
|
+
// Register resources and prompts
|
|
30
|
+
registerResources(server);
|
|
31
|
+
registerPrompts(server);
|
|
32
|
+
return {
|
|
33
|
+
listen: async () => {
|
|
34
|
+
const transport = new StdioServerTransport();
|
|
35
|
+
await server.connect(transport);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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BAAmB,CAAC,MAAM,CAAC,CAAC;IAE5B,iCAAiC;IACjC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO;QACL,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;YAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerConvertTools(server) {
|
|
4
|
+
server.tool("panproto_convert", "Convert data between schemas using protolens chains", {
|
|
5
|
+
data: z.string().describe("Path to data file or directory"),
|
|
6
|
+
protocol: z.string().describe("Protocol name"),
|
|
7
|
+
from: z.string().optional().describe("Path to source schema"),
|
|
8
|
+
to: z.string().optional().describe("Path to target schema"),
|
|
9
|
+
chain: z.string().optional().describe("Pre-built protolens chain (alternative to from/to)"),
|
|
10
|
+
output: z.string().optional().describe("Output file or directory"),
|
|
11
|
+
direction: z.enum(["forward", "backward"]).optional().describe("Direction (default: forward)"),
|
|
12
|
+
}, withErrorBoundary(async ({ data, protocol, from, to, chain, output, direction }) => {
|
|
13
|
+
const args = ["data", "convert", "--protocol", protocol];
|
|
14
|
+
if (from)
|
|
15
|
+
args.push("--from", from);
|
|
16
|
+
if (to)
|
|
17
|
+
args.push("--to", to);
|
|
18
|
+
if (chain)
|
|
19
|
+
args.push("--chain", chain);
|
|
20
|
+
if (output)
|
|
21
|
+
args.push("-o", output);
|
|
22
|
+
if (direction)
|
|
23
|
+
args.push("--direction", direction);
|
|
24
|
+
args.push(data);
|
|
25
|
+
const result = await execCli(...args);
|
|
26
|
+
return textContent(result);
|
|
27
|
+
}));
|
|
28
|
+
server.tool("panproto_batch_migrate", "Migrate a directory of data files to match the current schema version via VCS history", {
|
|
29
|
+
data_dir: z.string().describe("Directory containing data files"),
|
|
30
|
+
protocol: z.string().optional().describe("Protocol name (inferred from VCS if omitted)"),
|
|
31
|
+
dry_run: z.boolean().optional().describe("Preview without modifying files"),
|
|
32
|
+
backward: z.boolean().optional().describe("Migrate backward using stored complements"),
|
|
33
|
+
output: z.string().optional().describe("Output directory (default: overwrite in place)"),
|
|
34
|
+
}, withErrorBoundary(async ({ data_dir, protocol, dry_run, backward, output }) => {
|
|
35
|
+
const args = ["data", "migrate"];
|
|
36
|
+
if (protocol)
|
|
37
|
+
args.push("--protocol", protocol);
|
|
38
|
+
if (dry_run)
|
|
39
|
+
args.push("--dry-run");
|
|
40
|
+
if (backward)
|
|
41
|
+
args.push("--backward");
|
|
42
|
+
if (output)
|
|
43
|
+
args.push("-o", output);
|
|
44
|
+
args.push(data_dir);
|
|
45
|
+
const result = await execCli(...args, { timeout: 120_000 });
|
|
46
|
+
return textContent(result);
|
|
47
|
+
}));
|
|
48
|
+
server.tool("panproto_data_status", "Report data staleness relative to the current schema version", {
|
|
49
|
+
data_dir: z.string().describe("Directory containing data files"),
|
|
50
|
+
}, withErrorBoundary(async ({ data_dir }) => {
|
|
51
|
+
const result = await execCli("data", "status", data_dir);
|
|
52
|
+
return textContent(result);
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=convert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../src/tools/convert.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,qDAAqD,EACrD;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CA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AAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5D,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,8DAA8D,EAC9D;QACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;KACjE,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACvC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerDiffTools(server) {
|
|
4
|
+
server.tool("panproto_diff", "Compute structural diff between two schemas, showing added/removed/modified elements", {
|
|
5
|
+
src: z.string().describe("Path to source schema"),
|
|
6
|
+
tgt: z.string().describe("Path to target schema"),
|
|
7
|
+
stat: z.boolean().optional().describe("Show diffstat summary"),
|
|
8
|
+
detect_renames: z.boolean().optional().describe("Detect likely renames"),
|
|
9
|
+
theory: z.boolean().optional().describe("Show theory-level diff (sorts, operations)"),
|
|
10
|
+
}, withErrorBoundary(async ({ src, tgt, stat, detect_renames, theory }) => {
|
|
11
|
+
const args = ["diff", src, tgt];
|
|
12
|
+
if (stat)
|
|
13
|
+
args.push("--stat");
|
|
14
|
+
if (detect_renames)
|
|
15
|
+
args.push("--detect-renames");
|
|
16
|
+
if (theory)
|
|
17
|
+
args.push("--theory");
|
|
18
|
+
const result = await execCli(...args);
|
|
19
|
+
return textContent(result);
|
|
20
|
+
}));
|
|
21
|
+
server.tool("panproto_classify", "Classify a schema change as compatible, backward-compatible, or breaking", {
|
|
22
|
+
src: z.string().describe("Path to source schema"),
|
|
23
|
+
tgt: z.string().describe("Path to target schema"),
|
|
24
|
+
mapping: z.string().describe("Path to migration mapping file"),
|
|
25
|
+
}, withErrorBoundary(async ({ src, tgt, mapping }) => {
|
|
26
|
+
const result = await execCli("check", "--src", src, "--tgt", tgt, "--mapping", mapping);
|
|
27
|
+
return textContent(result);
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/tools/diff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,IAAI,CACT,eAAe,EACf,sFAAsF,EACtF;QACE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAC9D,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACxE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACtF,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE;QACrE,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAChC,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,IAAI,cAAc;YAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAClD,IAAI,MAAM;YAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,0EAA0E,EAC1E;QACE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAC/D,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QACxF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerEnrichTools(server) {
|
|
4
|
+
server.tool("panproto_enrich_add_default", "Add a default value expression to a schema vertex", {
|
|
5
|
+
vertex: z.string().describe("Vertex ID to add the default to"),
|
|
6
|
+
expr: z.string().describe("Default value expression as JSON"),
|
|
7
|
+
}, withErrorBoundary(async ({ vertex, expr }) => {
|
|
8
|
+
const result = await execCli("enrich", "add-default", vertex, "--expr", expr);
|
|
9
|
+
return textContent(result);
|
|
10
|
+
}));
|
|
11
|
+
server.tool("panproto_enrich_add_coercion", "Add a coercion expression between two vertex kinds", {
|
|
12
|
+
from: z.string().describe("Source vertex kind"),
|
|
13
|
+
to: z.string().describe("Target vertex kind"),
|
|
14
|
+
expr: z.string().describe("Coercion expression as JSON"),
|
|
15
|
+
}, withErrorBoundary(async ({ from, to, expr }) => {
|
|
16
|
+
const result = await execCli("enrich", "add-coercion", from, to, "--expr", expr);
|
|
17
|
+
return textContent(result);
|
|
18
|
+
}));
|
|
19
|
+
server.tool("panproto_enrich_list", "List all enrichments on the HEAD schema", {}, withErrorBoundary(async () => {
|
|
20
|
+
const result = await execCli("enrich", "list");
|
|
21
|
+
return textContent(result);
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=enrich.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrich.js","sourceRoot":"","sources":["../../src/tools/enrich.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,6BAA6B,EAC7B,mDAAmD,EACnD;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;QAC9D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KAC9D,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9E,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,8BAA8B,EAC9B,oDAAoD,EACpD;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC/C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KACzD,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACjF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,yCAAyC,EACzC,EAAE,EACF,iBAAiB,CAAC,KAAK,IAAI,EAAE;QAC3B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerExprTools(server) {
|
|
4
|
+
server.tool("panproto_eval_expr", "Evaluate a panproto expression (pure functional lambda calculus with ~50 builtins)", {
|
|
5
|
+
expr: z
|
|
6
|
+
.string()
|
|
7
|
+
.describe('Expression to evaluate (e.g., "2 + 3 * 4" or "\\\\x -> x + 1")'),
|
|
8
|
+
}, withErrorBoundary(async ({ expr }) => {
|
|
9
|
+
const result = await execCli("expr", "eval", expr);
|
|
10
|
+
return textContent(result);
|
|
11
|
+
}));
|
|
12
|
+
server.tool("panproto_parse_expr", "Parse an expression and print its AST (useful for debugging expression syntax)", {
|
|
13
|
+
source: z.string().describe("Expression source to parse"),
|
|
14
|
+
}, withErrorBoundary(async ({ source }) => {
|
|
15
|
+
const result = await execCli("expr", "parse", source);
|
|
16
|
+
return textContent(result);
|
|
17
|
+
}));
|
|
18
|
+
server.tool("panproto_fmt_expr", "Parse an expression and pretty-print it in canonical form", {
|
|
19
|
+
source: z.string().describe("Expression source to format"),
|
|
20
|
+
}, withErrorBoundary(async ({ source }) => {
|
|
21
|
+
const result = await execCli("expr", "fmt", source);
|
|
22
|
+
return textContent(result);
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=expr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expr.js","sourceRoot":"","sources":["../../src/tools/expr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,oFAAoF,EACpF;QACE,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,CAAC,gEAAgE,CAAC;KAC9E,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACnD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,gFAAgF,EAChF;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;KAC1D,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACtD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,2DAA2D,EAC3D;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC3D,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerLensTools(server) {
|
|
4
|
+
server.tool("panproto_lens_generate", "Auto-generate a bidirectional protolens chain between two schemas", {
|
|
5
|
+
old_schema: z.string().describe("Path to old/source schema"),
|
|
6
|
+
new_schema: z.string().describe("Path to new/target schema"),
|
|
7
|
+
protocol: z.string().describe("Protocol name"),
|
|
8
|
+
json: z.boolean().optional().describe("Output as JSON"),
|
|
9
|
+
save: z.string().optional().describe("Save protolens chain to this file path"),
|
|
10
|
+
}, withErrorBoundary(async ({ old_schema, new_schema, protocol, json, save }) => {
|
|
11
|
+
const args = ["lens", "generate", "--protocol", protocol];
|
|
12
|
+
if (json)
|
|
13
|
+
args.push("--json");
|
|
14
|
+
if (save)
|
|
15
|
+
args.push("--save", save);
|
|
16
|
+
args.push(old_schema, new_schema);
|
|
17
|
+
const result = await execCli(...args);
|
|
18
|
+
return textContent(result);
|
|
19
|
+
}));
|
|
20
|
+
server.tool("panproto_lens_apply", "Apply a protolens chain to data (forward or backward direction)", {
|
|
21
|
+
chain: z.string().describe("Path to protolens chain JSON file"),
|
|
22
|
+
data: z.string().describe("Path to data record"),
|
|
23
|
+
protocol: z.string().describe("Protocol name"),
|
|
24
|
+
direction: z.enum(["forward", "backward"]).optional().describe("Direction (default: forward)"),
|
|
25
|
+
complement: z.string().optional().describe("Path to complement data (for backward apply)"),
|
|
26
|
+
schema: z.string().optional().describe("Schema for chain instantiation"),
|
|
27
|
+
}, withErrorBoundary(async ({ chain, data, protocol, direction, complement, schema }) => {
|
|
28
|
+
const args = ["lens", "apply", "--protocol", protocol];
|
|
29
|
+
if (direction)
|
|
30
|
+
args.push("--direction", direction);
|
|
31
|
+
if (complement)
|
|
32
|
+
args.push("--complement", complement);
|
|
33
|
+
if (schema)
|
|
34
|
+
args.push("--schema", schema);
|
|
35
|
+
args.push(chain, data);
|
|
36
|
+
const result = await execCli(...args);
|
|
37
|
+
return textContent(result);
|
|
38
|
+
}));
|
|
39
|
+
server.tool("panproto_lens_verify", "Verify lens round-trip laws (GetPut and PutGet) on test data", {
|
|
40
|
+
data: z.string().describe("Path to test data file"),
|
|
41
|
+
protocol: z.string().describe("Protocol name"),
|
|
42
|
+
schema: z.string().optional().describe("Path to schema file"),
|
|
43
|
+
}, withErrorBoundary(async ({ data, protocol, schema }) => {
|
|
44
|
+
const args = ["lens", "verify", "--protocol", protocol];
|
|
45
|
+
if (schema)
|
|
46
|
+
args.push("--schema", schema);
|
|
47
|
+
args.push(data);
|
|
48
|
+
const result = await execCli(...args);
|
|
49
|
+
return textContent(result);
|
|
50
|
+
}));
|
|
51
|
+
server.tool("panproto_lens_compose", "Compose two protolens chains or schemas into a single chain", {
|
|
52
|
+
chain1: z.string().describe("Path to first chain or schema"),
|
|
53
|
+
chain2: z.string().describe("Path to second chain or schema"),
|
|
54
|
+
protocol: z.string().describe("Protocol name"),
|
|
55
|
+
json: z.boolean().optional().describe("Output as JSON"),
|
|
56
|
+
}, withErrorBoundary(async ({ chain1, chain2, protocol, json }) => {
|
|
57
|
+
const args = ["lens", "compose", "--protocol", protocol];
|
|
58
|
+
if (json)
|
|
59
|
+
args.push("--json");
|
|
60
|
+
args.push(chain1, chain2);
|
|
61
|
+
const result = await execCli(...args);
|
|
62
|
+
return textContent(result);
|
|
63
|
+
}));
|
|
64
|
+
server.tool("panproto_lens_inspect", "Inspect a protolens chain showing each step, preconditions, and effects", {
|
|
65
|
+
chain: z.string().describe("Path to protolens chain JSON"),
|
|
66
|
+
protocol: z.string().describe("Protocol name"),
|
|
67
|
+
}, withErrorBoundary(async ({ chain, protocol }) => {
|
|
68
|
+
const result = await execCli("lens", "inspect", "--protocol", protocol, chain);
|
|
69
|
+
return textContent(result);
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=lens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lens.js","sourceRoot":"","sources":["../../src/tools/lens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,mEAAmE,EACnE;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QAC5D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,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C,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC1D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;KAC/C,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC/E,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerMigrationTools(server) {
|
|
4
|
+
server.tool("panproto_check_existence", "Check if a migration between two schemas satisfies existence conditions", {
|
|
5
|
+
src: z.string().describe("Path to source schema"),
|
|
6
|
+
tgt: z.string().describe("Path to target schema"),
|
|
7
|
+
mapping: z.string().describe("Path to migration mapping file"),
|
|
8
|
+
typecheck: z.boolean().optional().describe("Also type-check at the GAT level"),
|
|
9
|
+
}, withErrorBoundary(async ({ src, tgt, mapping, typecheck }) => {
|
|
10
|
+
const args = ["check", "--src", src, "--tgt", tgt, "--mapping", mapping];
|
|
11
|
+
if (typecheck)
|
|
12
|
+
args.push("--typecheck");
|
|
13
|
+
const result = await execCli(...args);
|
|
14
|
+
return textContent(result);
|
|
15
|
+
}));
|
|
16
|
+
server.tool("panproto_lift", "Apply a migration to a data record, transforming it from source to target schema", {
|
|
17
|
+
migration: z.string().describe("Path to migration mapping file"),
|
|
18
|
+
src_schema: z.string().describe("Path to source schema"),
|
|
19
|
+
tgt_schema: z.string().describe("Path to target schema"),
|
|
20
|
+
record: z.string().describe("Path to the data record"),
|
|
21
|
+
direction: z.enum(["restrict", "sigma", "pi"]).optional().describe("Migration direction (default: restrict)"),
|
|
22
|
+
}, withErrorBoundary(async ({ migration, src_schema, tgt_schema, record, direction }) => {
|
|
23
|
+
const args = [
|
|
24
|
+
"lift", "--migration", migration,
|
|
25
|
+
"--src-schema", src_schema, "--tgt-schema", tgt_schema,
|
|
26
|
+
];
|
|
27
|
+
if (direction)
|
|
28
|
+
args.push("--direction", direction);
|
|
29
|
+
args.push(record);
|
|
30
|
+
const result = await execCli(...args);
|
|
31
|
+
return textContent(result);
|
|
32
|
+
}));
|
|
33
|
+
server.tool("panproto_auto_migrate", "Automatically discover a migration morphism between two schemas via CSP search", {
|
|
34
|
+
old_schema: z.string().describe("Path to old/source schema"),
|
|
35
|
+
new_schema: z.string().describe("Path to new/target schema"),
|
|
36
|
+
json: z.boolean().optional().describe("Output as JSON"),
|
|
37
|
+
monic: z.boolean().optional().describe("Require injective vertex mapping"),
|
|
38
|
+
}, withErrorBoundary(async ({ old_schema, new_schema, json, monic }) => {
|
|
39
|
+
const args = ["auto-migrate"];
|
|
40
|
+
if (json)
|
|
41
|
+
args.push("--json");
|
|
42
|
+
if (monic)
|
|
43
|
+
args.push("--monic");
|
|
44
|
+
args.push(old_schema, new_schema);
|
|
45
|
+
const result = await execCli(...args);
|
|
46
|
+
return textContent(result);
|
|
47
|
+
}));
|
|
48
|
+
server.tool("panproto_integrate", "Compute the pushout (integration) of two schemas, merging them into one", {
|
|
49
|
+
left: z.string().describe("Path to left schema"),
|
|
50
|
+
right: z.string().describe("Path to right schema"),
|
|
51
|
+
auto_overlap: z.boolean().optional().describe("Auto-discover overlap between schemas"),
|
|
52
|
+
json: z.boolean().optional().describe("Output as JSON"),
|
|
53
|
+
}, withErrorBoundary(async ({ left, right, auto_overlap, json }) => {
|
|
54
|
+
const args = ["integrate"];
|
|
55
|
+
if (auto_overlap)
|
|
56
|
+
args.push("--auto-overlap");
|
|
57
|
+
if (json)
|
|
58
|
+
args.push("--json");
|
|
59
|
+
args.push(left, right);
|
|
60
|
+
const result = await execCli(...args);
|
|
61
|
+
return textContent(result);
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/tools/migration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B,yEAAyE,EACzE;QACE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC9D,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KAC/E,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;QAC3D,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QACzE,IAAI,SAAS;YAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,eAAe,EACf,kFAAkF,EAClF;QACE,SAAS,EAAE,CAAC,CAAC,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AI,CAAC,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerParseTools(server) {
|
|
4
|
+
server.tool("panproto_parse_file", "Parse a source file into a panproto schema representation (248 languages supported via tree-sitter)", {
|
|
5
|
+
file_path: z.string().describe("Path to the source file"),
|
|
6
|
+
}, withErrorBoundary(async ({ file_path }) => {
|
|
7
|
+
const result = await execCli("parse", "file", file_path);
|
|
8
|
+
return textContent(result);
|
|
9
|
+
}));
|
|
10
|
+
server.tool("panproto_parse_project", "Parse all files in a directory into a unified project schema with cross-file imports", {
|
|
11
|
+
path: z.string().optional().describe("Directory to parse (default: current directory)"),
|
|
12
|
+
}, withErrorBoundary(async ({ path }) => {
|
|
13
|
+
const args = ["parse", "project"];
|
|
14
|
+
if (path)
|
|
15
|
+
args.push(path);
|
|
16
|
+
const result = await execCli(...args, { timeout: 120_000 });
|
|
17
|
+
return textContent(result);
|
|
18
|
+
}));
|
|
19
|
+
server.tool("panproto_parse_emit", "Round-trip parse and emit a source file (parse then reconstruct to verify fidelity)", {
|
|
20
|
+
file_path: z.string().describe("Path to the source file"),
|
|
21
|
+
}, withErrorBoundary(async ({ file_path }) => {
|
|
22
|
+
const result = await execCli("parse", "emit", file_path);
|
|
23
|
+
return textContent(result);
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/tools/parse.ts"],"names":[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,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerSchemaTools(server) {
|
|
4
|
+
server.tool("panproto_validate", "Validate a schema file against a protocol's rules", {
|
|
5
|
+
schema_path: z.string().describe("Path to the schema file"),
|
|
6
|
+
protocol: z.string().describe("Protocol name (e.g., atproto, openapi, avro)"),
|
|
7
|
+
}, withErrorBoundary(async ({ schema_path, protocol }) => {
|
|
8
|
+
const result = await execCli("validate", "--protocol", protocol, schema_path);
|
|
9
|
+
return textContent(result);
|
|
10
|
+
}));
|
|
11
|
+
server.tool("panproto_normalize", "Canonicalize a schema by collapsing reference chains and simplifying structure", {
|
|
12
|
+
schema_path: z.string().describe("Path to the schema file"),
|
|
13
|
+
protocol: z.string().describe("Protocol name"),
|
|
14
|
+
json: z.boolean().optional().describe("Output as JSON"),
|
|
15
|
+
}, withErrorBoundary(async ({ schema_path, protocol, json }) => {
|
|
16
|
+
const args = ["normalize", "--protocol", protocol];
|
|
17
|
+
if (json)
|
|
18
|
+
args.push("--json");
|
|
19
|
+
args.push(schema_path);
|
|
20
|
+
const result = await execCli(...args);
|
|
21
|
+
return textContent(result);
|
|
22
|
+
}));
|
|
23
|
+
server.tool("panproto_scaffold", "Generate minimal test data from a protocol theory using free model construction", {
|
|
24
|
+
protocol: z.string().describe("Protocol name"),
|
|
25
|
+
schema_path: z.string().describe("Path to the schema file"),
|
|
26
|
+
json: z.boolean().optional().describe("Output as JSON"),
|
|
27
|
+
}, withErrorBoundary(async ({ protocol, schema_path, json }) => {
|
|
28
|
+
const args = ["scaffold", "--protocol", protocol];
|
|
29
|
+
if (json)
|
|
30
|
+
args.push("--json");
|
|
31
|
+
args.push(schema_path);
|
|
32
|
+
const result = await execCli(...args);
|
|
33
|
+
return textContent(result);
|
|
34
|
+
}));
|
|
35
|
+
server.tool("panproto_typecheck", "Type-check a migration morphism at the GAT level", {
|
|
36
|
+
src: z.string().describe("Path to source schema"),
|
|
37
|
+
tgt: z.string().describe("Path to target schema"),
|
|
38
|
+
migration: z.string().describe("Path to migration mapping file"),
|
|
39
|
+
}, withErrorBoundary(async ({ src, tgt, migration }) => {
|
|
40
|
+
const result = await execCli("typecheck", "--src", src, "--tgt", tgt, "--migration", migration);
|
|
41
|
+
return textContent(result);
|
|
42
|
+
}));
|
|
43
|
+
server.tool("panproto_health", "Check that the panproto CLI is installed and report its version", {}, withErrorBoundary(async () => {
|
|
44
|
+
const version = await execCli("--version");
|
|
45
|
+
return textContent(`OK: ${version}`);
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/tools/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,mDAAmD,EACnD;QACE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;KAC9E,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;QACpD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,YAAY,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
+
import { execCli, textContent, withErrorBoundary } from "../cli.js";
|
|
3
|
+
export function registerVcsTools(server) {
|
|
4
|
+
server.tool("panproto_vcs_status", "Show panproto VCS status (staged, modified, untracked schema files)", {
|
|
5
|
+
repo_path: z.string().optional().describe("Path to panproto repository (default: cwd)"),
|
|
6
|
+
}, withErrorBoundary(async ({ repo_path }) => {
|
|
7
|
+
const result = await execCli("status", { cwd: repo_path });
|
|
8
|
+
return textContent(result);
|
|
9
|
+
}));
|
|
10
|
+
server.tool("panproto_vcs_log", "Show schema commit history with optional filtering", {
|
|
11
|
+
repo_path: z.string().optional().describe("Path to panproto repository (default: cwd)"),
|
|
12
|
+
limit: z.number().optional().describe("Maximum number of commits to show"),
|
|
13
|
+
oneline: z.boolean().optional().describe("Show each commit on a single line"),
|
|
14
|
+
graph: z.boolean().optional().describe("Show ASCII branch graph"),
|
|
15
|
+
}, withErrorBoundary(async ({ repo_path, limit, oneline, graph }) => {
|
|
16
|
+
const args = ["log"];
|
|
17
|
+
if (limit)
|
|
18
|
+
args.push("-n", String(limit));
|
|
19
|
+
if (oneline)
|
|
20
|
+
args.push("--oneline");
|
|
21
|
+
if (graph)
|
|
22
|
+
args.push("--graph");
|
|
23
|
+
const result = await execCli(...args, { cwd: repo_path });
|
|
24
|
+
return textContent(result);
|
|
25
|
+
}));
|
|
26
|
+
server.tool("panproto_vcs_diff", "Diff two schema versions or show staged changes in the VCS", {
|
|
27
|
+
repo_path: z.string().optional().describe("Path to panproto repository (default: cwd)"),
|
|
28
|
+
old_ref: z.string().optional().describe("Old ref or schema path"),
|
|
29
|
+
new_ref: z.string().optional().describe("New ref or schema path"),
|
|
30
|
+
staged: z.boolean().optional().describe("Diff staged changes against HEAD"),
|
|
31
|
+
stat: z.boolean().optional().describe("Show diffstat summary"),
|
|
32
|
+
}, withErrorBoundary(async ({ repo_path, old_ref, new_ref, staged, stat }) => {
|
|
33
|
+
const args = ["diff"];
|
|
34
|
+
if (staged)
|
|
35
|
+
args.push("--staged");
|
|
36
|
+
if (stat)
|
|
37
|
+
args.push("--stat");
|
|
38
|
+
if (old_ref)
|
|
39
|
+
args.push(old_ref);
|
|
40
|
+
if (new_ref)
|
|
41
|
+
args.push(new_ref);
|
|
42
|
+
const result = await execCli(...args, { cwd: repo_path });
|
|
43
|
+
return textContent(result);
|
|
44
|
+
}));
|
|
45
|
+
server.tool("panproto_vcs_blame", "Show which commit introduced a specific schema element", {
|
|
46
|
+
element_type: z.enum(["vertex", "edge", "constraint"]).describe("Element type"),
|
|
47
|
+
element_id: z.string().describe('Element identifier (vertex ID, edge "src->tgt", or "vertex:sort")'),
|
|
48
|
+
repo_path: z.string().optional().describe("Path to panproto repository (default: cwd)"),
|
|
49
|
+
}, withErrorBoundary(async ({ element_type, element_id, repo_path }) => {
|
|
50
|
+
const result = await execCli("blame", "--element-type", element_type, element_id, { cwd: repo_path });
|
|
51
|
+
return textContent(result);
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=vcs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vcs.js","sourceRoot":"","sources":["../../src/tools/vcs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,qEAAqE,EACrE;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACxF,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3D,OAAO,WAAW,CAAC,M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C,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACxF,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE;QAClE,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EACnD,EAAE,GAAG,EAAE,SAAS,EAAE,CACnB,CAAC;QACF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@panproto/mcp-server",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MCP server exposing panproto schema migration operations",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"panproto-mcp-server": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"start": "node dist/index.js",
|
|
18
|
+
"dev": "tsx src/index.ts",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
23
|
+
"@panproto/core": "^0.22.1"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "^5.7.0",
|
|
27
|
+
"tsx": "^4.19.0",
|
|
28
|
+
"@types/node": "^22.0.0"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/panproto/panproto-toolkit",
|
|
33
|
+
"directory": "mcp-server"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22"
|
|
37
|
+
}
|
|
38
|
+
}
|