@panproto/mcp-server 0.2.0 → 0.22.1

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 CHANGED
@@ -40,75 +40,28 @@ Add to `.vscode/settings.json`:
40
40
  }
41
41
  ```
42
42
 
43
- ## Tools (30)
43
+ ## Tools (18)
44
44
 
45
- ### Schema
46
45
  | Tool | Description |
47
46
  |------|-------------|
48
47
  | `panproto_validate` | Validate a schema against a protocol |
49
48
  | `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
- |------|-------------|
49
+ | `panproto_scaffold` | Generate a skeleton schema |
50
+ | `panproto_check_existence` | Check migration validity |
51
+ | `panproto_compile` | Compile a migration |
52
+ | `panproto_lift` | Apply migration to a record |
53
+ | `panproto_diff` | Structural diff between schemas |
54
+ | `panproto_classify` | Classify schema change compatibility |
55
+ | `panproto_lens_generate` | Auto-generate a lens |
56
+ | `panproto_lens_apply` | Apply a lens to data |
57
+ | `panproto_lens_verify` | Verify lens round-trip laws |
58
+ | `panproto_convert` | Convert data between protocols |
59
+ | `panproto_convert_schema` | Translate a schema between protocols |
87
60
  | `panproto_parse_file` | Parse source file (248 languages) |
88
- | `panproto_parse_project` | Parse directory into project schema |
89
61
  | `panproto_parse_emit` | Round-trip parse and emit |
90
-
91
- ### Expression
92
- | Tool | Description |
93
- |------|-------------|
94
62
  | `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
63
  | `panproto_vcs_status` | Show VCS status |
102
64
  | `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
65
 
113
66
  ## Resources (3)
114
67
 
package/dist/cli.d.ts CHANGED
@@ -1,29 +1,9 @@
1
1
  interface ExecOptions {
2
2
  cwd?: string;
3
- timeout?: number;
4
3
  }
5
4
  /**
6
5
  * Execute the panproto CLI (`schema` command) and return stdout.
7
6
  * Throws on non-zero exit with stderr as the error message.
8
7
  */
9
8
  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
9
  export {};
package/dist/cli.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { execFile } from "node:child_process";
2
2
  import { promisify } from "node:util";
3
3
  const execFileAsync = promisify(execFile);
