@horizon36596/zenith-mcp 0.1.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.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +18 -0
  3. package/README.md +129 -0
  4. package/dist/editIo.d.ts +15 -0
  5. package/dist/editIo.d.ts.map +1 -0
  6. package/dist/editIo.js +33 -0
  7. package/dist/editIo.js.map +1 -0
  8. package/dist/findings.d.ts +35 -0
  9. package/dist/findings.d.ts.map +1 -0
  10. package/dist/findings.js +76 -0
  11. package/dist/findings.js.map +1 -0
  12. package/dist/index.d.ts +11 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +21 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/project.d.ts +46 -0
  17. package/dist/project.d.ts.map +1 -0
  18. package/dist/project.js +106 -0
  19. package/dist/project.js.map +1 -0
  20. package/dist/resources.d.ts +3 -0
  21. package/dist/resources.d.ts.map +1 -0
  22. package/dist/resources.js +37 -0
  23. package/dist/resources.js.map +1 -0
  24. package/dist/result.d.ts +14 -0
  25. package/dist/result.d.ts.map +1 -0
  26. package/dist/result.js +27 -0
  27. package/dist/result.js.map +1 -0
  28. package/dist/schemas.d.ts +576 -0
  29. package/dist/schemas.d.ts.map +1 -0
  30. package/dist/schemas.js +197 -0
  31. package/dist/schemas.js.map +1 -0
  32. package/dist/server.d.ts +13 -0
  33. package/dist/server.d.ts.map +1 -0
  34. package/dist/server.js +27 -0
  35. package/dist/server.js.map +1 -0
  36. package/dist/spawnCli.d.ts +28 -0
  37. package/dist/spawnCli.d.ts.map +1 -0
  38. package/dist/spawnCli.js +57 -0
  39. package/dist/spawnCli.js.map +1 -0
  40. package/dist/tools/analysis.d.ts +4 -0
  41. package/dist/tools/analysis.d.ts.map +1 -0
  42. package/dist/tools/analysis.js +128 -0
  43. package/dist/tools/analysis.js.map +1 -0
  44. package/dist/tools/auto.d.ts +4 -0
  45. package/dist/tools/auto.d.ts.map +1 -0
  46. package/dist/tools/auto.js +43 -0
  47. package/dist/tools/auto.js.map +1 -0
  48. package/dist/tools/edit.d.ts +3 -0
  49. package/dist/tools/edit.d.ts.map +1 -0
  50. package/dist/tools/edit.js +346 -0
  51. package/dist/tools/edit.js.map +1 -0
  52. package/dist/tools/project.d.ts +4 -0
  53. package/dist/tools/project.d.ts.map +1 -0
  54. package/dist/tools/project.js +58 -0
  55. package/dist/tools/project.js.map +1 -0
  56. package/dist/version.d.ts +3 -0
  57. package/dist/version.d.ts.map +1 -0
  58. package/dist/version.js +4 -0
  59. package/dist/version.js.map +1 -0
  60. package/package.json +67 -0
  61. package/spec/checks.md +313 -0
  62. package/spec/file-format.md +672 -0
