@mylasertools/kerfscript-mcp 0.0.0-stage → 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.
@@ -0,0 +1,34 @@
1
+ // src/schema.ts
2
+ import { z } from "zod";
3
+ var MAX_SOURCE = 64e3;
4
+ var MAX_REPLY = 1e6;
5
+ var sourceSchema = z.string().max(MAX_SOURCE);
6
+ var value = z.union([
7
+ z.number().finite(),
8
+ z.string().max(2e3),
9
+ z.boolean(),
10
+ z.array(z.number().finite()).max(100)
11
+ ]);
12
+ var renderSchema = z.object({
13
+ source: sourceSchema.describe(
14
+ "KerfScript program. Lengths are millimetres; angles are degrees."
15
+ ),
16
+ params: z.record(z.string().max(100), value).refine((p) => Object.keys(p).length <= 100).optional(),
17
+ libraries: z.record(z.string().max(200), sourceSchema).refine(
18
+ (p) => Object.keys(p).length <= 20 && Object.values(p).reduce((n, s) => n + s.length, 0) <= MAX_SOURCE
19
+ ).optional().describe(
20
+ "Optional virtual libraries keyed by the exact use/include path. No files or URLs are fetched."
21
+ ),
22
+ format: z.enum(["svg", "dxf"]).default("svg"),
23
+ sheet: z.tuple([z.number().positive().max(1e4), z.number().positive().max(1e4)]).optional(),
24
+ kerf: z.number().min(0).max(10).optional(),
25
+ gap: z.number().min(0).max(100).optional(),
26
+ margin: z.number().min(0).max(100).optional(),
27
+ layout: z.enum(["pack", "none"]).default("pack")
28
+ }).strict();
29
+
30
+ export {
31
+ MAX_REPLY,
32
+ sourceSchema,
33
+ renderSchema
34
+ };
@@ -0,0 +1,19 @@
1
+ var __toBinary = /* @__PURE__ */ (() => {
2
+ var table = new Uint8Array(128);
3
+ for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
4
+ return (base64) => {
5
+ var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0);
6
+ for (var i2 = 0, j = 0; i2 < n; ) {
7
+ var c0 = table[base64.charCodeAt(i2++)], c1 = table[base64.charCodeAt(i2++)];
8
+ var c2 = table[base64.charCodeAt(i2++)], c3 = table[base64.charCodeAt(i2++)];
9
+ bytes[j++] = c0 << 2 | c1 >> 4;
10
+ bytes[j++] = c1 << 4 | c2 >> 2;
11
+ bytes[j++] = c2 << 6 | c3;
12
+ }
13
+ return bytes;
14
+ };
15
+ })();
16
+
17
+ export {
18
+ __toBinary
19
+ };