@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,346 @@
1
+ import { existsSync } from "node:fs";
2
+ import { addMarker, addSegment, addStep, insertStepAfter, moveStep, newAutoFromTemplate, removeMarker, removeSegment, removeStep, renameStep, repairContinuity, setCommandArgs, setHeadingMode, setMarkerAt, setMeta, setPose, setSpeed, setStart, setTimeout as setStepTimeout, unwrapStep, wrapStepsWithId, } from "@horizon36596/zenith-core";
3
+ import { z } from "zod";
4
+ import { loadCurrent, writeEditResult } from "../editIo.js";
5
+ import { relativeToRoot, resolveAutoPath, resolveProject } from "../project.js";
6
+ import { guarded } from "../result.js";
7
+ import { autoMetaSchema, autoRefField, intoGroupSchema, commandArgsSchema, headingSchema, markerAtSchema, markerSchema, poseInputSchema, poseTargetSchema, projectField, segmentSchema, startInputSchema, stepInputSchema, } from "../schemas.js";
8
+ /**
9
+ * `zenith.edit.*`: one tool per structural edit primitive in `packages/core/src/edit/`. Every one
10
+ * reads the current file, applies the primitive, writes the canonical result back, and returns the
11
+ * same shape `zenith.validate` does — `written`, the new
12
+ * `auto`, and its `findings` — so the calling agent sees the effect of the edit without a second
13
+ * round trip.
14
+ *
15
+ * The input schemas here (`../schemas.js`) are a `zod` 4 mirror of `@horizon36596/zenith-schema`'s `zod` 3
16
+ * definitions, so the two are structurally, not nominally, compatible; `cast` below is the single
17
+ * place that bridges them, and every primitive still re-validates fully through `parseAuto` inside
18
+ * `finish()` regardless.
19
+ */
20
+ function cast(value) {
21
+ return value;
22
+ }
23
+ const stepIdField = z.string().min(1).describe("A step's id, as shown by zenith.auto.read or a Finding.");
24
+ export function registerEditTools(server) {
25
+ server.registerTool("zenith.edit.addStep", {
26
+ title: "Add a step",
27
+ description: "Adds a step to the auto: after the step named afterId (searched anywhere in the tree, " +
28
+ "including inside a sequence, parallel or branch group), into a group at an index (pass " +
29
+ "into), or at the end of the top-level list when neither is given. A step given no id is " +
30
+ "assigned one automatically — read the response's auto.steps to see it. To add a path in the " +
31
+ "middle that continues from the step before it, use zenith.edit.insertAfter instead.",
32
+ inputSchema: {
33
+ auto: autoRefField,
34
+ step: stepInputSchema,
35
+ afterId: z.string().min(1).optional(),
36
+ into: intoGroupSchema.optional(),
37
+ project: projectField,
38
+ },
39
+ }, guarded(({ auto, step, afterId, into, project }) => {
40
+ if (afterId !== undefined && into !== undefined) {
41
+ throw new Error("zenith.edit.addStep takes afterId or into, not both.");
42
+ }
43
+ const proj = resolveProject(project);
44
+ const { path, auto: current } = loadCurrent(proj, auto);
45
+ const updated = addStep(current, cast(step), into === undefined ? afterId : cast(into));
46
+ return writeEditResult(proj, path, updated);
47
+ }));
48
+ server.registerTool("zenith.edit.removeStep", {
49
+ title: "Remove a step",
50
+ description: "Removes the step named id, wherever it is in the tree.",
51
+ inputSchema: { auto: autoRefField, id: stepIdField, project: projectField },
52
+ }, guarded(({ auto, id, project }) => {
53
+ const proj = resolveProject(project);
54
+ const { path, auto: current } = loadCurrent(proj, auto);
55
+ return writeEditResult(proj, path, removeStep(current, id));
56
+ }));
57
+ server.registerTool("zenith.edit.moveStep", {
58
+ title: "Move a step",
59
+ description: "Moves the step named id to a new position: immediately after another step's id (pass " +
60
+ "afterId, searched anywhere in the tree), into a sequence, parallel group or branch arm at an " +
61
+ "index (pass into), or to a 0-based index in the top-level steps list (pass index; an " +
62
+ "out-of-range index clamps, and the step is pulled out of any nested group it was in). Give " +
63
+ "exactly one of afterId, into or index.",
64
+ inputSchema: {
65
+ auto: autoRefField,
66
+ id: stepIdField,
67
+ afterId: z.string().min(1).optional(),
68
+ into: intoGroupSchema.optional(),
69
+ index: z.number().int().nonnegative().optional(),
70
+ project: projectField,
71
+ },
72
+ }, guarded(({ auto, id, afterId, into, index, project }) => {
73
+ const given = [afterId, into, index].filter((value) => value !== undefined).length;
74
+ if (given !== 1) {
75
+ throw new Error("zenith.edit.moveStep needs exactly one of afterId, into or index.");
76
+ }
77
+ const proj = resolveProject(project);
78
+ const { path, auto: current } = loadCurrent(proj, auto);
79
+ const target = afterId ?? (into === undefined ? index : cast(into));
80
+ return writeEditResult(proj, path, moveStep(current, id, target));
81
+ }));
82
+ server.registerTool("zenith.edit.renameStep", {
83
+ title: "Rename a step",
84
+ description: "Gives the step named id a new explicit id. If it is a child of a parallel group whose " +
85
+ "deadline names the old id, the deadline is updated to the new id too.",
86
+ inputSchema: { auto: autoRefField, id: stepIdField, newId: z.string().min(1), project: projectField },
87
+ }, guarded(({ auto, id, newId, project }) => {
88
+ const proj = resolveProject(project);
89
+ const { path, auto: current } = loadCurrent(proj, auto);
90
+ return writeEditResult(proj, path, renameStep(current, id, newId));
91
+ }));
92
+ server.registerTool("zenith.edit.wrap", {
93
+ title: "Wrap steps in a group",
94
+ description: "Wraps the steps named by ids in a new sequence (kind sequence: they run one after another " +
95
+ "as one member) or parallel group (kind parallel, with mode all, race or deadline; a " +
96
+ "deadline group's deadline is its first member that drives). The steps must be siblings in " +
97
+ "one list and form one unbroken run. Every step keeps the id it had; the new group's id is " +
98
+ "returned as groupId.",
99
+ inputSchema: {
100
+ auto: autoRefField,
101
+ ids: z.array(z.string().min(1)).min(1),
102
+ kind: z.enum(["sequence", "parallel"]),
103
+ mode: z.enum(["all", "race", "deadline"]).optional().describe("Only for kind parallel; all when omitted."),
104
+ project: projectField,
105
+ },
106
+ }, guarded(({ auto, ids, kind, mode, project }) => {
107
+ const proj = resolveProject(project);
108
+ const { path, auto: current } = loadCurrent(proj, auto);
109
+ const wrapped = wrapStepsWithId(current, ids, kind, mode);
110
+ return writeEditResult(proj, path, wrapped.auto, { groupId: wrapped.id });
111
+ }));
112
+ server.registerTool("zenith.edit.unwrap", {
113
+ title: "Unwrap a group",
114
+ description: "Replaces the sequence or parallel group named id with its members, in place. The members " +
115
+ "keep their ids; if the group was the deadline of the group around it, that role passes to " +
116
+ "the member that decided when it ended. A branch cannot be unwrapped.",
117
+ inputSchema: { auto: autoRefField, id: stepIdField, project: projectField },
118
+ }, guarded(({ auto, id, project }) => {
119
+ const proj = resolveProject(project);
120
+ const { path, auto: current } = loadCurrent(proj, auto);
121
+ return writeEditResult(proj, path, unwrapStep(current, id));
122
+ }));
123
+ server.registerTool("zenith.edit.insertAfter", {
124
+ title: "Insert a step in the middle",
125
+ description: "Inserts step right after afterId and, when it is a path, starts it where that step ends " +
126
+ "(from current, or the pose written out inside a parallel group). Returns id, the new step's " +
127
+ "id, and continuityGapStepId: the following path step that now starts away from where the " +
128
+ "robot is, or null. Offer zenith.edit.repairContinuity on it.",
129
+ inputSchema: {
130
+ auto: autoRefField,
131
+ afterId: stepIdField,
132
+ step: stepInputSchema,
133
+ project: projectField,
134
+ },
135
+ }, guarded(({ auto, afterId, step, project }) => {
136
+ const proj = resolveProject(project);
137
+ const { path, auto: current } = loadCurrent(proj, auto);
138
+ const inserted = insertStepAfter(current, afterId, cast(step), proj.waypoints);
139
+ return writeEditResult(proj, path, inserted.auto, {
140
+ id: inserted.id,
141
+ continuityGapStepId: inserted.continuityGapStepId,
142
+ continuityGapIn: inserted.continuityGapIn,
143
+ });
144
+ }));
145
+ server.registerTool("zenith.edit.repairContinuity", {
146
+ title: "Start a path where the robot is",
147
+ description: "Sets the first segment of the path step stepId to start from current, wherever the robot " +
148
+ "is when the step begins. This clears the CONTINUITY gap zenith.edit.insertAfter reports, " +
149
+ "and any other gap between that step and the one before it.",
150
+ inputSchema: { auto: autoRefField, stepId: stepIdField, project: projectField },
151
+ }, guarded(({ auto, stepId, project }) => {
152
+ const proj = resolveProject(project);
153
+ const { path, auto: current } = loadCurrent(proj, auto);
154
+ return writeEditResult(proj, path, repairContinuity(current, stepId));
155
+ }));
156
+ server.registerTool("zenith.edit.setPose", {
157
+ title: "Set a segment endpoint or control point",
158
+ description: "Sets one point of one segment of a path step to a literal pose: a segment endpoint " +
159
+ '("from" or "to", replacing whatever was there — an inline pose, a waypoint ref, or ' +
160
+ '"current") or one Bezier control point.',
161
+ inputSchema: {
162
+ auto: autoRefField,
163
+ stepId: stepIdField,
164
+ target: poseTargetSchema,
165
+ pose: poseInputSchema,
166
+ project: projectField,
167
+ },
168
+ }, guarded(({ auto, stepId, target, pose, project }) => {
169
+ const proj = resolveProject(project);
170
+ const { path, auto: current } = loadCurrent(proj, auto);
171
+ const updated = setPose(current, stepId, target, pose);
172
+ return writeEditResult(proj, path, updated);
173
+ }));
174
+ server.registerTool("zenith.edit.setHeadingMode", {
175
+ title: "Set a path step's heading mode",
176
+ description: "Replaces a path step's heading mode outright: tangent, tangentReversed, constant, linear, facePoint, or piecewise. The editor labels them by Pedro Pathing's names (Tangent, Reverse tangent, Constant, Linear, Facing point, Piecewise), which the runtime compiles to path.tangent(), path.reverseTangent(), path.constant(heading), path.linear(start, end), path.facingPoint(point) and Interpolator.piecewise().until(t, ...). A piecewise heading lists ranges over t 0 to 1 (arc-length fractions of the path), each with its own non-piecewise mode; they must start at 0, meet end to start with no gap or overlap, and end at 1, or validate reports HEADING_RANGES.",
177
+ inputSchema: { auto: autoRefField, stepId: stepIdField, heading: headingSchema, project: projectField },
178
+ }, guarded(({ auto, stepId, heading, project }) => {
179
+ const proj = resolveProject(project);
180
+ const { path, auto: current } = loadCurrent(proj, auto);
181
+ return writeEditResult(proj, path, setHeadingMode(current, stepId, cast(heading)));
182
+ }));
183
+ server.registerTool("zenith.edit.setSpeed", {
184
+ title: "Set a path step's speed fraction",
185
+ description: "Sets a path step's speedFraction (greater than 0, at most 1).",
186
+ inputSchema: {
187
+ auto: autoRefField,
188
+ stepId: stepIdField,
189
+ fraction: z.number().positive().max(1),
190
+ project: projectField,
191
+ },
192
+ }, guarded(({ auto, stepId, fraction, project }) => {
193
+ const proj = resolveProject(project);
194
+ const { path, auto: current } = loadCurrent(proj, auto);
195
+ return writeEditResult(proj, path, setSpeed(current, stepId, fraction));
196
+ }));
197
+ server.registerTool("zenith.edit.addSegment", {
198
+ title: "Add a segment to a path step",
199
+ description: "Appends a segment to a path step's segments. A path's segments must stay continuous; " +
200
+ "zenith.validate (and this tool's returned findings) reports CONTINUITY if they do not.",
201
+ inputSchema: { auto: autoRefField, stepId: stepIdField, segment: segmentSchema, project: projectField },
202
+ }, guarded(({ auto, stepId, segment, project }) => {
203
+ const proj = resolveProject(project);
204
+ const { path, auto: current } = loadCurrent(proj, auto);
205
+ return writeEditResult(proj, path, addSegment(current, stepId, cast(segment)));
206
+ }));
207
+ server.registerTool("zenith.edit.removeSegment", {
208
+ title: "Remove a segment from a path step",
209
+ description: "Removes the segment at segmentIndex from a path step. A path step needs at least one segment.",
210
+ inputSchema: {
211
+ auto: autoRefField,
212
+ stepId: stepIdField,
213
+ segmentIndex: z.number().int().nonnegative(),
214
+ project: projectField,
215
+ },
216
+ }, guarded(({ auto, stepId, segmentIndex, project }) => {
217
+ const proj = resolveProject(project);
218
+ const { path, auto: current } = loadCurrent(proj, auto);
219
+ return writeEditResult(proj, path, removeSegment(current, stepId, segmentIndex));
220
+ }));
221
+ server.registerTool("zenith.edit.addMarker", {
222
+ title: "Add a marker to a path step",
223
+ description: "Adds a marker (a command that fires in parallel with the path, at a point or a distance) to a path step.",
224
+ inputSchema: { auto: autoRefField, stepId: stepIdField, marker: markerSchema, project: projectField },
225
+ }, guarded(({ auto, stepId, marker, project }) => {
226
+ const proj = resolveProject(project);
227
+ const { path, auto: current } = loadCurrent(proj, auto);
228
+ return writeEditResult(proj, path, addMarker(current, stepId, cast(marker)));
229
+ }));
230
+ server.registerTool("zenith.edit.removeMarker", {
231
+ title: "Remove a marker from a path step",
232
+ description: "Removes the marker at markerIndex from a path step.",
233
+ inputSchema: {
234
+ auto: autoRefField,
235
+ stepId: stepIdField,
236
+ markerIndex: z.number().int().nonnegative(),
237
+ project: projectField,
238
+ },
239
+ }, guarded(({ auto, stepId, markerIndex, project }) => {
240
+ const proj = resolveProject(project);
241
+ const { path, auto: current } = loadCurrent(proj, auto);
242
+ return writeEditResult(proj, path, removeMarker(current, stepId, markerIndex));
243
+ }));
244
+ server.registerTool("zenith.edit.setMarkerAt", {
245
+ title: "Move a marker",
246
+ description: "Changes where along the path the marker at markerIndex fires: a path parameter t, a distance, or a distance from the end.",
247
+ inputSchema: {
248
+ auto: autoRefField,
249
+ stepId: stepIdField,
250
+ markerIndex: z.number().int().nonnegative(),
251
+ at: markerAtSchema,
252
+ project: projectField,
253
+ },
254
+ }, guarded(({ auto, stepId, markerIndex, at, project }) => {
255
+ const proj = resolveProject(project);
256
+ const { path, auto: current } = loadCurrent(proj, auto);
257
+ const updated = setMarkerAt(current, stepId, markerIndex, cast(at));
258
+ return writeEditResult(proj, path, updated);
259
+ }));
260
+ server.registerTool("zenith.edit.setCommandArgs", {
261
+ title: "Set a command step's arguments",
262
+ description: "Replaces a command step's args outright. Omit args to clear them.",
263
+ inputSchema: {
264
+ auto: autoRefField,
265
+ stepId: stepIdField,
266
+ args: commandArgsSchema.optional(),
267
+ project: projectField,
268
+ },
269
+ }, guarded(({ auto, stepId, args, project }) => {
270
+ const proj = resolveProject(project);
271
+ const { path, auto: current } = loadCurrent(proj, auto);
272
+ const updated = setCommandArgs(current, stepId, cast(args));
273
+ return writeEditResult(proj, path, updated);
274
+ }));
275
+ server.registerTool("zenith.edit.setTimeout", {
276
+ title: "Set or clear a step's timeout",
277
+ description: "Sets timeoutS on a path, command or wait step; omit timeoutS to clear it. Other step kinds have no timeout.",
278
+ inputSchema: {
279
+ auto: autoRefField,
280
+ stepId: stepIdField,
281
+ timeoutS: z.number().positive().optional(),
282
+ project: projectField,
283
+ },
284
+ }, guarded(({ auto, stepId, timeoutS, project }) => {
285
+ const proj = resolveProject(project);
286
+ const { path, auto: current } = loadCurrent(proj, auto);
287
+ return writeEditResult(proj, path, setStepTimeout(current, stepId, timeoutS));
288
+ }));
289
+ server.registerTool("zenith.edit.setStart", {
290
+ title: "Set the auto's start pose",
291
+ description: "Replaces the auto's start (pose and what it holds) outright.",
292
+ inputSchema: { auto: autoRefField, start: startInputSchema, project: projectField },
293
+ }, guarded(({ auto, start, project }) => {
294
+ const proj = resolveProject(project);
295
+ const { path, auto: current } = loadCurrent(proj, auto);
296
+ return writeEditResult(proj, path, setStart(current, cast(start)));
297
+ }));
298
+ server.registerTool("zenith.edit.setMeta", {
299
+ title: "Set the auto's title, description or authors",
300
+ description: "Merges title, description and authors into the auto. A field left out of meta is " +
301
+ "unchanged; a field given as null is cleared.",
302
+ inputSchema: { auto: autoRefField, meta: autoMetaSchema, project: projectField },
303
+ }, guarded(({ auto, meta, project }) => {
304
+ const proj = resolveProject(project);
305
+ const { path, auto: current } = loadCurrent(proj, auto);
306
+ const patch = {};
307
+ if (Object.hasOwn(meta, "title"))
308
+ patch.title = meta.title ?? undefined;
309
+ if (Object.hasOwn(meta, "description"))
310
+ patch.description = meta.description ?? undefined;
311
+ if (Object.hasOwn(meta, "authors"))
312
+ patch.authors = meta.authors ?? undefined;
313
+ return writeEditResult(proj, path, setMeta(current, patch));
314
+ }));
315
+ server.registerTool("zenith.edit.newAutoFromTemplate", {
316
+ title: "Create a new auto from a template",
317
+ description: "Creates <autosDir>/<name>.auto.json with the given alliance and start pose, and one " +
318
+ "placeholder leg so the file validates immediately. The start pose is in the given alliance's " +
319
+ "own frame: a BLUE auto's poses are where the robot drives as BLUE. Fails if the file " +
320
+ "already exists unless " +
321
+ "force is true.",
322
+ inputSchema: {
323
+ name: z.string().min(1),
324
+ alliance: z.enum(["RED", "BLUE"]),
325
+ start: startInputSchema,
326
+ robotPath: z.string().min(1).optional(),
327
+ fieldPath: z.string().min(1).optional(),
328
+ force: z.boolean().optional(),
329
+ project: projectField,
330
+ },
331
+ }, guarded(({ name, alliance, start, robotPath, fieldPath, force, project }) => {
332
+ const proj = resolveProject(project);
333
+ const path = resolveAutoPath(proj, name);
334
+ if (existsSync(path) && force !== true) {
335
+ throw new Error(`${relativeToRoot(proj, path)} already exists. Pass force: true to overwrite it.`);
336
+ }
337
+ const created = newAutoFromTemplate(name, {
338
+ alliance,
339
+ start: cast(start),
340
+ robotPath,
341
+ fieldPath,
342
+ });
343
+ return writeEditResult(proj, path, created);
344
+ }));
345
+ }
346
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/tools/edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,IAAI,cAAc,EAC5B,UAAU,EACV,eAAe,GAEhB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAg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AAE,OAAO,EAAE,EAAE,EAAE;QAC1E,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,oDAAoD,CAAC,CAAC;QACrG,CAAC;QACD,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,EAAE;YACxC,QAAQ;YACR,KAAK,EAAE,IAAI,CAAgB,KAAK,CAAC;YACjC,SAAS;YACT,SAAS;SACV,CAAC,CAAC;QACH,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** `zenith.project.open`, `zenith.registry`, `zenith.waypoints`. */
3
+ export declare function registerProjectTools(server: McpServer): void;
4
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/tools/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqE5D"}
@@ -0,0 +1,58 @@
1
+ import { listAutoNames, resolveProject } from "../project.js";
2
+ import { guarded, jsonResult } from "../result.js";
3
+ import { projectField } from "../schemas.js";
4
+ /** `zenith.project.open`, `zenith.registry`, `zenith.waypoints`. */
5
+ export function registerProjectTools(server) {
6
+ server.registerTool("zenith.project.open", {
7
+ title: "Open a Zenith project",
8
+ description: "Finds zenith.json (walking up from `dir`, or the server's working directory when `dir` is " +
9
+ "omitted) and returns a summary: the robot's name, footprint and command/condition registry, " +
10
+ "the field's name and size, the waypoint names, and the list of autos in the project. Call " +
11
+ "this first, before any other tool, to learn what an auto file may reference.",
12
+ inputSchema: { dir: projectField },
13
+ }, guarded(({ dir }) => {
14
+ const project = resolveProject(dir);
15
+ return jsonResult({
16
+ root: project.root,
17
+ link: project.link,
18
+ robot: {
19
+ name: project.robot.name,
20
+ footprint: project.robot.footprint,
21
+ commands: project.robot.commands.map((command) => command.name),
22
+ conditions: (project.robot.conditions ?? []).map((condition) => condition.name),
23
+ },
24
+ field: {
25
+ name: project.field.name,
26
+ season: project.field.season,
27
+ sizeIn: project.field.sizeIn,
28
+ canonicalAlliance: project.field.frame.canonicalAlliance,
29
+ mirror: project.field.frame.mirror,
30
+ },
31
+ waypoints: project.waypoints === undefined ? [] : Object.keys(project.waypoints.waypoints),
32
+ autos: listAutoNames(project),
33
+ });
34
+ }));
35
+ server.registerTool("zenith.registry", {
36
+ title: "Read the robot's command and condition registry",
37
+ description: "Returns robot.json's `commands` (name, params, estimateS expression, requires, stationary, " +
38
+ "movesRobot, ledger) and `conditions` in full, so an agent knows the exact vocabulary a " +
39
+ "command step, a marker or a branch/endCondition may use before it writes one.",
40
+ inputSchema: { dir: projectField },
41
+ }, guarded(({ dir }) => {
42
+ const project = resolveProject(dir);
43
+ return jsonResult({
44
+ commands: project.robot.commands,
45
+ conditions: project.robot.conditions ?? [],
46
+ });
47
+ }));
48
+ server.registerTool("zenith.waypoints", {
49
+ title: "Read the project's named waypoints",
50
+ description: "Returns waypoints.json's named poses in full. An auto references one of these by " +
51
+ '`{ "ref": name }`; changing a waypoint changes every auto that uses it.',
52
+ inputSchema: { dir: projectField },
53
+ }, guarded(({ dir }) => {
54
+ const project = resolveProject(dir);
55
+ return jsonResult({ waypoints: project.waypoints?.waypoints ?? {} });
56
+ }));
57
+ }
58
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The Zenith release this MCP server belongs to. */
2
+ export declare const VERSION = "0.1.1";
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,qDAAqD;AACrD,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Written by scripts/stamp-version.mjs from the root package.json; do not edit by hand.
2
+ /** The Zenith release this MCP server belongs to. */
3
+ export const VERSION = "0.1.1";
4
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,qDAAqD;AACrD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@horizon36596/zenith-mcp",
3
+ "version": "0.1.1",
4
+ "description": "The Zenith MCP server: lets an agent read, edit, check, render and simulate FTC autonomous routines over stdio.",
5
+ "keywords": [
6
+ "ftc",
7
+ "first-tech-challenge",
8
+ "robotics",
9
+ "autonomous",
10
+ "zenith",
11
+ "mcp",
12
+ "model-context-protocol",
13
+ "agent"
14
+ ],
15
+ "homepage": "https://libraries.horizon36596.org/zenith/",
16
+ "bugs": {
17
+ "url": "https://github.com/Horizon-36596/zenith/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/Horizon-36596/zenith.git",
22
+ "directory": "packages/mcp"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Horizon (FTC 36596)",
26
+ "type": "module",
27
+ "main": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "bin": {
30
+ "zenith-mcp": "./dist/index.js"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ }
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "!dist/**/*.test.*",
41
+ "!dist/**/*.qa.test.*",
42
+ "!dist/**/testSupport.*",
43
+ "!dist/**/*.tsbuildinfo",
44
+ "!dist/testing",
45
+ "!dist/**/testing.*",
46
+ "spec",
47
+ "README.md",
48
+ "LICENSE",
49
+ "NOTICE"
50
+ ],
51
+ "engines": {
52
+ "node": ">=22"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public",
56
+ "provenance": true
57
+ },
58
+ "dependencies": {
59
+ "@modelcontextprotocol/sdk": "^1.30.0",
60
+ "zod": "^4.6.5",
61
+ "@horizon36596/zenith-cli": "0.1.1",
62
+ "@horizon36596/zenith-schema": "0.1.1",
63
+ "@horizon36596/zenith-seasons": "0.1.1",
64
+ "@horizon36596/zenith-core": "0.1.1"
65
+ },
66
+ "scripts": {}
67
+ }