@@ -0,0 +1,197 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * JSON Schema input shapes for the `zenith.edit.*` tools, mirroring `packages/schema/src/auto.ts`
4
+ * structurally so an MCP client can see exactly what a step, segment or marker looks like.
5
+ *
6
+ * These are written by hand against `zod` (the MCP SDK's peer version) rather than imported from
7
+ * `@horizon36596/zenith-schema` (which pins `zod` 3): the two packages can carry different major versions of
8
+ * `zod` side by side, but their schema objects are not interchangeable. The edit primitives in
9
+ * `@horizon36596/zenith-core` are the actual source of truth — every `zenith.edit.*` call still round-trips
10
+ * through `parseAuto` inside `finish()` (`packages/core/src/edit/finish.ts`), so a shape that
11
+ * slips past this file is still caught there with a precise `EditError`. `steps` inside a
12
+ * `parallel` or `branch` step are typed loosely (`z.unknown()`) rather than recursively for the
13
+ * same reason: the recursion is finitely enforced downstream, not lost.
14
+ */
15
+ export const poseInputSchema = z
16
+ .object({
17
+ xIn: z.number(),
18
+ yIn: z.number(),
19
+ headingRad: z.number().optional(),
20
+ provenance: z.string().optional(),
21
+ })
22
+ .describe("A literal pose in the field frame of the auto's own alliance (its `alliance`), where the robot " +
23
+ "drives it when running as that alliance: inches and radians.");
24
+ export const poseRefSchema = z
25
+ .object({ ref: z.string().min(1) })
26
+ .describe("A named pose from waypoints.json.");
27
+ export const poseSourceSchema = z
28
+ .union([z.literal("current"), poseRefSchema, poseInputSchema])
29
+ .describe('Where a segment starts or ends: "current" (the previous step\'s end pose), a waypoint ref, or a literal pose.');
30
+ export const lineSegmentSchema = z.object({
31
+ kind: z.literal("line"),
32
+ from: poseSourceSchema,
33
+ to: poseSourceSchema,
34
+ });
35
+ export const bezierSegmentSchema = z.object({
36
+ kind: z.literal("bezier"),
37
+ from: poseSourceSchema,
38
+ control: z.array(poseInputSchema).min(1).max(3).describe("One to three Bezier control points."),
39
+ to: poseSourceSchema,
40
+ });
41
+ export const segmentSchema = z
42
+ .discriminatedUnion("kind", [lineSegmentSchema, bezierSegmentSchema])
43
+ .describe("A line or a Bezier segment of a path step.");
44
+ const rangeHeadingModes = [
45
+ z.object({ mode: z.literal("tangent") }),
46
+ z.object({ mode: z.literal("tangentReversed") }),
47
+ z.object({ mode: z.literal("constant"), headingRad: z.number() }),
48
+ z.object({ mode: z.literal("linear"), fromRad: z.number(), toRad: z.number() }),
49
+ z.object({
50
+ mode: z.literal("facePoint"),
51
+ xIn: z.number(),
52
+ yIn: z.number(),
53
+ offsetRad: z.number().optional(),
54
+ }),
55
+ ];
56
+ export const headingRangeSchema = z
57
+ .object({
58
+ startT: z.number().min(0).max(1),
59
+ endT: z.number().min(0).max(1),
60
+ heading: z.discriminatedUnion("mode", [...rangeHeadingModes]),
61
+ })
62
+ .describe("One range of a piecewise heading: from startT to endT (fractions of the path) the robot uses this heading.");
63
+ export const headingSchema = z
64
+ .discriminatedUnion("mode", [
65
+ ...rangeHeadingModes,
66
+ z.object({
67
+ mode: z.literal("piecewise"),
68
+ ranges: z
69
+ .array(headingRangeSchema)
70
+ .min(1)
71
+ .describe("In order, the first starting at 0, each starting where the one before ends, the last ending at 1."),
72
+ }),
73
+ ])
74
+ .describe("One of the six heading modes of the file format (https://libraries.horizon36596.org/zenith/file-format/).");
75
+ export const commandArgsSchema = z
76
+ .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))
77
+ .describe("Named-command arguments, keyed by the param names robot.json declares.");
78
+ export const commandCallSchema = z.object({
79
+ name: z.string().min(1).describe("A command name registered in robot.json's commands[]."),
80
+ args: commandArgsSchema.optional(),
81
+ });
82
+ export const markerAtSchema = z
83
+ .union([
84
+ z.object({ t: z.number().min(0).max(1) }),
85
+ z.object({ distanceIn: z.number().nonnegative() }),
86
+ z.object({ distanceFromEndIn: z.number().nonnegative() }),
87
+ ])
88
+ .describe("Where along the path a marker fires: a path parameter t, or a distance.");
89
+ export const markerSchema = z.object({ at: markerAtSchema, command: commandCallSchema });
90
+ export const expectSchema = z.object({
91
+ collectFrom: z.string().min(1).optional(),
92
+ count: z.number().optional(),
93
+ launchesInto: z.string().min(1).optional(),
94
+ tip: z.enum(["own", "opponent"]).optional(),
95
+ });
96
+ export const pathStepInputSchema = z.object({
97
+ id: z.string().min(1).optional().describe("Omit to get an id assigned automatically."),
98
+ kind: z.literal("path"),
99
+ timeoutS: z.number().positive().optional(),
100
+ segments: z.array(segmentSchema).min(1),
101
+ heading: headingSchema.optional(),
102
+ speedFraction: z.number().positive().max(1).optional(),
103
+ markers: z.array(markerSchema).optional(),
104
+ endCondition: z.object({ condition: z.string().min(1) }).optional(),
105
+ expect: expectSchema.optional(),
106
+ notes: z.string().optional(),
107
+ });
108
+ export const commandStepInputSchema = z.object({
109
+ id: z.string().min(1).optional(),
110
+ kind: z.literal("command"),
111
+ name: z.string().min(1),
112
+ args: commandArgsSchema.optional(),
113
+ timeoutS: z.number().positive().optional(),
114
+ expect: expectSchema.optional(),
115
+ notes: z.string().optional(),
116
+ });
117
+ export const waitStepInputSchema = z.object({
118
+ id: z.string().min(1).optional(),
119
+ kind: z.literal("wait"),
120
+ seconds: z.number().nonnegative().optional(),
121
+ until: z.string().min(1).optional(),
122
+ timeoutS: z.number().positive().optional(),
123
+ notes: z.string().optional(),
124
+ });
125
+ export const sequenceStepInputSchema = z.object({
126
+ id: z.string().min(1).optional(),
127
+ kind: z.literal("sequence"),
128
+ steps: z
129
+ .array(z.unknown())
130
+ .describe("Nested steps, run one after another: the same shapes as a top-level step. At least one."),
131
+ notes: z.string().optional(),
132
+ });
133
+ export const parallelStepInputSchema = z.object({
134
+ id: z.string().min(1).optional(),
135
+ kind: z.literal("parallel"),
136
+ mode: z.enum(["all", "race", "deadline"]),
137
+ deadline: z.string().min(1).optional().describe("A child step's id; only meaningful for mode 'deadline'."),
138
+ steps: z.array(z.unknown()).describe("Nested steps: the same shapes as a top-level step."),
139
+ notes: z.string().optional(),
140
+ });
141
+ export const branchStepInputSchema = z.object({
142
+ id: z.string().min(1).optional(),
143
+ kind: z.literal("branch"),
144
+ condition: z.string().min(1).describe("A condition name registered in robot.json's conditions[]."),
145
+ then: z.array(z.unknown()),
146
+ else: z.array(z.unknown()).optional(),
147
+ notes: z.string().optional(),
148
+ });
149
+ export const stepInputSchema = z
150
+ .discriminatedUnion("kind", [
151
+ pathStepInputSchema,
152
+ commandStepInputSchema,
153
+ waitStepInputSchema,
154
+ sequenceStepInputSchema,
155
+ parallelStepInputSchema,
156
+ branchStepInputSchema,
157
+ ])
158
+ .describe("One step: path, command, wait, sequence, parallel or branch (https://libraries.horizon36596.org/zenith/file-format/).");
159
+ export const intoGroupSchema = z
160
+ .object({
161
+ into: z.string().min(1).describe("The id of a sequence, parallel group or branch."),
162
+ index: z
163
+ .number()
164
+ .int()
165
+ .nonnegative()
166
+ .optional()
167
+ .describe("0-based position in the group's list; clamps; the end when omitted."),
168
+ arm: z.enum(["then", "else"]).optional().describe("For a branch: which arm. then when omitted."),
169
+ })
170
+ .describe("A place inside a group, for putting a step at the front of one or into an empty arm.");
171
+ export const poseTargetSchema = z.object({
172
+ segmentIndex: z.number().int().nonnegative(),
173
+ pointKind: z.enum(["from", "to", "control"]),
174
+ controlIndex: z.number().int().nonnegative().optional().describe('Required, and only used, when pointKind is "control".'),
175
+ });
176
+ export const startInputSchema = z.object({
177
+ pose: poseSourceSchema,
178
+ holds: z.record(z.string(), z.number()).optional(),
179
+ });
180
+ // JSON has no "leave this field alone but not that one" beyond key presence, and no `undefined` —
181
+ // so clearing a field over MCP is spelled `null` (translated to `undefined` before it reaches
182
+ // `setMeta`, whose own "explicit undefined clears it" contract is a TypeScript-only convenience).
183
+ // Omitting a key entirely leaves that field unchanged either way.
184
+ export const autoMetaSchema = z.object({
185
+ title: z.string().nullable().optional().describe("Omit to leave unchanged; null clears it."),
186
+ description: z.string().nullable().optional().describe("Omit to leave unchanged; null clears it."),
187
+ authors: z.array(z.string().min(1)).nullable().optional().describe("Omit to leave unchanged; null clears it."),
188
+ });
189
+ export const autoRefField = z
190
+ .string()
191
+ .min(1)
192
+ .describe("The auto to operate on: a bare name (e.g. \"first-auto\", resolved against the project's autosDir), a path relative to the project root, or an absolute path.");
193
+ export const projectField = z
194
+ .string()
195
+ .optional()
196
+ .describe("The robot repo's directory (holding zenith.json). Defaults to the server's own working directory.");
197
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,QAAQ,CACP,iGAAiG;IAC/F,8DAA8D,CACjE,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,QA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MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAEH,kGAAkG;AAClG,8FAA8F;AAC9F,kGAAkG;AAClG,kEAAkE;AAClE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IAC5F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IAClG,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC/G,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,CACP,+JAA+J,CAChK,CAAC;AAEJ,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,QAAQ,EAAE;KACV,QAAQ,CAAC,mGAAmG,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare const SERVER_NAME = "zenith";
3
+ /** The release version, stamped from the root package.json by scripts/stamp-version.mjs. */
4
+ export declare const SERVER_VERSION = "0.1.1";
5
+ /**
6
+ * Builds the Zenith MCP server (site/docs/agents-mcp.md): the same verbs the
7
+ * CLI has, plus structural edit tools, so an agent can author an auto end to end without
8
+ * hand-editing JSON. Exported on its own (rather than only from `index.ts`) so the integration
9
+ * test can connect a client to it directly, and so a host that wants to embed the server without
10
+ * spawning a child process can too.
11
+ */
12
+ export declare function createServer(): McpServer;
13
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,4FAA4F;AAC5F,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAQxC"}
package/dist/server.js ADDED
@@ -0,0 +1,27 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { registerAnalysisTools } from "./tools/analysis.js";
3
+ import { registerAutoTools } from "./tools/auto.js";
4
+ import { registerEditTools } from "./tools/edit.js";
5
+ import { registerProjectTools } from "./tools/project.js";
6
+ import { registerResources } from "./resources.js";
7
+ import { VERSION } from "./version.js";
8
+ export const SERVER_NAME = "zenith";
9
+ /** The release version, stamped from the root package.json by scripts/stamp-version.mjs. */
10
+ export const SERVER_VERSION = VERSION;
11
+ /**
12
+ * Builds the Zenith MCP server (site/docs/agents-mcp.md): the same verbs the
13
+ * CLI has, plus structural edit tools, so an agent can author an auto end to end without
14
+ * hand-editing JSON. Exported on its own (rather than only from `index.ts`) so the integration
15
+ * test can connect a client to it directly, and so a host that wants to embed the server without
16
+ * spawning a child process can too.
17
+ */
18
+ export function createServer() {
19
+ const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION });
20
+ registerProjectTools(server);
21
+ registerAutoTools(server);
22
+ registerAnalysisTools(server);
23
+ registerEditTools(server);
24
+ registerResources(server);
25
+ return server;
26
+ }
27
+ //# sourceMappingURL=server.js.map
@@ -0,0 +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,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,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,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC;AACpC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7E,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,28 @@
1
+ export interface CliRunResult {
2
+ code: number | null;
3
+ stdout: string;
4
+ stderr: string;
5
+ }
6
+ /**
7
+ * The CLI's own entry point, resolved through Node's module resolution rather than shelled out to by
8
+ * name. `@horizon36596/zenith-cli` is a dependency of this package, so it resolves from here both in
9
+ * the monorepo (pnpm links the workspace package) and after `npx -y @horizon36596/zenith-mcp`, where
10
+ * npm installs it next to this one. Its `exports["."]` is `./dist/index.js`, the same file the
11
+ * `zenith` bin points at and the same file that guards `main(process.argv)` behind an
12
+ * `import.meta.url === pathToFileURL(process.argv[1]).href` check, so `node <this path> <args>`
13
+ * behaves exactly like running the `zenith` binary.
14
+ *
15
+ * Resolving locally, rather than spawning `npx`, works offline and always runs the CLI version this
16
+ * server was installed with.
17
+ */
18
+ export declare function resolveCliEntry(): string;
19
+ /**
20
+ * Runs the `zenith` CLI as a child process: `zenith.render`'s PNG path and `zenith.sim` shell out
21
+ * to it rather than reimplementing resvg or the trace conversion in this package
22
+ * (site/docs/agents-mcp.md — "png via the CLI's resvg path"). A subprocess,
23
+ * rather than importing the CLI's `run*` functions in-process, is deliberate: those functions write
24
+ * their output straight to `process.stdout`/`process.stderr`, and this server's own `process.stdout`
25
+ * is the MCP stdio transport's JSON-RPC framing, which any stray text would corrupt.
26
+ */
27
+ export declare function runZenithCli(args: readonly string[], cwd: string): Promise<CliRunResult>;
28
+ //# sourceMappingURL=spawnCli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawnCli.d.ts","sourceRoot":"","sources":["../src/spawnCli.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAGxC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA4BxF"}
@@ -0,0 +1,57 @@
1
+ import { spawn } from "node:child_process";
2
+ import { createRequire } from "node:module";
3
+ /**
4
+ * The CLI's own entry point, resolved through Node's module resolution rather than shelled out to by
5
+ * name. `@horizon36596/zenith-cli` is a dependency of this package, so it resolves from here both in
6
+ * the monorepo (pnpm links the workspace package) and after `npx -y @horizon36596/zenith-mcp`, where
7
+ * npm installs it next to this one. Its `exports["."]` is `./dist/index.js`, the same file the
8
+ * `zenith` bin points at and the same file that guards `main(process.argv)` behind an
9
+ * `import.meta.url === pathToFileURL(process.argv[1]).href` check, so `node <this path> <args>`
10
+ * behaves exactly like running the `zenith` binary.
11
+ *
12
+ * Resolving locally, rather than spawning `npx`, works offline and always runs the CLI version this
13
+ * server was installed with.
14
+ */
15
+ export function resolveCliEntry() {
16
+ const require = createRequire(import.meta.url);
17
+ return require.resolve("@horizon36596/zenith-cli");
18
+ }
19
+ /**
20
+ * Runs the `zenith` CLI as a child process: `zenith.render`'s PNG path and `zenith.sim` shell out
21
+ * to it rather than reimplementing resvg or the trace conversion in this package
22
+ * (site/docs/agents-mcp.md — "png via the CLI's resvg path"). A subprocess,
23
+ * rather than importing the CLI's `run*` functions in-process, is deliberate: those functions write
24
+ * their output straight to `process.stdout`/`process.stderr`, and this server's own `process.stdout`
25
+ * is the MCP stdio transport's JSON-RPC framing, which any stray text would corrupt.
26
+ */
27
+ export function runZenithCli(args, cwd) {
28
+ return new Promise((resolvePromise, reject) => {
29
+ let entry;
30
+ try {
31
+ entry = resolveCliEntry();
32
+ }
33
+ catch (error) {
34
+ reject(error instanceof Error ? error : new Error(String(error)));
35
+ return;
36
+ }
37
+ const child = spawn(process.execPath, [entry, ...args], {
38
+ cwd,
39
+ shell: false,
40
+ });
41
+ let stdout = "";
42
+ let stderr = "";
43
+ child.stdout.on("data", (chunk) => {
44
+ stdout += chunk.toString("utf8");
45
+ });
46
+ child.stderr.on("data", (chunk) => {
47
+ stderr += chunk.toString("utf8");
48
+ });
49
+ child.on("error", (error) => {
50
+ reject(error);
51
+ });
52
+ child.on("close", (code) => {
53
+ resolvePromise({ code, stdout, stderr });
54
+ });
55
+ });
56
+ }
57
+ //# sourceMappingURL=spawnCli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawnCli.js","sourceRoot":"","sources":["../src/spawnCli.ts"],"names":[],"mappings":"AAAA,O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;QACnC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** `zenith.estimate`, `zenith.render`, `zenith.diff`, `zenith.sim`. */
3
+ export declare function registerAnalysisTools(server: McpServer): void;
4
+ //# sourceMappingURL=analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/tools/analysis.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmBzE,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqH7D"}
@@ -0,0 +1,128 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { dirname } from "node:path";
3
+ import { diff, estimate, hasErrors, ledger, loadAuto, render } from "@horizon36596/zenith-core";
4
+ import { resolveSeason } from "@horizon36596/zenith-seasons";
5
+ import { z } from "zod";
6
+ import { errorCount, loadAutoAndPlan } from "../findings.js";
7
+ import { confinePath, readJsonFile, relativeToRoot, resolveAutoPath, resolveProject } from "../project.js";
8
+ import { guarded, jsonResult } from "../result.js";
9
+ import { runZenithCli } from "../spawnCli.js";
10
+ import { autoRefField, projectField } from "../schemas.js";
11
+ const outField = z
12
+ .string()
13
+ .min(1)
14
+ .describe("Where to write the render: a path relative to the project root, or absolute (must resolve inside it).");
15
+ /** Confined to the project root (finding 2): an `out` an agent supplies is untrusted input, the
16
+ * same as any other tool argument, and `zenith.render` writes there without asking. */
17
+ const resolveOut = (project, out) => confinePath(project.root, out);
18
+ /** `zenith.estimate`, `zenith.render`, `zenith.diff`, `zenith.sim`. */
19
+ export function registerAnalysisTools(server) {
20
+ server.registerTool("zenith.estimate", {
21
+ title: "Estimate an auto's timing",
22
+ description: "Returns the per-step timing table (nominalS/lowS/highS/strafeFraction) and the total, from " +
23
+ "the estimate's kinematic model. A step whose " +
24
+ "command has estimateS \"unknown\" makes the total a lower bound (hasUnknown: true). Plans " +
25
+ "against the auto's own robot/field override when it has one, the same as zenith.validate, " +
26
+ "and refuses to return a number (estimate: null) when the auto has any error finding — read " +
27
+ "findings and seasonWarnings first, the way zenith estimate's CLI exit code forces a human to.",
28
+ inputSchema: { auto: autoRefField, project: projectField },
29
+ }, guarded(({ auto, project }) => {
30
+ const proj = resolveProject(project);
31
+ const path = resolveAutoPath(proj, auto);
32
+ const parsed = loadAuto(readJsonFile(path));
33
+ const { plan: planned, robot, findings, seasonWarnings } = loadAutoAndPlan(parsed, proj);
34
+ const blocked = hasErrors(findings);
35
+ return jsonResult({
36
+ estimate: blocked ? null : estimate(planned, robot),
37
+ findings,
38
+ errors: errorCount(findings),
39
+ seasonWarnings,
40
+ });
41
+ }));
42
+ server.registerTool("zenith.render", {
43
+ title: "Render an auto to a picture",
44
+ description: "Renders the field, path, footprint ghosts and findings to SVG (format \"svg\") or PNG " +
45
+ '(format "png", via the zenith CLI\'s resvg path) and writes it to `out`. Use this to hand a ' +
46
+ "human a picture of what an auto does, or to attach to a pull request body.",
47
+ inputSchema: {
48
+ auto: autoRefField,
49
+ out: outField,
50
+ format: z.enum(["svg", "png"]).default("svg"),
51
+ alliance: z.enum(["RED", "BLUE"]).optional().describe("Defaults to the auto's own alliance."),
52
+ project: projectField,
53
+ },
54
+ }, guarded(async ({ auto, out, format, alliance, project }) => {
55
+ const proj = resolveProject(project);
56
+ const autoPath = resolveAutoPath(proj, auto);
57
+ const outPath = resolveOut(proj, out);
58
+ mkdirSync(dirname(outPath), { recursive: true });
59
+ if (format === "png") {
60
+ const args = ["render", relativeToRoot(proj, autoPath), "--png", outPath];
61
+ if (alliance !== undefined)
62
+ args.push("--alliance", alliance);
63
+ const result = await runZenithCli(args, proj.root);
64
+ if (result.code !== 0) {
65
+ throw new Error(`zenith render --png failed (exit ${String(result.code)}): ${result.stderr || result.stdout}`);
66
+ }
67
+ return jsonResult({ written: relativeToRoot(proj, outPath), format, stdout: result.stdout });
68
+ }
69
+ const parsed = loadAuto(readJsonFile(autoPath));
70
+ // One plan, from the auto's own robot/field override when it has one, backs the render, the
71
+ // estimate and the findings overlay together — previously this re-planned a second time
72
+ // inside findingsForAuto, which (for an auto with an override) drew the footprint from one
73
+ // robot and the finding overlays from another (finding 24).
74
+ const { plan: planned, robot, field, findings, seasonWarnings } = loadAutoAndPlan(parsed, proj);
75
+ const estimateResult = tryOrNull(() => estimate(planned, robot));
76
+ const ledgerRows = tryOrEmpty(() => ledger(planned, field, resolveSeason(field).rules));
77
+ const svg = render(planned, estimateResult, findings, ledgerRows, { alliance });
78
+ writeFileSync(outPath, svg, "utf8");
79
+ return jsonResult({ written: relativeToRoot(proj, outPath), format, seasonWarnings });
80
+ }));
81
+ server.registerTool("zenith.diff", {
82
+ title: "Structurally diff two autos",
83
+ description: "Compares two auto files step by step and returns the added/removed/changed/moved steps, " +
84
+ "for a review view or for an agent checking what an edit actually changed.",
85
+ inputSchema: { a: autoRefField, b: autoRefField, project: projectField },
86
+ }, guarded(({ a, b, project }) => {
87
+ const proj = resolveProject(project);
88
+ const autoA = loadAuto(readJsonFile(resolveAutoPath(proj, a)));
89
+ const autoB = loadAuto(readJsonFile(resolveAutoPath(proj, b)));
90
+ return jsonResult(diff(autoA, autoB));
91
+ }));
92
+ server.registerTool("zenith.sim", {
93
+ title: "Run the robot repo's simulator on an auto",
94
+ description: "Runs zenith.json's sim command for this auto (via `zenith sim --json`) and returns the " +
95
+ "resulting trace summary: per-step estimate vs. actual. Requires the robot repo's build " +
96
+ "tooling (e.g. Gradle) to be available where the MCP server runs.",
97
+ inputSchema: { auto: autoRefField, project: projectField },
98
+ }, guarded(async ({ auto, project }) => {
99
+ const proj = resolveProject(project);
100
+ const result = await runZenithCli(["sim", relativeToRoot(proj, resolveAutoPath(proj, auto)), "--json"], proj.root);
101
+ if (result.code !== 0) {
102
+ throw new Error(`zenith sim failed (exit ${String(result.code)}): ${result.stderr || result.stdout}`);
103
+ }
104
+ try {
105
+ return jsonResult(JSON.parse(result.stdout));
106
+ }
107
+ catch {
108
+ return jsonResult({ stdout: result.stdout, stderr: result.stderr });
109
+ }
110
+ }));
111
+ }
112
+ function tryOrNull(fn) {
113
+ try {
114
+ return fn();
115
+ }
116
+ catch {
117
+ return null;
118
+ }
119
+ }
120
+ function tryOrEmpty(fn) {
121
+ try {
122
+ return fn();
123
+ }
124
+ catch {
125
+ return [];
126
+ }
127
+ }
128
+ //# sourceMappingURL=analysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/tools/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAgB,MAAM,eAAe,CAAC;AACzH,OAAO,EAAE,OAAO,EAAE,UAA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AAC,IAAI,CAAC,CAAC;QACnH,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACxG,CAAC;QACD,IAAI,CAAC;YACH,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAY,CAAC,CAAC;QAC1D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACtE,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAI,EAAW;IAC/B,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAI,EAAa;IAClC,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** `zenith.auto.read` and `zenith.validate`. */
3
+ export declare function registerAutoTools(server: McpServer): void;
4
+ //# sourceMappingURL=auto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto.d.ts","sourceRoot":"","sources":["../../src/tools/auto.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8CzD"}
@@ -0,0 +1,43 @@
1
+ import { loadAuto } from "@horizon36596/zenith-core";
2
+ import { findingsForAuto, errorCount, helpFor, warningCount } from "../findings.js";
3
+ import { readJsonFile, relativeToRoot, resolveAutoPath, resolveProject } from "../project.js";
4
+ import { guarded, jsonResult } from "../result.js";
5
+ import { autoRefField, projectField } from "../schemas.js";
6
+ /** `zenith.auto.read` and `zenith.validate`. */
7
+ export function registerAutoTools(server) {
8
+ server.registerTool("zenith.auto.read", {
9
+ title: "Read an auto file",
10
+ description: "Reads and schema-validates one *.auto.json file and returns its full parsed contents " +
11
+ "(name, alliance, start, steps with their ids). Use this to see the current state of an " +
12
+ "auto before editing it, or to read the id an addStep/newAutoFromTemplate call assigned.",
13
+ inputSchema: { auto: autoRefField, project: projectField },
14
+ }, guarded(({ auto, project }) => {
15
+ const proj = resolveProject(project);
16
+ const path = resolveAutoPath(proj, auto);
17
+ const parsed = loadAuto(readJsonFile(path));
18
+ return jsonResult({ path: relativeToRoot(proj, path), auto: parsed });
19
+ }));
20
+ server.registerTool("zenith.validate", {
21
+ title: "Validate an auto",
22
+ description: "Schema-validates and checks one auto against its project's robot and field (or the auto's " +
23
+ "own robot/field override), the same rules `zenith validate` runs. Returns every Finding: " +
24
+ "severity, the step id and path parameter it points at, the check code, and a human-readable " +
25
+ "message, plus `help`: for each code present, a plain title, what it means and how to fix it. " +
26
+ "Call this after every edit to see whether the auto is closer to done.",
27
+ inputSchema: { auto: autoRefField, project: projectField },
28
+ }, guarded(({ auto, project }) => {
29
+ const proj = resolveProject(project);
30
+ const path = resolveAutoPath(proj, auto);
31
+ const parsed = loadAuto(readJsonFile(path));
32
+ const { findings, seasonWarnings } = findingsForAuto(parsed, proj);
33
+ return jsonResult({
34
+ path: relativeToRoot(proj, path),
35
+ findings,
36
+ errors: errorCount(findings),
37
+ warnings: warningCount(findings),
38
+ seasonWarnings,
39
+ help: helpFor(findings),
40
+ });
41
+ }));
42
+ }
43
+ //# sourceMappingURL=auto.js.map
@@ -0,0 +1 @@
1
+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AuE;QACzE,WAAW,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE;KAC3D,EACD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5B,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACnE,OAAO,UAAU,CAAC;YAChB,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;YAChC,QAAQ;YACR,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC;YAC5B,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;YAChC,cAAc;YACd,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;SACxB,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerEditTools(server: McpServer): void;
3
+ //# sourceMappingURL=edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/tools/edit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgEzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkbzD"}