4
- const DEBUG = process.env.DEBUG?.includes("panproto") ?? false;
5
4
  /**
6
5
  * Execute the panproto CLI (`schema` command) and return stdout.
7
6
  * Throws on non-zero exit with stderr as the error message.
@@ -17,49 +16,17 @@ export async function execCli(...argsAndOptions) {
17
16
  Object.assign(options, item);
18
17
  }
19
18
  }
20
- if (DEBUG) {
21
- console.error(`[panproto] schema ${args.join(" ")}`);
22
- }
23
19
  try {
24
20
  const { stdout } = await execFileAsync("schema", args, {
25
21
  cwd: options.cwd,
26
- timeout: options.timeout ?? 30_000,
22
+ timeout: 30_000,
27
23
  maxBuffer: 10 * 1024 * 1024,
28
24
  });
29
25
  return stdout.trim();
30
26
  }
31
27
  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
28
  const execError = error;
42
- if (execError.stderr?.trim()) {
43
- return execError.stderr.trim();
44
- }
45
- return execError.message;
29
+ throw new Error(execError.stderr?.trim() || execError.message || "CLI execution failed");
46
30
  }
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
31
  }
65
32
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli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EtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAM1C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,GAAG,cAA2C;IAE9C,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAClC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE;YACrD,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,OAAO,EAAE,MAAM;YACf,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;SAC5B,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,SAAS,GAAG,KAA8C,CAAC;QACjE,MAAM,IAAI,KAAK,CACb,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC,OAAO,IAAI,sBAAsB,CACxE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,6 +1,4 @@
1
1
  import { execCli } from "../cli.js";
2
- import { CODEC_CATALOG } from "./codecs.js";
3
- import { GRAMMAR_CATALOG } from "./grammars.js";
4
2
  export function registerResources(server) {
5
3
  server.resource("protocols", "panproto://protocols", async () => {
6
4
  try {
@@ -27,24 +25,6 @@ export function registerResources(server) {
27
25
  };
28
26
  }
29
27
  });
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
28
  }
49
29
  const PROTOCOL_LIST = `panproto supports 50 semantic protocol definitions:
50
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"protocols.js","sourceRoot":"","sources":["../../src/resources/protocols.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,QAAQ,CACb,WAAW,EACX,sBAAsB,EACtB,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;YAC7D,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,sBAAsB;wBAC3B,QAAQ,EAAE,YAAY;wBACtB,IAAI,EAAE,0DAA0D,MAAM,EAAE;qBACzE;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,sBAAsB;wBAC3B,QAAQ,EAAE,YAAY;wBACtB,IAAI,EAAE,aAAa;qBACpB;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC1D,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,mBAAmB;gBACxB,QAAQ,EAAE,YAAY;gBACtB,IAAI,EAAE,aAAa;aACpB;SACF;KACF,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC9D,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,qBAAqB;gBAC1B,QAAQ,EAAE,YAAY;gBACtB,IAAI,EAAE,eAAe;aACtB;SACF;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;oHAiB8F,CAAC"}
1
+ {"version":3,"file":"protocols.js","sourceRoot":"","sources":["../../src/resources/protocols.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,QAAQ,CACb,WAAW,EACX,sBAAsB,EACtB,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;YAC7D,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,sBAAsB;wBAC3B,QAAQ,EAAE,YAAY;wBACtB,IAAI,EAAE,0DAA0D,MAAM,EAAE;qBACzE;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,sBAAsB;wBAC3B,QAAQ,EAAE,YAAY;wBACtB,IAAI,EAAE,aAAa;qBACpB;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;oHAiB8F,CAAC"}
package/dist/server.js CHANGED
@@ -8,13 +8,12 @@ import { registerConvertTools } from "./tools/convert.js";
8
8
  import { registerParseTools } from "./tools/parse.js";
9
9
  import { registerExprTools } from "./tools/expr.js";
10
10
  import { registerVcsTools } from "./tools/vcs.js";
11
- import { registerEnrichTools } from "./tools/enrich.js";
12
11
  import { registerResources } from "./resources/protocols.js";
13
12
  import { registerPrompts } from "./prompts/migration-plan.js";
14
13
  export async function createServer() {
15
14
  const server = new McpServer({
16
15
  name: "panproto",
17
- version: "0.2.0",
16
+ version: "0.22.1",
18
17
  });
19
18
  // Register all tool groups
20
19
  registerSchemaTools(server);
@@ -25,7 +24,6 @@ export async function createServer() {
25
24
  registerParseTools(server);
26
25
  registerExprTools(server);
27
26
  registerVcsTools(server);
28
- registerEnrichTools(server);
29
27
  // Register resources and prompts
30
28
  registerResources(server);
31
29
  registerPrompts(server);
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,CAAC,KAAK,UAAU,YAAY;IAGhC,MAAM,MAAM,GAAG,IAAI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AAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,CAAC,KAAK,UAAU,YAAY;IAGhC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,QAAQ;KAClB,CAAC,CAAC;IAEH,2BAA2B;IAC3B,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC5B,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,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"}
@@ -1,55 +1,42 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
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);
4
+ server.tool("panproto_convert", "Convert data between protocols (e.g., Avro to JSON Schema)", {
5
+ src_protocol: z.string().describe("Source protocol name"),
6
+ tgt_protocol: z.string().describe("Target protocol name"),
7
+ data: z.string().describe("Path to data file"),
8
+ src_schema: z
9
+ .string()
10
+ .optional()
11
+ .describe("Path to source schema (optional)"),
12
+ tgt_schema: z
13
+ .string()
14
+ .optional()
15
+ .describe("Path to target schema (optional)"),
16
+ }, async ({ src_protocol, tgt_protocol, data, src_schema, tgt_schema }) => {
17
+ const args = [
18
+ "data",
19
+ "convert",
20
+ "--src-protocol",
21
+ src_protocol,
22
+ "--tgt-protocol",
23
+ tgt_protocol,
24
+ ];
25
+ if (src_schema)
26
+ args.push("--src-schema", src_schema);
27
+ if (tgt_schema)
28
+ args.push("--tgt-schema", tgt_schema);
24
29
  args.push(data);
25
30
  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
- }));
31
+ return { content: [{ type: "text", text: result }] };
32
+ });
33
+ server.tool("panproto_convert_schema", "Translate a schema between protocols", {
34
+ src_protocol: z.string().describe("Source protocol name"),
35
+ tgt_protocol: z.string().describe("Target protocol name"),
36
+ schema: z.string().describe("Path to schema file"),
37
+ }, async ({ src_protocol, tgt_protocol, schema }) => {
38
+ const result = await execCli("data", "convert", "--src-protocol", src_protocol, "--tgt-protocol", tgt_protocol, "--schema-only", schema);
39
+ return { content: [{ type: "text", text: result }] };
40
+ });
54
41
  }
55
42
  //# sourceMappingURL=convert.js.map
@@ -1 +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,CAAC,gCAAgC,CAAC;QAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAC7D,EAAE,EAAE,CAAC,CAAC,M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AI,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACtD,IAAI,UAAU;YAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,sCAAsC,EACtC;QACE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACzD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACzD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;KACnD,EACD,KAAK,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,MAAM,CACP,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,30 +1,26 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
3
  export function registerDiffTools(server) {
4
- server.tool("panproto_diff", "Compute structural diff between two schemas, showing added/removed/modified elements", {
4
+ server.tool("panproto_diff", "Compute structural diff between two schemas", {
5
5
  src: z.string().describe("Path to source schema"),
6
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
- }));
7
+ }, async ({ src, tgt }) => {
8
+ const result = await execCli("diff", "--src", src, "--tgt", tgt);
9
+ return { content: [{ type: "text", text: result }] };
10
+ });
21
11
  server.tool("panproto_classify", "Classify a schema change as compatible, backward-compatible, or breaking", {
22
12
  src: z.string().describe("Path to source schema"),
23
13
  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
- }));
14
+ protocol: z
15
+ .string()
16
+ .optional()
17
+ .describe("Protocol name (for protocol-aware classification)"),
18
+ }, async ({ src, tgt, protocol }) => {
19
+ const args = ["check", "--src", src, "--tgt", tgt];
20
+ if (protocol)
21
+ args.push("--protocol", protocol);
22
+ const result = await execCli(...args);
23
+ return { content: [{ type: "text", text: result }] };
24
+ });
29
25
  }
30
26
  //# sourceMappingURL=diff.js.map
@@ -1 +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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E,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACjD,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,mDAAmD,CAAC;KACjE,EACD,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC/B,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,25 +1,13 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
3
  export function registerExprTools(server) {
4
4
  server.tool("panproto_eval_expr", "Evaluate a panproto expression (pure functional lambda calculus with ~50 builtins)", {
5
5
  expr: z
6
6
  .string()
7
7
  .describe('Expression to evaluate (e.g., "2 + 3 * 4" or "\\\\x -> x + 1")'),
8
- }, withErrorBoundary(async ({ expr }) => {
8
+ }, async ({ expr }) => {
9
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
- }));
10
+ return { content: [{ type: "text", text: result }] };
11
+ });
24
12
  }
25
13
  //# sourceMappingURL=expr.js.map
@@ -1 +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"}
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,MAAM,WAAW,CAAC;AAEpC,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,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,72 +1,26 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
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
- }));
4
+ server.tool("panproto_lens_generate", "Auto-generate a bidirectional lens between two schemas", {
5
+ src: z.string().describe("Path to source schema"),
6
+ tgt: z.string().describe("Path to target schema"),
7
+ }, async ({ src, tgt }) => {
8
+ const result = await execCli("lens", "generate", src, tgt);
9
+ return { content: [{ type: "text", text: result }] };
10
+ });
11
+ server.tool("panproto_lens_apply", "Apply a lens to data (get direction: project source to target)", {
12
+ lens: z.string().describe("Path to lens file"),
13
+ record: z.string().describe("Path to data record"),
14
+ }, async ({ lens, record }) => {
15
+ const result = await execCli("lens", "apply", lens, record);
16
+ return { content: [{ type: "text", text: result }] };
17
+ });
39
18
  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
- }));
19
+ lens: z.string().describe("Path to lens file"),
20
+ instance: z.string().describe("Path to test instance"),
21
+ }, async ({ lens, instance }) => {
22
+ const result = await execCli("lens", "verify", lens, "--instance", instance);
23
+ return { content: [{ type: "text", text: result }] };
24
+ });
71
25
  }
72
26
  //# sourceMappingURL=lens.js.map
@@ -1 +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;QAC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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;KACnD,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QACzB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,8DAA8D,EAC9D;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KACvD,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC3B,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,QAAQ,CACT,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,64 +1,36 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
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");
4
+ server.tool("panproto_check_existence", "Check if a migration between two schemas is valid", {
5
+ src_schema: z.string().describe("Path to source schema"),
6
+ tgt_schema: z.string().describe("Path to target schema"),
7
+ migration: z
8
+ .string()
9
+ .optional()
10
+ .describe("Path to migration file (optional, auto-discovers if omitted)"),
11
+ }, async ({ src_schema, tgt_schema, migration }) => {
12
+ const args = ["check", "--src", src_schema, "--tgt", tgt_schema];
13
+ if (migration)
14
+ args.push("--mapping", migration);
13
15
  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"),
16
+ return { content: [{ type: "text", text: result }] };
17
+ });
18
+ server.tool("panproto_compile", "Compile a migration for fast per-record application", {
19
+ src_schema: z.string().describe("Path to source schema"),
20
+ tgt_schema: z.string().describe("Path to target schema"),
21
+ migration: z.string().describe("Path to migration file"),
22
+ }, async ({ src_schema, tgt_schema, migration }) => {
23
+ const result = await execCli("check", "--src", src_schema, "--tgt", tgt_schema, "--mapping", migration, "--compile");
24
+ return { content: [{ type: "text", text: result }] };
25
+ });
26
+ server.tool("panproto_lift", "Apply a compiled migration to a data record", {
27
+ migration: z.string().describe("Path to migration file"),
18
28
  src_schema: z.string().describe("Path to source schema"),
19
29
  tgt_schema: z.string().describe("Path to target schema"),
20
30
  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
- }));
31
+ }, async ({ migration, src_schema, tgt_schema, record }) => {
32
+ const result = await execCli("lift", "--migration", migration, "--src-schema", src_schema, "--tgt-schema", tgt_schema, record);
33
+ return { content: [{ type: "text", text: result }] };
34
+ });
63
35
  }
64
36
  //# sourceMappingURL=migration.js.map
@@ -1 +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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OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,WAAW,CACZ,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,eAAe,EACf,6CAA6C,EAC7C;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACxD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACxD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACxD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KACvD,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,MAAM,EACN,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,cAAc,EACd,UAAU,EACV,MAAM,CACP,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,26 +1,25 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
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)", {
4
+ server.tool("panproto_parse_file", "Parse a source file into a panproto schema representation (248 languages supported)", {
5
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)", {
6
+ language: z
7
+ .string()
8
+ .optional()
9
+ .describe("Language override (auto-detected from extension if omitted)"),
10
+ }, async ({ file_path, language }) => {
11
+ const args = ["parse", "file"];
12
+ if (language)
13
+ args.push("--language", language);
14
+ args.push(file_path);
15
+ const result = await execCli(...args);
16
+ return { content: [{ type: "text", text: result }] };
17
+ });
18
+ server.tool("panproto_parse_emit", "Round-trip parse and emit a source file (parse then reconstruct)", {
20
19
  file_path: z.string().describe("Path to the source file"),
21
- }, withErrorBoundary(async ({ file_path }) => {
20
+ }, async ({ file_path }) => {
22
21
  const result = await execCli("parse", "emit", file_path);
23
- return textContent(result);
24
- }));
22
+ return { content: [{ type: "text", text: result }] };
23
+ });
25
24
  }
26
25
  //# sourceMappingURL=parse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/tools/parse.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,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,qGAAqG,EACrG;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC1D,EACD,iBAAiB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,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AiB;IAClD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,qFAAqF,EACrF;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QACzD,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/B,IAAI,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,kEAAkE,EAClE;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC1D,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,48 +1,26 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
3
  export function registerSchemaTools(server) {
4
4
  server.tool("panproto_validate", "Validate a schema file against a protocol's rules", {
5
5
  schema_path: z.string().describe("Path to the schema file"),
6
6
  protocol: z.string().describe("Protocol name (e.g., atproto, openapi, avro)"),
7
- }, withErrorBoundary(async ({ schema_path, protocol }) => {
7
+ }, async ({ schema_path, protocol }) => {
8
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", {
9
+ return { content: [{ type: "text", text: result }] };
10
+ });
11
+ server.tool("panproto_normalize", "Canonicalize a schema by collapsing reference chains", {
12
12
  schema_path: z.string().describe("Path to the schema file"),
13
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", {
14
+ }, async ({ schema_path, protocol }) => {
15
+ const result = await execCli("normalize", "--protocol", protocol, schema_path);
16
+ return { content: [{ type: "text", text: result }] };
17
+ });
18
+ server.tool("panproto_scaffold", "Generate a skeleton schema for a protocol", {
24
19
  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
- }));
20
+ name: z.string().describe("Schema name"),
21
+ }, async ({ protocol, name }) => {
22
+ const result = await execCli("scaffold", "--protocol", protocol, `${name}.json`);
23
+ return { content: [{ type: "text", text: result }] };
24
+ });
47
25
  }
48
26
  //# sourceMappingURL=schema.js.map
@@ -1 +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,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC9E,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,gFAAgF,EAChF;QACE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;Q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AO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
package/dist/tools/vcs.js CHANGED
@@ -1,54 +1,31 @@
1
1
  import { z } from "zod";
2
- import { execCli, textContent, withErrorBoundary } from "../cli.js";
2
+ import { execCli } from "../cli.js";
3
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 }) => {
4
+ server.tool("panproto_vcs_status", "Show the current panproto VCS status (staged, modified, untracked schema files)", {
5
+ repo_path: z
6
+ .string()
7
+ .optional()
8
+ .describe("Path to the panproto repository (default: current directory)"),
9
+ }, async ({ repo_path }) => {
10
+ const args = ["status"];
11
+ const result = await execCli(...args, { cwd: repo_path });
12
+ return { content: [{ type: "text", text: result }] };
13
+ });
14
+ server.tool("panproto_vcs_log", "Show schema commit history", {
15
+ repo_path: z
16
+ .string()
17
+ .optional()
18
+ .describe("Path to the panproto repository (default: current directory)"),
19
+ limit: z
20
+ .number()
21
+ .optional()
22
+ .describe("Maximum number of commits to show"),
23
+ }, async ({ repo_path, limit }) => {
16
24
  const args = ["log"];
17
25
  if (limit)
18
26
  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
27
  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
- }));
28
+ return { content: [{ type: "text", text: result }] };
29
+ });
53
30
  }
54
31
  //# sourceMappingURL=vcs.js.map
@@ -1 +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,Q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IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,4BAA4B,EAC5B;QACE,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,8DAA8D,CAAC;QAC3E,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,mCAAmC,CAAC;KACjD,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panproto/mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.22.1",
4
4
  "description": "MCP server exposing panproto schema migration operations",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,2 +0,0 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function registerEnrichTools(server: McpServer): void;
@@ -1,24 +0,0 @@
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
@@ -1 +0,0 @@
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,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