@tsplc/config 0.5.14 → 0.5.15
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 +33 -3
- package/dist/build.js +222 -175
- package/dist/build.js.map +9 -8
- package/dist/index.js +401 -341
- package/dist/index.js.map +10 -9
- package/dist/project-files.js +9 -2
- package/dist/project-files.js.map +3 -3
- package/dist/schema.js +237 -196
- package/dist/schema.js.map +6 -6
- package/package.json +2 -1
- package/src/build-schema.ts +64 -61
- package/src/build.ts +11 -10
- package/src/compiler.ts +80 -58
- package/src/config-module.ts +15 -0
- package/src/environment.ts +45 -34
- package/src/index.ts +10 -1
- package/src/loader.ts +10 -23
- package/src/project-files.ts +14 -0
- package/src/schema.ts +162 -118
package/dist/build.js.map
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/compiler.ts", "../src/build-schema.ts", "../src/project-files.ts", "../src/schema.ts", "../src/build.ts"],
|
|
3
|
+
"sources": ["../src/compiler.ts", "../src/build-schema.ts", "../src/project-files.ts", "../src/schema.ts", "../src/build.ts", "../src/config-module.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { z } from \"zod\";\n\ninterface Diagnostic {\n\torigin: \"config\";\n\tcode: string;\n\tseverity: \"error\";\n\tmessage: string;\n}\n\nexport const
|
|
6
|
-
"import { z } from \"zod\";\nimport { nanosecondsPattern } from \"./compiler\";\n\nexport const commandArgumentSchema = z\n\t.string()\n\t.refine(\n\t\t(value) => value.trim().length > 0,\n\t\t\"Command arguments must not be empty\",\n\t)\n\t.refine(\n\t\t(value) => !/[\"\\r\\n\\0]/.test(value),\n\t\t\"Command arguments must not contain quotes, line breaks, or null bytes\",\n\t);\n// CODESYS startup and project loading can each take several minutes.\nexport const codesysTimeouts = {\n\tbuild: 20 * 60 * 1000,\n\thostCommand: 15_000,\n\truntime: 60_000,\n\tstartup: 20 * 60 * 1000,\n\tstop: 10_000,\n\tterminate: 5000,\n\t// A transfer past this is reported, never interrupted.\n\ttransfer: 30 * 60 * 1000,\n};\n\nconst positiveMilliseconds = z.number().int().positive();\nconst pathSchema = z.string().trim().nonempty();\nexport const tcpPort = z.number().int().min(1).max(65535);\n/** A SHA-256 digest as lowercase hex, the form `node:crypto` writes. */\nexport const sha256Digest = z.string().regex(/^[a-f0-9]{64}$/);\n/** The name of an environment variable a credential is read from, so the config never holds it. */\nexport const envName = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);\nconst wineSchema = z.strictObject({\n\tprefix: pathSchema,\n\tbinary: pathSchema.default(\"wine\"),\n\tpathBinary: pathSchema.default(\"winepath\"),\n\tdebug: z.string().default(\"-all\"),\n\tnativeExit: z.boolean().default(false),\n});\nexport const localCodesysSchema = z.strictObject({\n\texecutable: commandArgumentSchema,\n\tprofile: commandArgumentSchema,\n\twine: wineSchema.optional(),\n\tcommandProcessor: pathSchema.default(\"cmd.exe\"),\n});\n\n// `tsplc configure` builds this tag; every project compiles with it.\nexport const dockerImage = \"tsplc-build:latest\";\nexport const containerCodesys = {\n\texecutable:\n\t\t\"/tmp/codesys-wine/drive_c/CODESYS-3.5.22.30/CODESYS/Common/CODESYS.exe\",\n\tprofile: \"CODESYS V3.5 SP22 Patch 3\",\n\twine: { prefix: \"/tmp/codesys-wine\", nativeExit: true },\n};\nexport const iecName = z.string().regex(/^[A-Za-z][A-Za-z0-9_]*$/);\nexport const taskPriority = z.number().int().min(0).max(31);\nexport const cyclicTasksSchema = z\n\t.array(\n\t\tz.strictObject({\n\t\t\tname: iecName,\n\t\t\tintervalNanoseconds: z\n\t\t\t\t.string()\n\t\t\t\t.regex(nanosecondsPattern)\n\t\t\t\t.refine((value) => {\n\t\t\t\t\t// zod runs this refinement even when the pattern fails, and BigInt throws on a non-integer.\n\t\t\t\t\tif (!nanosecondsPattern.test(value)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tconst ns = BigInt(value);\n\t\t\t\t\treturn ns % 1_000_000n === 0n && ns <= 4_294_967_295_000_000n;\n\t\t\t\t}, \"Cyclic tasks require an exact positive TIME interval in milliseconds\"),\n\t\t\tpriority: taskPriority,\n\t\t\tprograms: z.array(iecName).nonempty(),\n\t\t}),\n\t)\n\t.nonempty()\n\t.superRefine((tasks, context) => {\n\t\tconst names = new Set<string>();\n\t\tconst programs = new Set<string>();\n\t\ttasks.forEach((task, index) => {\n\t\t\tif (names.has(task.name.toLowerCase())) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [index, \"name\"],\n\t\t\t\t\tmessage: \"Task names must be unique\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tnames.add(task.name.toLowerCase());\n\t\t\ttask.programs.forEach((program, position) => {\n\t\t\t\tif (programs.has(program.toLowerCase())) {\n\t\t\t\t\tcontext.addIssue({\n\t\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\t\tpath: [index, \"programs\", position],\n\t\t\t\t\t\tmessage: \"A program can be scheduled only once\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tprograms.add(program.toLowerCase());\n\t\t\t});\n\t\t});\n\t});\nexport type CyclicTask = z.infer<typeof cyclicTasksSchema>[number];\n/** `inverted` reads a BOOL input as its opposite; `shared` lets several bindings read one input. */\nexport const ioBindingOptions = {\n\tinverted: z.boolean().optional(),\n\tshared: z.boolean().optional(),\n};\n/** A process-image address in CODESYS byte addressing, with an optional IEC type. */\nexport const directIoBindingSchema = z.strictObject({\n\taddress: z.string().regex(/^%[IQ](?:X\\d+\\.[0-7]|[BWD]\\d+)$/),\n\ttype: z.string().optional(),\n\t...ioBindingOptions,\n});\n/** The controller's Ethernet interface; omitted settings keep the CODESYS defaults. */\nexport const ethernetSchema = z.strictObject({\n\tinterface: z.string().nonempty().optional(),\n\taddress: z.ipv4().optional(),\n\tsubnet: z.ipv4().optional(),\n\tgateway: z.ipv4().optional(),\n});\n/** The byte where a device's input or output assembly starts in the process image. */\nexport const assemblyAddress = z.string().regex(/^%[IQ]B\\d+$/);\nconst processImageSchema = z.strictObject({\n\taddress: assemblyAddress,\n\tsize: z.number().int().positive(),\n});\n/** A bit or byte channel of a generated device tree. */\nconst channelAddress = z.string().regex(/^%[IQ](?:X\\d+\\.[0-7]|B\\d+)$/);\n/**\n * An EtherNet/IP scanner tree generated from EDS files. Each adapter's EDS is\n * already reduced to its selected connection and raw byte assemblies, so every\n * payload byte becomes one channel pinned at its region's address plus offset.\n */\nexport const deviceTreeSchema = z.strictObject({\n\tethernet: ethernetSchema.default({}),\n\tdevices: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\tname: iecName,\n\t\t\t\teds: z.string().nonempty(),\n\t\t\t\taddress: z.ipv4().optional(),\n\t\t\t\trpiMicroseconds: z.number().int().positive().optional(),\n\t\t\t\tinputs: processImageSchema.optional(),\n\t\t\t\toutputs: processImageSchema.optional(),\n\t\t\t\t// Registers written over Modbus TCP at the adapter's address, with their pinned channels.\n\t\t\t\tmodbus: z\n\t\t\t\t\t.strictObject({\n\t\t\t\t\t\tport: tcpPort,\n\t\t\t\t\t\tregisters: z.array(\n\t\t\t\t\t\t\tz.strictObject({\n\t\t\t\t\t\t\t\tname: iecName,\n\t\t\t\t\t\t\t\toffset: z.number().int().nonnegative(),\n\t\t\t\t\t\t\t\tvalue: z.string().regex(/^%QW\\d+$/),\n\t\t\t\t\t\t\t\twrite: z.string().regex(/^%QX\\d+\\.[0-7]$/),\n\t\t\t\t\t\t\t\tstatus: z.string().regex(/^%IB\\d+$/),\n\t\t\t\t\t\t\t\trequests: z.string().regex(/^%ID\\d+$/),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t\t// Channel comments name the logical IO bound at a pinned byte or bit.\n\t\t\t\tcomments: z\n\t\t\t\t\t.array(\n\t\t\t\t\t\tz.strictObject({\n\t\t\t\t\t\t\taddress: channelAddress,\n\t\t\t\t\t\t\ttext: z.string().nonempty(),\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t\t.default([]),\n\t\t\t}),\n\t\t)\n\t\t.nonempty(),\n\t// Variables mapped to pinned bit or byte channels, relative to the application.\n\tmappings: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\taddress: channelAddress,\n\t\t\t\tvariable: z.string().nonempty(),\n\t\t\t}),\n\t\t)\n\t\t.default([]),\n});\nexport type DeviceTree = z.input<typeof deviceTreeSchema>;\n/** A device or library version as CODESYS repositories spell it: four numbers. */\nexport const fourPartVersion = z.string().regex(/^\\d+\\.\\d+\\.\\d+\\.\\d+$/);\n/** A controller's device repository identity, as CODESYS shows it under Device > Information. */\nexport const controllerSchema = z.strictObject({\n\ttype: z.number().int().positive(),\n\tid: z.string().regex(/^[0-9A-F]{4} [0-9A-F]{4}$/),\n\tversion: fourPartVersion,\n});\nexport type Controller = z.infer<typeof controllerSchema>;\n/** A controller the build image carries, named instead of spelled as its repository identity. */\nexport const controllerTargetSchema = controllerSchema\n\t.pick({ version: true })\n\t.extend({\n\t\ttarget: z.enum([\"linux-sl\", \"virtual-linux-arm64-sl\"]),\n\t});\nexport const controllerDevices = {\n\t\"linux-sl\": { type: 4102, id: \"0000 0005\" },\n\t\"virtual-linux-arm64-sl\": { type: 4096, id: \"0000 1008\" },\n} satisfies Record<\n\tz.infer<typeof controllerTargetSchema>[\"target\"],\n\tOmit<Controller, \"version\">\n>;\n/** The device name each controller target's runtime reports, as its OPC UA node ids spell it. */\nexport const controllerDeviceNames = {\n\t\"linux-sl\": \"CODESYS Control for Linux SL\",\n\t\"virtual-linux-arm64-sl\": \"CODESYS Virtual Control for Linux ARM64 SL\",\n} satisfies Record<z.infer<typeof controllerTargetSchema>[\"target\"], string>;\nexport const configSchema = z.strictObject({\n\tio: z.record(z.string(), directIoBindingSchema).optional(),\n\tdeviceTree: deviceTreeSchema.optional(),\n\t// Replaces the template's controller; the build image must carry its description.\n\tcontroller: controllerSchema.optional(),\n\tlibraryReferences: z.array(z.string().nonempty()).default([]),\n\tlibraries: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\ttitle: z.string(),\n\t\t\t\tcompany: z.string().optional(),\n\t\t\t\tversion: z.string().optional(),\n\t\t\t\tnamespace: z.string().optional(),\n\t\t\t\tpath: pathSchema,\n\t\t\t\tsha256: sha256Digest,\n\t\t\t\turl: z.string().optional(),\n\t\t\t}),\n\t\t)\n\t\t.optional(),\n\tdocker: z\n\t\t.strictObject({\n\t\t\tcpuSet: z\n\t\t\t\t.string()\n\t\t\t\t.regex(/^\\d+(?:-\\d+)?(?:,\\d+(?:-\\d+)?)*$/)\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n\ttemplate: pathSchema.optional(),\n\tsourceDir: pathSchema.default(\"src\"),\n\tentry: pathSchema.default(\"src/Main.st\"),\n\toutDir: pathSchema.default(\"build\"),\n\ttask: z.string().nonempty().default(\"MainTask\"),\n\ttasks: cyclicTasksSchema.optional(),\n\tremoveObjects: z.array(z.string().nonempty()).default([]),\n\tsymbols: z.boolean().default(false),\n\t/**\n\t * Experimental: a project imported into the template, as a build without a cached project or a\n\t * download without a baseline does, brings its POUs in one PLCopenXML import instead of one\n\t * call each, and falls back to one at a time on any error. A host setting, like `docker`.\n\t */\n\tbulkImport: z.boolean().optional(),\n\tonline: z\n\t\t.strictObject({\n\t\t\tnetwork: pathSchema.default(\"bridge\"),\n\t\t\tgateway: z.strictObject({\n\t\t\t\thost: pathSchema,\n\t\t\t\tport: tcpPort.default(1217),\n\t\t\t}),\n\t\t\tdevice: z.strictObject({\n\t\t\t\thost: pathSchema,\n\t\t\t\tport: tcpPort.default(11740),\n\t\t\t}),\n\t\t\tcredentials: z\n\t\t\t\t.strictObject({\n\t\t\t\t\tusernameEnv: envName,\n\t\t\t\t\tpasswordEnv: envName,\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n\ttimeouts: z\n\t\t.strictObject({\n\t\t\tstartup: positiveMilliseconds.default(codesysTimeouts.startup),\n\t\t\tbuild: positiveMilliseconds.default(codesysTimeouts.build),\n\t\t\tstop: positiveMilliseconds.default(codesysTimeouts.stop),\n\t\t\tterminate: positiveMilliseconds.default(codesysTimeouts.terminate),\n\t\t\thostCommand: positiveMilliseconds.default(codesysTimeouts.hostCommand),\n\t\t\truntime: positiveMilliseconds.default(codesysTimeouts.runtime),\n\t\t\t// Unset rather than defaulted, so a release's config still loads on agents that predate them.\n\t\t\t/** A controller operation's work before it touches the controller; `build` when unset. */\n\t\t\tprepare: positiveMilliseconds.optional(),\n\t\t\t/** How long a controller transfer runs before it is reported overdue; it is never interrupted. */\n\t\t\ttransfer: positiveMilliseconds.optional(),\n\t\t})\n\t\t.prefault({}),\n});\nexport type CodesysBuildConfig = z.input<typeof configSchema>;\n\n/**\n * A controller operation's budgets: `prepare` for opening, importing and compiling, after which the\n * worker may be stopped because the controller is untouched; `transfer` for the transfer and what\n * confirms it, after which the operation is only reported overdue, since stopping CODESYS then could\n * leave the controller without an application.\n */\nexport const controllerBudgets = (\n\ttimeouts: z.output<typeof configSchema>[\"timeouts\"],\n) => ({\n\tprepare: timeouts.prepare ?? timeouts.build,\n\ttransfer: timeouts.transfer ?? codesysTimeouts.transfer,\n});\n\n/**\n * The build config a release carries to the plant agent. The agent supplies the output\n * directory and the controller connection; Docker settings belong to the host that built it.\n */\nexport const releaseConfigSchema = configSchema.omit({\n\tdocker: true,\n\toutDir: true,\n\tonline: true,\n\tbulkImport: true,\n});\nexport type ReleaseConfig = z.input<typeof releaseConfigSchema>;\n\n/** The build settings a TypeScript project passes its compiler; the compiler decides the rest. */\nexport const engineeringBuildSchema = configSchema.omit({\n\tsourceDir: true,\n\tentry: true,\n\toutDir: true,\n\ttask: true,\n\ttasks: true,\n});\n\nexport function engineeringBuildOptions(\n\tbuild: CodesysBuildConfig,\n): z.input<typeof engineeringBuildSchema> {\n\tconst {\n\t\tsourceDir: _source,\n\t\tentry: _entry,\n\t\toutDir: _out,\n\t\ttask: _task,\n\t\ttasks: _tasks,\n\t\t...settings\n\t} = build;\n\treturn settings;\n}\n",
|
|
7
|
-
"/** Generated project state, relative to the directory that holds a project's config. */\nexport const generatedDirectory = \".tsplc\";\n\n/** The ST the compiler emits, with the files it publishes beside it for typegen and the debugger. */\nexport const emittedStDirectory = `${generatedDirectory}/artifacts/st`;\n\n/** The files the compiler writes into `emittedStDirectory` for other tools to read. */\nexport const emittedFiles = {\n\tioSymbols: \"io-symbols.json\",\n\tpublication: \"publication.json\",\n\tmachines: \"machines.ts\",\n} as const;\n\n/** Typegen's materialized config and symbols, which the editor reads instead of executing the config. */\nexport const projectSnapshotFile = `${generatedDirectory}/project.json`;\n",
|
|
8
|
-
"import { z } from \"zod\";\nimport {\n\tassemblyAddress,\n\ttype CodesysBuildConfig,\n\tconfigSchema,\n\tcontrollerDeviceNames,\n\tcontrollerDevices,\n\tcontrollerTargetSchema,\n\tcyclicTasksSchema,\n\tdirectIoBindingSchema,\n\tengineeringBuildOptions,\n\tenvName,\n\tethernetSchema,\n\tfourPartVersion,\n\tiecName,\n\tioBindingOptions,\n\ttaskPriority,\n\ttcpPort,\n} from \"./build-schema\";\nimport {\n\tdurationSchema,\n\ttype PlcConfig,\n\ttaskSchema,\n\tvalidateConfig as validateCompilerConfig,\n} from \"./compiler\";\nimport { generatedDirectory } from \"./project-files\";\n\nexport type {\n\tCodesysBuildConfig,\n\tController,\n\tDeviceTree,\n} from \"./build-schema\";\nexport {\n\ttype Duration,\n\tdefinePlcConfig,\n\tdurationHelpers,\n\tms,\n\ttype NormalizedConfig,\n\tns,\n\ttype PlcConfig,\n\ttype SourceExport,\n\tseconds,\n\ttype TargetDescriptor,\n\ttype TaskConfig,\n\tvalidateConfig,\n} from \"./compiler\";\n\nexport const httpOptionsSchema = z\n\t.strictObject({\n\t\ttimeoutMs: z.number().int().positive().max(60000).default(2000),\n\t\tcredentials: z\n\t\t\t.array(\n\t\t\t\tz.strictObject({\n\t\t\t\t\toriginEnv: envName,\n\t\t\t\t\tbearerTokenEnv: envName,\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.default([]),\n\t})\n\t.prefault({});\nexport type HttpOptions = z.infer<typeof httpOptionsSchema>;\n\nconst ioBindingSchema = z.union([\n\tdirectIoBindingSchema,\n\tz.strictObject({\n\t\tdevice: z.string().min(1),\n\t\tchannel: z.string().min(1),\n\t\t...ioBindingOptions,\n\t}),\n]);\n// Each field defaults: the assembly from the connection, the size from the EDS and,\n// with a generated device tree, the address from tsPLC's process-image layout.\nconst assemblySchema = z.strictObject({\n\tassembly: z.number().int().nonnegative().optional(),\n\tsize: z.number().int().positive().optional(),\n\taddress: assemblyAddress.optional(),\n});\nconst hardwareDeviceSchema = z.strictObject({\n\tfile: z.string().min(1),\n\tconnection: z.string().min(1).optional(),\n\tinputs: assemblySchema.optional(),\n\toutputs: assemblySchema.optional(),\n\t// Registers the generated device tree writes over Modbus TCP, at network.address.\n\t// Each maps a name to its wire offset, and is written with FC06 when its write channel rises.\n\tmodbus: z\n\t\t.strictObject({\n\t\t\tport: tcpPort.default(502),\n\t\t\tregisters: z.record(iecName, z.number().int().min(0).max(65535)),\n\t\t})\n\t\t.optional(),\n\tstatusSymbols: z.record(z.string(), z.string()).optional(),\n\t// The adapter's network identity in a generated device tree.\n\tnetwork: z\n\t\t.strictObject({\n\t\t\taddress: z.ipv4().optional(),\n\t\t\trpi: durationSchema\n\t\t\t\t.refine(\n\t\t\t\t\t(rpi) => BigInt(rpi.nanoseconds) % 1000n === 0n,\n\t\t\t\t\t\"An RPI must be a whole number of microseconds.\",\n\t\t\t\t)\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n});\nconst dependencySchema = z.union([\n\tfourPartVersion,\n\tz.strictObject({\n\t\tversion: fourPartVersion,\n\t\tcompany: z.string().optional(),\n\t\tnamespace: z.string().optional(),\n\t}),\n\tz.strictObject({ path: z.string().min(1), namespace: z.string().optional() }),\n]);\n// `backend` is always CODESYS, so tasks get its name and priority rules here, as raw ST schedules do in cyclicTasksSchema.\nconst codesysTaskSchema = taskSchema.extend({\n\tname: iecName,\n\tpriority: taskPriority,\n});\nconst monitorSchema = z\n\t.strictObject({\n\t\tendpoint: z.string().url(),\n\t\tnamespaceUri: z.string().optional(),\n\t\tsymbols: z.array(z.string().min(1)).optional(),\n\t\tsecurityMode: z\n\t\t\t.enum([\"None\", \"Sign\", \"SignAndEncrypt\"])\n\t\t\t.default(\"SignAndEncrypt\"),\n\t\tsecurityPolicy: z.enum([\"None\", \"Basic256Sha256\"]).optional(),\n\t\tcertificateDirectory: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.default(`${generatedDirectory}/opcua-pki`),\n\t\tusername: z.string().min(1).optional(),\n\t\tpasswordEnv: envName.optional(),\n\t})\n\t.superRefine((monitor, context) => {\n\t\tif (\n\t\t\tmonitor.securityPolicy &&\n\t\t\t(monitor.securityMode === \"None\") !== (monitor.securityPolicy === \"None\")\n\t\t) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"securityPolicy\"],\n\t\t\t\tmessage:\n\t\t\t\t\t\"None mode requires None policy; secure modes require Basic256Sha256.\",\n\t\t\t});\n\t\t}\n\t\tif (monitor.passwordEnv && !monitor.username) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"username\"],\n\t\t\t\tmessage: \"Configure username when passwordEnv is used.\",\n\t\t\t});\n\t\t}\n\t\tif (monitor.username && monitor.securityMode === \"None\") {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"securityMode\"],\n\t\t\t\tmessage: \"Username authentication requires a secure OPC-UA connection.\",\n\t\t\t});\n\t\t}\n\t})\n\t.transform((monitor) => ({\n\t\t...monitor,\n\t\tsecurityPolicy:\n\t\t\tmonitor.securityPolicy ??\n\t\t\t(monitor.securityMode === \"None\"\n\t\t\t\t? (\"None\" as const)\n\t\t\t\t: (\"Basic256Sha256\" as const)),\n\t}));\n/**\n * The records each PLC task keeps for its sender (docs/language/telemetry.md): used whenever the\n * program calls `@tsplc/compiler/telemetry`, records unhandled job failures or traces for the debugger.\n */\nexport const telemetrySchema = z.strictObject({\n\t/** Records in each task's ring; older unsent records are overwritten and counted as dropped. */\n\tcapacity: z.number().int().min(4).max(4096).default(64),\n\t/**\n\t * The largest encoded JSON of one record, checked for every call when the program compiles.\n\t * It is fixed rather than fitted to the program, so that a ring keeps its layout from one build\n\t * to the next: CODESYS cannot apply an online change that moves a ring.\n\t */\n\trecordBytes: z.number().int().min(128).max(1024).default(512),\n});\n/**\n * The debugger's fixed-size instrumentation (docs/design/debugging.md). It reads state through\n * the engineering login, so it publishes nothing. Without it a build only carries its build id.\n */\nconst debugSchema = z.strictObject({\n\t/** Records enum state changes, decisions and job starts and ends; for local debugging sessions. */\n\ttrace: z\n\t\t.union([\n\t\t\tz.literal(false),\n\t\t\tz.strictObject({\n\t\t\t\tcapacity: z.number().int().min(16).max(4096).default(256),\n\t\t\t\toperands: z.number().int().min(0).max(8).default(4),\n\t\t\t}),\n\t\t])\n\t\t.default(false),\n\t/**\n\t * Records which statement last wrote each output. With `paths`, also each module storage path\n\t * they match (`*` matching one segment), so the debugger can name the writer exactly.\n\t */\n\twriters: z\n\t\t.union([\n\t\t\tz.boolean(),\n\t\t\tz.strictObject({ paths: z.array(z.string().nonempty()).nonempty() }),\n\t\t])\n\t\t.default(true),\n\tjobs: z.boolean().default(true),\n\t/** Watch groups the debugger opens with: TypeScript paths, `*` matching one path segment. */\n\twatch: z.record(z.string(), z.array(z.string().min(1))).default({}),\n\trequests: z\n\t\t.strictObject({\n\t\t\tcapacity: z.number().int().min(1).max(100_000).default(1000),\n\t\t\t/** Keep service call inputs and outputs; off by default because they may carry data that isn't the debugger's to show. */\n\t\t\tbodies: z.boolean().default(false),\n\t\t})\n\t\t.prefault({}),\n});\nexport const typegenSchema = z.strictObject({\n\ttypes: z.union([z.string(), z.array(z.string())]).optional(),\n\tglobals: z.union([z.string(), z.array(z.string())]).optional(),\n\t/** Directory for the generated `plc.ts`, `hardware.ts` and `machines.ts`. */\n\tdir: z.string().default(\"generated\"),\n\t/** Emit TypeScript declarations in `plc.ts`, not just the runtime field and symbol tables. */\n\tdeclarations: z.boolean().default(true),\n\t/** Emit the I/O binding types and device catalog in `hardware.ts`, not just the publication selectors. */\n\tioTypes: z.boolean().default(true),\n});\nexport const buildTargetSchema = z.enum([\"production\", \"development\"]);\nexport type BuildTarget = z.infer<typeof buildTargetSchema>;\nexport const publicationSchema = z.strictObject({\n\tproduction: z.array(z.string().nonempty()),\n\tdevelopment: z.array(z.string().nonempty()),\n});\nexport type Publication = Readonly<Record<BuildTarget, readonly string[]>>;\n/** Each IO binding's name with the published symbol path the compiler gave it. */\nexport const ioSymbolsSchema = z.record(z.string(), z.string());\n/** A published PLC variable, as `Global.Field`. */\nconst hmiTarget = z.string().regex(/^\\w+(\\.\\w+|\\[\\d+\\])+$/);\n/**\n * What a control is called by the code that reads or runs it: the server's own HMI routes, an\n * app's page, an API forwarding to them. A label is for people and changes with the hardware's.\n */\nconst hmiControlId = z.string().nonempty();\nconst hmiControlSchema = z.discriminatedUnion(\"kind\", [\n\t/** Pulses a BOOL on for 200 ms, like a pushbutton. */\n\tz.strictObject({\n\t\tkind: z.literal(\"button\"),\n\t\tid: hmiControlId,\n\t\tlabel: z.string().nonempty(),\n\t\ttarget: hmiTarget,\n\t\ttone: z.enum([\"start\", \"stop\"]).optional(),\n\t\t/** Ask before pressing, for controls that start motion. */\n\t\tconfirm: z.boolean().optional(),\n\t}),\n\t/** Switches a BOOL on or off, and shows its current state. */\n\tz.strictObject({\n\t\tkind: z.literal(\"toggle\"),\n\t\tid: hmiControlId,\n\t\tlabel: z.string().nonempty(),\n\t\ttarget: hmiTarget,\n\t}),\n\t/** Writes an integer when released, and shows its current value. */\n\tz.strictObject({\n\t\tkind: z.literal(\"slider\"),\n\t\tid: hmiControlId,\n\t\tlabel: z.string().nonempty(),\n\t\ttarget: hmiTarget,\n\t\tmin: z.number().int(),\n\t\tmax: z.number().int(),\n\t}),\n]);\nexport const hmiSchema = z.strictObject({\n\ttitle: z.string().nonempty(),\n\tcontrols: z\n\t\t.array(hmiControlSchema)\n\t\t.default([])\n\t\t.superRefine((controls, context) => {\n\t\t\tconst seen = new Set<string>();\n\t\t\tcontrols.forEach((control, index) => {\n\t\t\t\tif (seen.has(control.id)) {\n\t\t\t\t\tcontext.addIssue({\n\t\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\t\tpath: [index, \"id\"],\n\t\t\t\t\t\tmessage: `Another HMI control already has the id ${control.id}`,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tseen.add(control.id);\n\t\t\t});\n\t\t}),\n\t/** The PLC reports whether each position of these conveyors is occupied, in this order. */\n\tconveyors: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\tlabel: z.string().nonempty(),\n\t\t\t\tpositions: z.number().int().positive(),\n\t\t\t\t/** Positions that are diverters, drawn differently. */\n\t\t\t\tdiverters: z.array(z.number().int().nonnegative()).default([]),\n\t\t\t}),\n\t\t)\n\t\t.default([]),\n});\nexport type HmiConfig = z.input<typeof hmiSchema>;\nexport type ResolvedHmiConfig = z.output<typeof hmiSchema>;\n\nexport const tsplcConfigSchema = z.strictObject({\n\tname: z.string().default(\"Application\"),\n\tbackend: z.literal(\"codesys\"),\n\tpublish: publicationSchema.optional(),\n\tserver: z\n\t\t.strictObject({\n\t\t\tbaseUrlEnv: z.string().optional(),\n\t\t\ttransport: z.enum([\"http\", \"opcua\"]).default(\"http\"),\n\t\t\truntime: z\n\t\t\t\t.strictObject({\n\t\t\t\t\tentry: z.string(),\n\t\t\t\t\ttarget: z\n\t\t\t\t\t\t.enum([\n\t\t\t\t\t\t\t\"bun-linux-x64\",\n\t\t\t\t\t\t\t\"bun-linux-arm64\",\n\t\t\t\t\t\t\t\"bun-darwin-x64\",\n\t\t\t\t\t\t\t\"bun-darwin-arm64\",\n\t\t\t\t\t\t\t\"bun-windows-x64\",\n\t\t\t\t\t\t])\n\t\t\t\t\t\t.optional(),\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n\tcompiler: z\n\t\t.strictObject({\n\t\t\ttsconfig: z.string().default(\"tsconfig.json\"),\n\t\t\tprograms: z.record(\n\t\t\t\tz.string(),\n\t\t\t\tz.strictObject({ module: z.string(), export: z.string() }),\n\t\t\t),\n\t\t})\n\t\t.optional(),\n\ttasks: z.array(codesysTaskSchema).nonempty().optional(),\n\t// Keep an authored legacy task distinguishable from resolveConfig's default.\n\t// An explicit shared schedule must have a single owner.\n\tbuild: configSchema\n\t\t.extend({ task: configSchema.shape.task.unwrap().optional() })\n\t\t.optional(),\n\tcodesys: z\n\t\t.strictObject({\n\t\t\thttp: httpOptionsSchema.optional(),\n\t\t\tprogramNames: z.record(z.string(), z.string()).optional(),\n\t\t\t// Generate an EtherNet/IP scanner with one adapter per entry in devices.\n\t\t\tdeviceTree: z\n\t\t\t\t.strictObject({ ethernet: ethernetSchema.optional() })\n\t\t\t\t.optional(),\n\t\t\t// Each omitted controller keeps the template's device. See controllerFor.\n\t\t\tcontrollers: z\n\t\t\t\t.strictObject({\n\t\t\t\t\tproduction: controllerTargetSchema.optional(),\n\t\t\t\t\tdevelopment: controllerTargetSchema.optional(),\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n\teds: z.union([z.string(), z.array(z.string())]).default(\"eds\"),\n\tdevices: z.record(z.string(), hardwareDeviceSchema).default({}),\n\tio: z.record(z.string(), ioBindingSchema).default({}),\n\tdependencies: z.record(z.string(), dependencySchema).default({}),\n\t// Raw ST builds opt into PLC contract generation by configuring this section.\n\ttypegen: typegenSchema.optional(),\n\tmonitor: monitorSchema.optional(),\n\thmi: hmiSchema.optional(),\n\ttelemetry: telemetrySchema.optional(),\n\tdebug: debugSchema.optional(),\n\t/**\n\t * Where the program runs, each with literal values for environment variables, which win over the\n\t * environment, and the plant agent that deploys to it.\n\t */\n\ttargets: z\n\t\t.record(\n\t\t\tz.string().nonempty(),\n\t\t\tz.strictObject({\n\t\t\t\tvalues: z.record(envName, z.string()).default({}),\n\t\t\t\tagent: z.strictObject({ url: z.url() }).optional(),\n\t\t\t}),\n\t\t)\n\t\t.default({}),\n\t/** Variables a release for the plant agent leaves to it, which reads them from Bun.secrets on its own PC. */\n\tsecrets: z\n\t\t.strictObject({\n\t\t\tservice: z.string().nonempty(),\n\t\t\tnames: z.array(envName).nonempty(),\n\t\t})\n\t\t.optional(),\n});\nexport type TsplcConfig = z.input<typeof tsplcConfigSchema>;\nexport type ResolvedTsplcConfig = z.output<typeof tsplcConfigSchema>;\nexport type HardwareDevice = z.infer<typeof hardwareDeviceSchema>;\nexport type ResolvedTelemetryConfig = z.output<typeof telemetrySchema>;\nexport type ResolvedDebugConfig = z.output<typeof debugSchema>;\nexport type LibraryDependency = z.infer<typeof dependencySchema>;\n/** A binding resolved to its process-image address, as `compilerConfig` receives it. */\ntype DirectIoBinding = z.infer<typeof directIoBindingSchema>;\n\n/**\n * `build` compiles for the production controller. `run` and controller\n * operations target the local runtime, so they compile for the development one.\n */\nexport const buildTargetFor = (command: string): BuildTarget =>\n\t[\"run\", \"download\", \"online-change\", \"inspect\"].includes(command)\n\t\t? \"development\"\n\t\t: \"production\";\nexport const controllerFor = (config: ResolvedTsplcConfig, command: string) => {\n\tconst controller = config.codesys?.controllers?.[buildTargetFor(command)];\n\treturn (\n\t\tcontroller && {\n\t\t\t...controllerDevices[controller.target],\n\t\t\tversion: controller.version,\n\t\t}\n\t);\n};\n\n/** The name of the device `command` runs on: the configured controller, else Linux SL, the local runtime `run` deploys to. */\nexport const controllerDeviceName = (\n\tconfig: ResolvedTsplcConfig,\n\tcommand: string,\n) =>\n\tcontrollerDeviceNames[\n\t\tconfig.codesys?.controllers?.[buildTargetFor(command)]?.target ?? \"linux-sl\"\n\t];\n\n/**\n * The variable holding the bearer token the PLC sends the project's own server: the HTTP\n * credential for the server's base URL.\n */\nexport const serverTokenEnv = (config: ResolvedTsplcConfig) =>\n\tconfig.codesys?.http?.credentials.find(\n\t\t({ originEnv }) => originEnv === config.server?.baseUrlEnv,\n\t)?.bearerTokenEnv;\n\n/**\n * The project without fieldbus I/O, for a plant simulator that writes inputs over\n * OPC UA: fieldbus input copies would overwrite those writes every scan.\n */\nexport const simulationConfig = (\n\tconfig: ResolvedTsplcConfig,\n): ResolvedTsplcConfig => ({\n\t...config,\n\teds: [],\n\tdevices: {},\n\tio: {},\n\t...(config.codesys && {\n\t\tcodesys: {\n\t\t\t...config.codesys,\n\t\t\tdeviceTree: undefined,\n\t\t},\n\t}),\n});\n\n/** All paths are relative to this file; no package has a second project config. */\nexport function defineConfig<const C extends TsplcConfig>(config: C): C {\n\treturn config;\n}\n\n/** Raw ST program names already are IEC names; use the shared schedule directly. */\nexport function rawBuildConfig(\n\tconfig: ResolvedTsplcConfig,\n): CodesysBuildConfig {\n\tif (config.compiler) {\n\t\tthrow new Error(\"Use the compiler build plan for TypeScript projects.\");\n\t}\n\tif (!config.build) {\n\t\tthrow new Error(\"Configure build settings.\");\n\t}\n\tif (!config.tasks) {\n\t\treturn config.build;\n\t}\n\tif (config.build.tasks || config.build.task !== undefined) {\n\t\tthrow new Error(\n\t\t\t\"Configure the raw ST schedule in tasks or build.tasks/build.task, not both.\",\n\t\t);\n\t}\n\treturn {\n\t\t...config.build,\n\t\ttasks: cyclicTasksSchema.parse(\n\t\t\tconfig.tasks.map((task) => ({\n\t\t\t\tname: task.name,\n\t\t\t\tintervalNanoseconds: task.schedule.interval.nanoseconds,\n\t\t\t\tpriority: task.priority,\n\t\t\t\tprograms: task.programs,\n\t\t\t})),\n\t\t),\n\t};\n}\n\n/** Adapt the shared project to the compiler's backend-independent scan model. */\nexport function compilerConfig(\n\tconfig: ResolvedTsplcConfig,\n\tio: Record<string, DirectIoBinding>,\n\tbuildTarget: BuildTarget = \"production\",\n) {\n\tif (!config.compiler || !config.tasks) {\n\t\tthrow new Error(\n\t\t\t\"This project uses raw Structured Text; no TypeScript compiler is configured.\",\n\t\t);\n\t}\n\t// The device tree and controllers are build-time engineering; the compiler only sees addresses.\n\tconst {\n\t\tdeviceTree: _deviceTree,\n\t\tcontrollers: _controllers,\n\t\t...codesys\n\t} = config.codesys ?? {};\n\tconst value: PlcConfig = {\n\t\tname: config.name,\n\t\ttsconfig: config.compiler.tsconfig,\n\t\tprograms: config.compiler.programs,\n\t\ttasks: config.tasks,\n\t\ttarget: {\n\t\t\tkind: config.backend,\n\t\t\toptions: {\n\t\t\t\t...codesys,\n\t\t\t\tpublish: config.publish,\n\t\t\t\tbuildTarget,\n\t\t\t\tio: Object.fromEntries(\n\t\t\t\t\tObject.entries(io).map(([name, binding]) => [\n\t\t\t\t\t\tname,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkind: \"direct\",\n\t\t\t\t\t\t\t...binding,\n\t\t\t\t\t\t\t...(mappedChannel(config, name, binding) && { mapped: true }),\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tengineering: {\n\t\t\t\t\tkind: \"v3.5\",\n\t\t\t\t\t...(config.build\n\t\t\t\t\t\t? { build: engineeringBuildOptions(config.build) }\n\t\t\t\t\t\t: {}),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t};\n\tconst validated = validateCompilerConfig(value);\n\tif (!validated.config) {\n\t\tthrow new Error(\n\t\t\tvalidated.diagnostics.map((item) => item.message).join(\"\\n\"),\n\t\t);\n\t}\n\treturn validated.config;\n}\n\n/**\n * A generated device tree maps a device's bit or byte scalar to its variable in the\n * I/O mapping. Wider values span several byte channels and keep an AT declaration.\n */\nfunction mappedChannel(\n\tconfig: ResolvedTsplcConfig,\n\tname: string,\n\tbinding: DirectIoBinding,\n) {\n\tconst source = config.io[name];\n\treturn (\n\t\tconfig.codesys?.deviceTree !== undefined &&\n\t\tsource !== undefined &&\n\t\t\"device\" in source &&\n\t\t// A channel maps to one variable as it stands, so these need an AT wire and a copy.\n\t\t!binding.inverted &&\n\t\t!binding.shared &&\n\t\t/^%[IQ][XB]/.test(binding.address) &&\n\t\t!/^ARRAY/i.test(binding.type ?? \"\")\n\t);\n}\n",
|
|
9
|
-
"import { dirname, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport type { z } from \"zod\";\nimport {\n\ttype CodesysBuildConfig,\n\tconfigSchema,\n\tcontainerCodesys,\n\tlocalCodesysSchema,\n} from \"./build-schema\";\n\nexport {\n\ttype CodesysBuildConfig,\n\ttype Controller,\n\ttype CyclicTask,\n\tcodesysTimeouts,\n\tcommandArgumentSchema,\n\tconfigSchema,\n\tcontainerCodesys,\n\tcontrollerBudgets,\n\tcontrollerSchema,\n\tcyclicTasksSchema,\n\ttype DeviceTree,\n\tdeviceTreeSchema,\n\tdirectIoBindingSchema,\n\tdockerImage,\n\tengineeringBuildSchema,\n\tethernetSchema,\n\tiecName,\n\ttype ReleaseConfig,\n\treleaseConfigSchema,\n\tsha256Digest,\n\ttcpPort,\n} from \"./build-schema\";\n\nexport type ResolvedConfig = z.output<typeof configSchema> & {\n\ttemplate: string;\n\tconfigFile: string;\n\tcodesys: z.output<typeof localCodesysSchema>;\n};\n\
|
|
5
|
+
"import { nanosecondsPerMillisecond } from \"@tsplc/iec\";\nimport { z } from \"zod\";\n\ninterface Diagnostic {\n\torigin: \"config\";\n\tcode: string;\n\tseverity: \"error\";\n\tmessage: string;\n}\n\nexport const nanosecondsSchema = z\n\t.string()\n\t.regex(/^[1-9][0-9]*$/, { abort: true });\nexport const durationSchema = z.strictObject({\n\tkind: z.literal(\"duration\"),\n\tnanoseconds: nanosecondsSchema,\n});\n\nexport type Duration = z.infer<typeof durationSchema>;\n\nfunction duration(value: number, scale: number): Duration {\n\tif (!Number.isFinite(value) || value <= 0) {\n\t\tthrow new Error(\"Task duration must be finite and positive.\");\n\t}\n\tconst nanoseconds = value * scale;\n\tif (!Number.isSafeInteger(nanoseconds)) {\n\t\tthrow new Error(\n\t\t\t\"Task duration must be an exact, safe number of nanoseconds.\",\n\t\t);\n\t}\n\treturn { kind: \"duration\", nanoseconds: String(nanoseconds) };\n}\n\nexport const ns = (value: number): Duration => duration(value, 1);\nexport const ms = (value: number): Duration =>\n\tduration(value, Number(nanosecondsPerMillisecond));\nexport const seconds = (value: number): Duration =>\n\tduration(value, Number(nanosecondsPerMillisecond) * 1000);\n\n/** The helpers a config calls to write a duration, by the name it calls them. */\nexport const durationHelpers = { ns, ms, seconds };\n\nexport const sourceExportSchema = z.strictObject({\n\tmodule: z.string().nonempty(),\n\texport: z.string().nonempty(),\n});\n// Names and priorities are only bounded here; a backend narrows them to what its scheduler accepts.\nexport const taskSchema = z.strictObject({\n\tname: z.string().nonempty(),\n\tschedule: z.strictObject({\n\t\tkind: z.literal(\"cyclic\"),\n\t\tinterval: durationSchema,\n\t}),\n\tpriority: z.number().int().nonnegative(),\n\tprograms: z.array(z.string().nonempty()).nonempty(),\n});\n\n/**\n * Where a schedule repeats itself, in the order it reads: each task named as an earlier one\n * (`position` null), and each program a task schedules that an earlier position already does.\n * IEC names ignore case, so two that differ only in case repeat each other.\n */\nexport const scheduleRepeats = (\n\ttasks: readonly { name: string; programs: readonly string[] }[],\n) => {\n\tconst names = new Set<string>();\n\tconst programs = new Set<string>();\n\tconst repeats: { task: number; position: number | null }[] = [];\n\ttasks.forEach((task, index) => {\n\t\tconst name = task.name.toUpperCase();\n\t\tif (names.has(name)) {\n\t\t\trepeats.push({ task: index, position: null });\n\t\t}\n\t\tnames.add(name);\n\t\ttask.programs.forEach((program, position) => {\n\t\t\tconst scheduled = program.toUpperCase();\n\t\t\tif (programs.has(scheduled)) {\n\t\t\t\trepeats.push({ task: index, position });\n\t\t\t}\n\t\t\tprograms.add(scheduled);\n\t\t});\n\t});\n\treturn repeats;\n};\n\n// Shared configuration validates the target envelope. Each backend owns its\n// options schema and hardware-specific scheduling/addressing constraints.\nconst targetSchema = z.strictObject({\n\tkind: z.string().nonempty(),\n\toptions: z.unknown().refine((value) => value !== undefined, {\n\t\tmessage: \"Target options are required.\",\n\t}),\n});\nconst common = {\n\tname: z.string().nonempty(),\n\ttsconfig: z.string().nonempty(),\n\ttasks: z.array(taskSchema).nonempty(),\n\ttarget: targetSchema,\n};\nconst entryConfigSchema = z.strictObject({\n\t...common,\n\tentry: sourceExportSchema,\n});\nconst programsConfigSchema = z.strictObject({\n\t...common,\n\tprograms: z.record(z.string().nonempty(), sourceExportSchema),\n});\n\nexport type TargetDescriptor<Options = unknown> = Omit<\n\tz.infer<typeof targetSchema>,\n\t\"options\"\n> & { options: Options };\nexport type SourceExport = z.infer<typeof sourceExportSchema>;\nexport type TaskConfig = Omit<z.infer<typeof taskSchema>, \"programs\"> & {\n\tprograms: readonly string[];\n};\n\n// Readonly lists, unlike the schemas' output, so a config written `as const` is accepted.\nexport type PlcConfig<Target extends TargetDescriptor = TargetDescriptor> = {\n\tname: string;\n\ttsconfig: string;\n\ttasks: readonly TaskConfig[];\n\ttarget: Target;\n} & (\n\t| { entry: SourceExport; programs?: never }\n\t| { programs: Readonly<Record<string, SourceExport>>; entry?: never }\n);\n\nexport type NormalizedConfig = z.output<typeof programsConfigSchema>;\n\nexport function definePlcConfig<const C extends PlcConfig>(config: C): C {\n\treturn config;\n}\n\nexport function validateConfig(value: unknown): {\n\tconfig?: NormalizedConfig;\n\tdiagnostics: readonly Diagnostic[];\n} {\n\tconst multiplePrograms =\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\tObject.hasOwn(value, \"programs\") &&\n\t\t!Object.hasOwn(value, \"entry\");\n\tconst parsed = (\n\t\tmultiplePrograms ? programsConfigSchema : entryConfigSchema\n\t).safeParse(value);\n\tif (!parsed.success) {\n\t\treturn {\n\t\t\tdiagnostics: parsed.error.issues.map((issue) => ({\n\t\t\t\torigin: \"config\",\n\t\t\t\tcode: \"PLC5001\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tmessage: `${issue.path.join(\".\") || \"config\"}: ${issue.message}`,\n\t\t\t})),\n\t\t};\n\t}\n\n\tconst { data } = parsed;\n\tconst programs = \"entry\" in data ? { main: data.entry } : data.programs;\n\tconst diagnostics: Diagnostic[] = [];\n\tconst report = (message: string): void => {\n\t\tdiagnostics.push({\n\t\t\torigin: \"config\",\n\t\t\tcode: \"PLC5002\",\n\t\t\tseverity: \"error\",\n\t\t\tmessage,\n\t\t});\n\t};\n\tif (Object.keys(programs).length === 0) {\n\t\treport(\"At least one program is required.\");\n\t}\n\n\tconst repeats = scheduleRepeats(data.tasks);\n\tconst repeated = (task: number, position: number | null) =>\n\t\trepeats.some(\n\t\t\t(repeat) => repeat.task === task && repeat.position === position,\n\t\t);\n\tdata.tasks.forEach((task, index) => {\n\t\tif (repeated(index, null)) {\n\t\t\treport(`Duplicate task name: ${task.name}.`);\n\t\t}\n\t\ttask.programs.forEach((program, position) => {\n\t\t\tif (!Object.hasOwn(programs, program)) {\n\t\t\t\treport(`Task ${task.name} references unknown program ${program}.`);\n\t\t\t}\n\t\t\tif (repeated(index, position)) {\n\t\t\t\treport(`Program ${program} must belong to exactly one task.`);\n\t\t\t}\n\t\t});\n\t});\n\tconst scheduled = new Set(data.tasks.flatMap((task) => task.programs));\n\tfor (const program of Object.keys(programs)) {\n\t\tif (!scheduled.has(program)) {\n\t\t\treport(`Program ${program} is not assigned to a task.`);\n\t\t}\n\t}\n\n\tif (diagnostics.length) {\n\t\treturn { diagnostics };\n\t}\n\treturn {\n\t\tconfig: {\n\t\t\tname: data.name,\n\t\t\ttsconfig: data.tsconfig,\n\t\t\tprograms,\n\t\t\ttasks: data.tasks,\n\t\t\ttarget: data.target,\n\t\t},\n\t\tdiagnostics,\n\t};\n}\n",
|
|
6
|
+
"import { latestTimeNanoseconds, nanosecondsPerMillisecond } from \"@tsplc/iec\";\nimport { generatedNamePattern } from \"@tsplc/iec/st\";\nimport { z } from \"zod\";\nimport { nanosecondsSchema, scheduleRepeats } from \"./compiler\";\n\nexport const commandArgumentSchema = z\n\t.string()\n\t.refine(\n\t\t(value) => value.trim().length > 0,\n\t\t\"Command arguments must not be empty\",\n\t)\n\t.refine(\n\t\t(value) => !/[\"\\r\\n\\0]/.test(value),\n\t\t\"Command arguments must not contain quotes, line breaks, or null bytes\",\n\t);\n// CODESYS startup and project loading can each take several minutes.\nexport const codesysTimeouts = {\n\tbuild: 20 * 60 * 1000,\n\thostCommand: 15_000,\n\truntime: 60_000,\n\tstartup: 20 * 60 * 1000,\n\tstop: 10_000,\n\tterminate: 5000,\n\t// A transfer past this is reported, never interrupted.\n\ttransfer: 30 * 60 * 1000,\n};\n\nconst positiveMilliseconds = z.number().int().positive();\nconst pathSchema = z.string().trim().nonempty();\nexport const tcpPort = z.number().int().min(1).max(65535);\n// The ports CODESYS listens on by default: its runtime, its gateway and the controller's OPC UA server.\nexport const runtimePort = 11740;\nexport const gatewayPort = 1217;\nexport const opcuaPort = 4840;\n/** A SHA-256 digest as lowercase hex, the form `node:crypto` writes. */\nexport const sha256Digest = z.string().regex(/^[a-f0-9]{64}$/);\n/** The name of an environment variable a credential is read from, so the config never holds it. */\nexport const envName = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);\nconst wineSchema = z.strictObject({\n\tprefix: pathSchema,\n\tbinary: pathSchema.default(\"wine\"),\n\tpathBinary: pathSchema.default(\"winepath\"),\n\tdebug: z.string().default(\"-all\"),\n\tnativeExit: z.boolean().default(false),\n});\nexport const localCodesysSchema = z.strictObject({\n\texecutable: commandArgumentSchema,\n\tprofile: commandArgumentSchema,\n\twine: wineSchema.optional(),\n\tcommandProcessor: pathSchema.default(\"cmd.exe\"),\n});\n\n// `tsplc configure` builds this tag; every project compiles with it.\nexport const dockerImage = \"tsplc-build:latest\";\nexport const containerCodesys = {\n\texecutable:\n\t\t\"/tmp/codesys-wine/drive_c/CODESYS-3.5.22.30/CODESYS/Common/CODESYS.exe\",\n\tprofile: \"CODESYS V3.5 SP22 Patch 3\",\n\twine: { prefix: \"/tmp/codesys-wine\", nativeExit: true },\n};\nexport const iecName = z.string().regex(generatedNamePattern);\nexport const taskPriority = z.number().int().min(0).max(31);\nexport const cyclicTasksSchema = z\n\t.array(\n\t\tz.strictObject({\n\t\t\tname: iecName,\n\t\t\tintervalNanoseconds: nanosecondsSchema.refine((value) => {\n\t\t\t\tconst ns = BigInt(value);\n\t\t\t\treturn (\n\t\t\t\t\tns % nanosecondsPerMillisecond === 0n && ns <= latestTimeNanoseconds\n\t\t\t\t);\n\t\t\t}, \"Cyclic tasks require an exact positive TIME interval in milliseconds\"),\n\t\t\tpriority: taskPriority,\n\t\t\tprograms: z.array(iecName).nonempty(),\n\t\t}),\n\t)\n\t.nonempty()\n\t.superRefine((tasks, context) => {\n\t\tfor (const { task, position } of scheduleRepeats(tasks)) {\n\t\t\tcontext.addIssue(\n\t\t\t\tposition === null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\t\t\tpath: [task, \"name\"],\n\t\t\t\t\t\t\tmessage: \"Task names must be unique\",\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\t\t\tpath: [task, \"programs\", position],\n\t\t\t\t\t\t\tmessage: \"A program can be scheduled only once\",\n\t\t\t\t\t\t},\n\t\t\t);\n\t\t}\n\t});\nexport type CyclicTask = z.infer<typeof cyclicTasksSchema>[number];\n/** `inverted` reads a BOOL input as its opposite; `shared` lets several bindings read one input. */\nexport const ioBindingOptions = {\n\tinverted: z.boolean().optional(),\n\tshared: z.boolean().optional(),\n};\n/** A process-image address in CODESYS byte addressing, with an optional IEC type. */\nexport const directIoBindingSchema = z.strictObject({\n\taddress: z.string().regex(/^%[IQ](?:X\\d+\\.[0-7]|[BWD]\\d+)$/),\n\ttype: z.string().optional(),\n\t...ioBindingOptions,\n});\nexport type DirectIoBinding = z.infer<typeof directIoBindingSchema>;\n/** The controller's Ethernet interface; omitted settings keep the CODESYS defaults. */\nexport const ethernetSchema = z.strictObject({\n\tinterface: z.string().nonempty().optional(),\n\taddress: z.ipv4().optional(),\n\tsubnet: z.ipv4().optional(),\n\tgateway: z.ipv4().optional(),\n});\n/** The byte where a device's input or output assembly starts in the process image. */\nexport const assemblyAddress = z.string().regex(/^%[IQ]B\\d+$/);\nconst processImageSchema = z.strictObject({\n\taddress: assemblyAddress,\n\tsize: z.number().int().positive(),\n});\n/** A bit or byte channel of a generated device tree. */\nexport const channelAddress = z.string().regex(/^%[IQ](?:X\\d+\\.[0-7]|B\\d+)$/);\n/**\n * An EtherNet/IP scanner tree generated from EDS files. Each adapter's EDS is\n * already reduced to its selected connection and raw byte assemblies, so every\n * payload byte becomes one channel pinned at its region's address plus offset.\n */\nexport const deviceTreeSchema = z.strictObject({\n\tethernet: ethernetSchema.default({}),\n\tdevices: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\tname: iecName,\n\t\t\t\teds: z.string().nonempty(),\n\t\t\t\taddress: z.ipv4().optional(),\n\t\t\t\trpiMicroseconds: z.number().int().positive().optional(),\n\t\t\t\tinputs: processImageSchema.optional(),\n\t\t\t\toutputs: processImageSchema.optional(),\n\t\t\t\t// Registers written over Modbus TCP at the adapter's address, with their pinned channels.\n\t\t\t\tmodbus: z\n\t\t\t\t\t.strictObject({\n\t\t\t\t\t\tport: tcpPort,\n\t\t\t\t\t\tregisters: z.array(\n\t\t\t\t\t\t\tz.strictObject({\n\t\t\t\t\t\t\t\tname: iecName,\n\t\t\t\t\t\t\t\toffset: z.number().int().nonnegative(),\n\t\t\t\t\t\t\t\tvalue: z.string().regex(/^%QW\\d+$/),\n\t\t\t\t\t\t\t\twrite: z.string().regex(/^%QX\\d+\\.[0-7]$/),\n\t\t\t\t\t\t\t\tstatus: z.string().regex(/^%IB\\d+$/),\n\t\t\t\t\t\t\t\trequests: z.string().regex(/^%ID\\d+$/),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t\t// Channel comments name the logical IO bound at a pinned byte or bit.\n\t\t\t\tcomments: z\n\t\t\t\t\t.array(\n\t\t\t\t\t\tz.strictObject({\n\t\t\t\t\t\t\taddress: channelAddress,\n\t\t\t\t\t\t\ttext: z.string().nonempty(),\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t\t.default([]),\n\t\t\t}),\n\t\t)\n\t\t.nonempty(),\n\t// Variables mapped to pinned bit or byte channels, relative to the application.\n\tmappings: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\taddress: channelAddress,\n\t\t\t\tvariable: z.string().nonempty(),\n\t\t\t}),\n\t\t)\n\t\t.default([]),\n});\nexport type DeviceTree = z.input<typeof deviceTreeSchema>;\n/** A device or library version as CODESYS repositories spell it: four numbers. */\nexport const fourPartVersion = z.string().regex(/^\\d+\\.\\d+\\.\\d+\\.\\d+$/);\n/** A controller's device repository identity, as CODESYS shows it under Device > Information. */\nexport const controllerSchema = z.strictObject({\n\ttype: z.number().int().positive(),\n\tid: z.string().regex(/^[0-9A-F]{4} [0-9A-F]{4}$/),\n\tversion: fourPartVersion,\n});\nexport type Controller = z.infer<typeof controllerSchema>;\n/** A controller the build image carries, named instead of spelled as its repository identity. */\nexport const controllerTargetSchema = controllerSchema\n\t.pick({ version: true })\n\t.extend({\n\t\ttarget: z.enum([\"linux-sl\", \"virtual-linux-arm64-sl\"]),\n\t});\n/**\n * Each controller target's repository identity, and the device name its runtime reports, as its\n * OPC UA node ids spell it.\n */\nexport const controllerTargets = {\n\t\"linux-sl\": {\n\t\tdevice: { type: 4102, id: \"0000 0005\" },\n\t\tdeviceName: \"CODESYS Control for Linux SL\",\n\t},\n\t\"virtual-linux-arm64-sl\": {\n\t\tdevice: { type: 4096, id: \"0000 1008\" },\n\t\tdeviceName: \"CODESYS Virtual Control for Linux ARM64 SL\",\n\t},\n} satisfies Record<\n\tz.infer<typeof controllerTargetSchema>[\"target\"],\n\t{ device: Omit<Controller, \"version\">; deviceName: string }\n>;\nexport const configSchema = z.strictObject({\n\tio: z.record(z.string(), directIoBindingSchema).optional(),\n\tdeviceTree: deviceTreeSchema.optional(),\n\t// Replaces the template's controller; the build image must carry its description.\n\tcontroller: controllerSchema.optional(),\n\tlibraryReferences: z.array(z.string().nonempty()).default([]),\n\tlibraries: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\ttitle: z.string(),\n\t\t\t\tcompany: z.string().optional(),\n\t\t\t\tversion: z.string().optional(),\n\t\t\t\tnamespace: z.string().optional(),\n\t\t\t\tpath: pathSchema,\n\t\t\t\tsha256: sha256Digest,\n\t\t\t\turl: z.string().optional(),\n\t\t\t}),\n\t\t)\n\t\t.optional(),\n\tdocker: z\n\t\t.strictObject({\n\t\t\tcpuSet: z\n\t\t\t\t.string()\n\t\t\t\t.regex(/^\\d+(?:-\\d+)?(?:,\\d+(?:-\\d+)?)*$/)\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n\ttemplate: pathSchema.optional(),\n\tsourceDir: pathSchema.default(\"src\"),\n\tentry: pathSchema.default(\"src/Main.st\"),\n\toutDir: pathSchema.default(\"build\"),\n\ttask: z.string().nonempty().default(\"MainTask\"),\n\ttasks: cyclicTasksSchema.optional(),\n\tremoveObjects: z.array(z.string().nonempty()).default([]),\n\tsymbols: z.boolean().default(false),\n\t/**\n\t * Experimental: a project imported into the template, as a build without a cached project or a\n\t * download without a baseline does, brings its POUs in one PLCopenXML import instead of one\n\t * call each, and falls back to one at a time on any error. A host setting, like `docker`.\n\t */\n\tbulkImport: z.boolean().optional(),\n\tonline: z\n\t\t.strictObject({\n\t\t\tnetwork: pathSchema.default(\"bridge\"),\n\t\t\tgateway: z.strictObject({\n\t\t\t\thost: pathSchema,\n\t\t\t\tport: tcpPort.default(gatewayPort),\n\t\t\t}),\n\t\t\tdevice: z.strictObject({\n\t\t\t\thost: pathSchema,\n\t\t\t\tport: tcpPort.default(runtimePort),\n\t\t\t}),\n\t\t\tcredentials: z\n\t\t\t\t.strictObject({\n\t\t\t\t\tusernameEnv: envName,\n\t\t\t\t\tpasswordEnv: envName,\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n\ttimeouts: z\n\t\t.strictObject({\n\t\t\tstartup: positiveMilliseconds.default(codesysTimeouts.startup),\n\t\t\tbuild: positiveMilliseconds.default(codesysTimeouts.build),\n\t\t\tstop: positiveMilliseconds.default(codesysTimeouts.stop),\n\t\t\tterminate: positiveMilliseconds.default(codesysTimeouts.terminate),\n\t\t\thostCommand: positiveMilliseconds.default(codesysTimeouts.hostCommand),\n\t\t\truntime: positiveMilliseconds.default(codesysTimeouts.runtime),\n\t\t\t// Unset rather than defaulted, so a release's config still loads on agents that predate them.\n\t\t\t/** A controller operation's work before it touches the controller; `build` when unset. */\n\t\t\tprepare: positiveMilliseconds.optional(),\n\t\t\t/** How long a controller transfer runs before it is reported overdue; it is never interrupted. */\n\t\t\ttransfer: positiveMilliseconds.optional(),\n\t\t})\n\t\t.prefault({}),\n});\nexport type CodesysBuildConfig = z.input<typeof configSchema>;\n\n/**\n * A controller operation's budgets: `prepare` for opening, importing and compiling, after which the\n * worker may be stopped because the controller is untouched; `transfer` for the transfer and what\n * confirms it, after which the operation is only reported overdue, since stopping CODESYS then could\n * leave the controller without an application.\n */\nexport const controllerBudgets = (\n\ttimeouts: z.output<typeof configSchema>[\"timeouts\"],\n) => ({\n\tprepare: timeouts.prepare ?? timeouts.build,\n\ttransfer: timeouts.transfer ?? codesysTimeouts.transfer,\n});\n\n/**\n * The build config a release carries to the plant agent. The agent supplies the output\n * directory and the controller connection; Docker settings belong to the host that built it.\n */\nexport const releaseConfigSchema = configSchema.omit({\n\tdocker: true,\n\toutDir: true,\n\tonline: true,\n\tbulkImport: true,\n});\nexport type ReleaseConfig = z.input<typeof releaseConfigSchema>;\n\nconst compilerDecided = {\n\tsourceDir: true,\n\tentry: true,\n\toutDir: true,\n\ttask: true,\n\ttasks: true,\n} as const;\n\nconst isCompilerDecided = (key: string): key is keyof typeof compilerDecided =>\n\tObject.hasOwn(compilerDecided, key);\n\n/** The build settings a TypeScript project passes its compiler; the compiler decides the rest. */\nexport const engineeringBuildSchema = configSchema.omit(compilerDecided);\n\nexport const engineeringBuildOptions = (\n\tbuild: CodesysBuildConfig,\n): z.input<typeof engineeringBuildSchema> => {\n\tconst settings = { ...build };\n\tfor (const key of Object.keys(settings)) {\n\t\tif (isCompilerDecided(key)) {\n\t\t\tdelete settings[key];\n\t\t}\n\t}\n\treturn settings;\n};\n",
|
|
7
|
+
"import { z } from \"zod\";\nimport type { ResolvedTsplcConfig } from \"./schema\";\n\n/** The file in a project's directory that holds its config. */\nexport const configFileName = \"tsplc.config.ts\";\n\n/** Generated project state, relative to the directory that holds a project's config. */\nexport const generatedDirectory = \".tsplc\";\n\n/** The ST the compiler emits, with the files it publishes beside it for typegen and the debugger. */\nexport const emittedStDirectory = `${generatedDirectory}/artifacts/st`;\n\n/** The files the compiler writes into `emittedStDirectory` for other tools to read. */\nexport const emittedFiles = {\n\tioSymbols: \"io-symbols.json\",\n\tpublication: \"publication.json\",\n\tmachines: \"machines.ts\",\n} as const;\n\n/** `emittedFiles.ioSymbols`: each IO binding's name with the published symbol path the compiler gave it. */\nexport const ioSymbolsSchema = z.record(z.string(), z.string());\n\n/** Typegen's materialized config and symbols, which the editor reads instead of executing the config. */\nexport const projectSnapshotFile = `${generatedDirectory}/project.json`;\n\n/** A project's ST, relative to its config: the emitted ST of a TypeScript project, else its build sources. */\nexport const stRoot = (\n\tconfig: Pick<ResolvedTsplcConfig, \"compiler\" | \"build\">,\n) => (config.compiler ? emittedStDirectory : config.build?.sourceDir);\n",
|
|
8
|
+
"import { z } from \"zod\";\nimport {\n\tassemblyAddress,\n\ttype CodesysBuildConfig,\n\tchannelAddress,\n\tconfigSchema,\n\tcontrollerTargetSchema,\n\tcontrollerTargets,\n\tcyclicTasksSchema,\n\ttype DirectIoBinding,\n\tdirectIoBindingSchema,\n\tengineeringBuildOptions,\n\tenvName,\n\tethernetSchema,\n\tfourPartVersion,\n\tiecName,\n\tioBindingOptions,\n\ttaskPriority,\n\ttcpPort,\n} from \"./build-schema\";\nimport {\n\tdurationSchema,\n\ttype PlcConfig,\n\tsourceExportSchema,\n\ttaskSchema,\n\tvalidateConfig as validateCompilerConfig,\n} from \"./compiler\";\nimport type { Environment } from \"./environment\";\nimport { generatedDirectory } from \"./project-files\";\n\nexport type {\n\tCodesysBuildConfig,\n\tController,\n\tDeviceTree,\n} from \"./build-schema\";\nexport {\n\ttype Duration,\n\tdefinePlcConfig,\n\tdurationHelpers,\n\tms,\n\ttype NormalizedConfig,\n\tns,\n\ttype PlcConfig,\n\ttype SourceExport,\n\tseconds,\n\ttype TargetDescriptor,\n\ttype TaskConfig,\n\tvalidateConfig,\n} from \"./compiler\";\nexport { ioSymbolsSchema } from \"./project-files\";\n\nexport const httpOptionsSchema = z\n\t.strictObject({\n\t\ttimeoutMs: z.number().int().positive().max(60000).default(2000),\n\t\tcredentials: z\n\t\t\t.array(\n\t\t\t\tz.strictObject({\n\t\t\t\t\toriginEnv: envName,\n\t\t\t\t\tbearerTokenEnv: envName,\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.default([]),\n\t})\n\t.prefault({});\nexport type HttpOptions = z.infer<typeof httpOptionsSchema>;\n\nconst ioBindingSchema = z.union([\n\tdirectIoBindingSchema,\n\tz.strictObject({\n\t\tdevice: z.string().nonempty(),\n\t\tchannel: z.string().nonempty(),\n\t\t...ioBindingOptions,\n\t}),\n]);\n// Each field defaults: the assembly from the connection, the size from the EDS and,\n// with a generated device tree, the address from tsPLC's process-image layout.\nconst assemblySchema = z.strictObject({\n\tassembly: z.number().int().nonnegative().optional(),\n\tsize: z.number().int().positive().optional(),\n\taddress: assemblyAddress.optional(),\n});\nconst hardwareDeviceSchema = z.strictObject({\n\tfile: z.string().nonempty(),\n\tconnection: z.string().nonempty().optional(),\n\tinputs: assemblySchema.optional(),\n\toutputs: assemblySchema.optional(),\n\t// Registers the generated device tree writes over Modbus TCP, at network.address.\n\t// Each maps a name to its wire offset, and is written with FC06 when its write channel rises.\n\tmodbus: z\n\t\t.strictObject({\n\t\t\tport: tcpPort.default(502),\n\t\t\tregisters: z.record(iecName, z.number().int().min(0).max(65535)),\n\t\t})\n\t\t.optional(),\n\tstatusSymbols: z.record(z.string(), z.string()).optional(),\n\t// The adapter's network identity in a generated device tree.\n\tnetwork: z\n\t\t.strictObject({\n\t\t\taddress: z.ipv4().optional(),\n\t\t\trpi: durationSchema\n\t\t\t\t.refine(\n\t\t\t\t\t(rpi) => BigInt(rpi.nanoseconds) % 1000n === 0n,\n\t\t\t\t\t\"An RPI must be a whole number of microseconds.\",\n\t\t\t\t)\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional(),\n});\nconst dependencySchema = z.union([\n\tfourPartVersion,\n\tz.strictObject({\n\t\tversion: fourPartVersion,\n\t\tcompany: z.string().optional(),\n\t\tnamespace: z.string().optional(),\n\t}),\n\tz.strictObject({\n\t\tpath: z.string().nonempty(),\n\t\tnamespace: z.string().optional(),\n\t}),\n]);\n// `backend` is always CODESYS, so tasks get its name and priority rules here, as raw ST schedules do in cyclicTasksSchema.\nconst codesysTaskSchema = taskSchema.extend({\n\tname: iecName,\n\tpriority: taskPriority,\n});\nconst monitorSchema = z\n\t.strictObject({\n\t\tendpoint: z.string().url(),\n\t\tnamespaceUri: z.string().optional(),\n\t\tsymbols: z.array(z.string().nonempty()).optional(),\n\t\tsecurityMode: z\n\t\t\t.enum([\"None\", \"Sign\", \"SignAndEncrypt\"])\n\t\t\t.default(\"SignAndEncrypt\"),\n\t\tsecurityPolicy: z.enum([\"None\", \"Basic256Sha256\"]).optional(),\n\t\tcertificateDirectory: z\n\t\t\t.string()\n\t\t\t.nonempty()\n\t\t\t.default(`${generatedDirectory}/opcua-pki`),\n\t\tusername: z.string().nonempty().optional(),\n\t\tpasswordEnv: envName.optional(),\n\t})\n\t.superRefine((monitor, context) => {\n\t\tif (\n\t\t\tmonitor.securityPolicy &&\n\t\t\t(monitor.securityMode === \"None\") !== (monitor.securityPolicy === \"None\")\n\t\t) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"securityPolicy\"],\n\t\t\t\tmessage:\n\t\t\t\t\t\"None mode requires None policy; secure modes require Basic256Sha256.\",\n\t\t\t});\n\t\t}\n\t\tif (monitor.passwordEnv && !monitor.username) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"username\"],\n\t\t\t\tmessage: \"Configure username when passwordEnv is used.\",\n\t\t\t});\n\t\t}\n\t\tif (monitor.username && monitor.securityMode === \"None\") {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"securityMode\"],\n\t\t\t\tmessage: \"Username authentication requires a secure OPC-UA connection.\",\n\t\t\t});\n\t\t}\n\t})\n\t.transform((monitor) => ({\n\t\t...monitor,\n\t\tsecurityPolicy:\n\t\t\tmonitor.securityPolicy ??\n\t\t\t(monitor.securityMode === \"None\"\n\t\t\t\t? (\"None\" as const)\n\t\t\t\t: (\"Basic256Sha256\" as const)),\n\t}));\n/**\n * The records each PLC task keeps for its sender (docs/03-guides/telemetry.md): used whenever the\n * program calls `@tsplc/compiler/telemetry`, records unhandled job failures or traces for the debugger.\n */\nexport const telemetrySchema = z.strictObject({\n\t/** Records in each task's ring; older unsent records are overwritten and counted as dropped. */\n\tcapacity: z.number().int().min(4).max(4096).default(64),\n\t/**\n\t * The largest encoded JSON of one record, checked for every call when the program compiles.\n\t * It is fixed rather than fitted to the program, so that a ring keeps its layout from one build\n\t * to the next: CODESYS cannot apply an online change that moves a ring.\n\t */\n\trecordBytes: z.number().int().min(128).max(1024).default(512),\n});\n/**\n * The debugger's fixed-size instrumentation (docs/03-guides/debugging.md). It reads state through\n * the engineering login, so it publishes nothing. Without it a build only carries its build id.\n */\nconst debugSchema = z.strictObject({\n\t/** Records enum state changes, decisions and job starts and ends; for local debugging sessions. */\n\ttrace: z\n\t\t.union([\n\t\t\tz.literal(false),\n\t\t\tz.strictObject({\n\t\t\t\tcapacity: z.number().int().min(16).max(4096).default(256),\n\t\t\t\toperands: z.number().int().min(0).max(8).default(4),\n\t\t\t}),\n\t\t])\n\t\t.default(false),\n\t/**\n\t * Records which statement last wrote each output. With `paths`, also each module storage path\n\t * they match (`*` matching one segment), so the debugger can name the writer exactly.\n\t */\n\twriters: z\n\t\t.union([\n\t\t\tz.boolean(),\n\t\t\tz.strictObject({ paths: z.array(z.string().nonempty()).nonempty() }),\n\t\t])\n\t\t.default(true),\n\tjobs: z.boolean().default(true),\n\t/** Watch groups the debugger opens with: TypeScript paths, `*` matching one path segment. */\n\twatch: z.record(z.string(), z.array(z.string().nonempty())).default({}),\n\trequests: z\n\t\t.strictObject({\n\t\t\tcapacity: z.number().int().min(1).max(100_000).default(1000),\n\t\t\t/** Keep service call inputs and outputs; off by default because they may carry data that isn't the debugger's to show. */\n\t\t\tbodies: z.boolean().default(false),\n\t\t})\n\t\t.prefault({}),\n});\nexport const typegenSchema = z.strictObject({\n\ttypes: z.union([z.string(), z.array(z.string())]).optional(),\n\tglobals: z.union([z.string(), z.array(z.string())]).optional(),\n\t/** Directory for the generated `plc.ts`, `hardware.ts` and `machines.ts`. */\n\tdir: z.string().default(\"generated\"),\n\t/** Emit TypeScript declarations in `plc.ts`, not just the runtime field and symbol tables. */\n\tdeclarations: z.boolean().default(true),\n\t/** Emit the I/O binding types and device catalog in `hardware.ts`, not just the publication selectors. */\n\tioTypes: z.boolean().default(true),\n});\nexport const buildTargetSchema = z.enum([\"production\", \"development\"]);\nexport type BuildTarget = z.infer<typeof buildTargetSchema>;\nexport const publicationSchema = z.strictObject({\n\tproduction: z.array(z.string().nonempty()),\n\tdevelopment: z.array(z.string().nonempty()),\n});\nexport type Publication = z.infer<typeof publicationSchema>;\n/** A published PLC variable, as `Global.Field`. */\nconst hmiTarget = z.string().regex(/^\\w+(\\.\\w+|\\[\\d+\\])+$/);\n/**\n * What a control is called by the code that reads or runs it: the server's own HMI routes, an\n * app's page, an API forwarding to them. A label is for people and changes with the hardware's.\n */\nconst hmiControlId = z.string().nonempty();\nconst hmiControlSchema = z.discriminatedUnion(\"kind\", [\n\t/** Pulses a BOOL on for 200 ms, like a pushbutton. */\n\tz.strictObject({\n\t\tkind: z.literal(\"button\"),\n\t\tid: hmiControlId,\n\t\tlabel: z.string().nonempty(),\n\t\ttarget: hmiTarget,\n\t\ttone: z.enum([\"start\", \"stop\"]).optional(),\n\t\t/** Ask before pressing, for controls that start motion. */\n\t\tconfirm: z.boolean().optional(),\n\t}),\n\t/** Switches a BOOL on or off, and shows its current state. */\n\tz.strictObject({\n\t\tkind: z.literal(\"toggle\"),\n\t\tid: hmiControlId,\n\t\tlabel: z.string().nonempty(),\n\t\ttarget: hmiTarget,\n\t}),\n\t/** Writes an integer when released, and shows its current value. */\n\tz.strictObject({\n\t\tkind: z.literal(\"slider\"),\n\t\tid: hmiControlId,\n\t\tlabel: z.string().nonempty(),\n\t\ttarget: hmiTarget,\n\t\tmin: z.number().int(),\n\t\tmax: z.number().int(),\n\t}),\n]);\nexport const hmiSchema = z.strictObject({\n\ttitle: z.string().nonempty(),\n\tcontrols: z\n\t\t.array(hmiControlSchema)\n\t\t.default([])\n\t\t.superRefine((controls, context) => {\n\t\t\tconst seen = new Set<string>();\n\t\t\tcontrols.forEach((control, index) => {\n\t\t\t\tif (seen.has(control.id)) {\n\t\t\t\t\tcontext.addIssue({\n\t\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\t\tpath: [index, \"id\"],\n\t\t\t\t\t\tmessage: `Another HMI control already has the id ${control.id}`,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tseen.add(control.id);\n\t\t\t});\n\t\t}),\n\t/** The PLC reports whether each position of these conveyors is occupied, in this order. */\n\tconveyors: z\n\t\t.array(\n\t\t\tz.strictObject({\n\t\t\t\tlabel: z.string().nonempty(),\n\t\t\t\tpositions: z.number().int().positive(),\n\t\t\t\t/** Positions that are diverters, drawn differently. */\n\t\t\t\tdiverters: z.array(z.number().int().nonnegative()).default([]),\n\t\t\t}),\n\t\t)\n\t\t.default([]),\n});\nexport type HmiConfig = z.input<typeof hmiSchema>;\nexport type ResolvedHmiConfig = z.output<typeof hmiSchema>;\n\nexport const tsplcConfigSchema = z\n\t.strictObject({\n\t\tname: z.string().default(\"Application\"),\n\t\tbackend: z.literal(\"codesys\"),\n\t\tpublish: publicationSchema.optional(),\n\t\tserver: z\n\t\t\t.strictObject({\n\t\t\t\tbaseUrlEnv: envName.optional(),\n\t\t\t\ttransport: z.enum([\"http\", \"opcua\"]).default(\"http\"),\n\t\t\t\truntime: z\n\t\t\t\t\t.strictObject({\n\t\t\t\t\t\tentry: z.string(),\n\t\t\t\t\t\ttarget: z\n\t\t\t\t\t\t\t.enum([\n\t\t\t\t\t\t\t\t\"bun-linux-x64\",\n\t\t\t\t\t\t\t\t\"bun-linux-arm64\",\n\t\t\t\t\t\t\t\t\"bun-darwin-x64\",\n\t\t\t\t\t\t\t\t\"bun-darwin-arm64\",\n\t\t\t\t\t\t\t\t\"bun-windows-x64\",\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t.optional(),\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tcompiler: z\n\t\t\t.strictObject({\n\t\t\t\ttsconfig: z.string().default(\"tsconfig.json\"),\n\t\t\t\tprograms: z.record(z.string(), sourceExportSchema),\n\t\t\t})\n\t\t\t.optional(),\n\t\ttasks: z.array(codesysTaskSchema).nonempty().optional(),\n\t\t// Keep an authored legacy task distinguishable from resolveConfig's default.\n\t\t// An explicit shared schedule must have a single owner.\n\t\tbuild: configSchema\n\t\t\t.extend({ task: configSchema.shape.task.unwrap().optional() })\n\t\t\t.optional(),\n\t\tcodesys: z\n\t\t\t.strictObject({\n\t\t\t\thttp: httpOptionsSchema.optional(),\n\t\t\t\tprogramNames: z.record(z.string(), z.string()).optional(),\n\t\t\t\t// Generate an EtherNet/IP scanner with one adapter per entry in devices.\n\t\t\t\tdeviceTree: z\n\t\t\t\t\t.strictObject({ ethernet: ethernetSchema.optional() })\n\t\t\t\t\t.optional(),\n\t\t\t\t// Each omitted controller keeps the template's device. See controllerFor.\n\t\t\t\tcontrollers: z\n\t\t\t\t\t.strictObject({\n\t\t\t\t\t\tproduction: controllerTargetSchema.optional(),\n\t\t\t\t\t\tdevelopment: controllerTargetSchema.optional(),\n\t\t\t\t\t})\n\t\t\t\t\t.optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\teds: z.union([z.string(), z.array(z.string())]).default(\"eds\"),\n\t\tdevices: z.record(z.string(), hardwareDeviceSchema).default({}),\n\t\tio: z.record(z.string(), ioBindingSchema).default({}),\n\t\tdependencies: z.record(z.string(), dependencySchema).default({}),\n\t\t// Raw ST builds opt into PLC contract generation by configuring this section.\n\t\ttypegen: typegenSchema.optional(),\n\t\tmonitor: monitorSchema.optional(),\n\t\thmi: hmiSchema.optional(),\n\t\ttelemetry: telemetrySchema.optional(),\n\t\tdebug: debugSchema.optional(),\n\t\t/**\n\t\t * Where the program runs, each with literal values for environment variables, which win over the\n\t\t * environment, and the plant agent that deploys to it.\n\t\t */\n\t\ttargets: z\n\t\t\t.record(\n\t\t\t\tz.string().nonempty(),\n\t\t\t\tz.strictObject({\n\t\t\t\t\tvalues: z.record(envName, z.string()).default({}),\n\t\t\t\t\tagent: z.strictObject({ url: z.url() }).optional(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.default({}),\n\t\t/** Variables a release for the plant agent leaves to it, which reads them from Bun.secrets on its own PC. */\n\t\tsecrets: z\n\t\t\t.strictObject({\n\t\t\t\tservice: z.string().nonempty(),\n\t\t\t\tnames: z.array(envName).nonempty(),\n\t\t\t})\n\t\t\t.optional(),\n\t})\n\t.superRefine((config, context) => {\n\t\tif (config.compiler && !config.tasks) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\"tasks\"],\n\t\t\t\tmessage: \"TypeScript programs require a tasks configuration.\",\n\t\t\t});\n\t\t}\n\t});\nexport type TsplcConfig = z.input<typeof tsplcConfigSchema>;\nexport type ResolvedTsplcConfig = z.output<typeof tsplcConfigSchema>;\nexport type ServerConfig = NonNullable<ResolvedTsplcConfig[\"server\"]>;\nexport type HardwareDevice = z.infer<typeof hardwareDeviceSchema>;\nexport type ResolvedTelemetryConfig = z.output<typeof telemetrySchema>;\nexport type ResolvedDebugConfig = z.output<typeof debugSchema>;\nexport type LibraryDependency = z.infer<typeof dependencySchema>;\n\n/**\n * `build` compiles for the production controller. `run` and controller\n * operations target the local runtime, so they compile for the development one.\n */\nexport const buildTargetFor = (command: string): BuildTarget =>\n\t[\"run\", \"download\", \"online-change\", \"inspect\"].includes(command)\n\t\t? \"development\"\n\t\t: \"production\";\nexport const controllerFor = (config: ResolvedTsplcConfig, command: string) => {\n\tconst controller = config.codesys?.controllers?.[buildTargetFor(command)];\n\treturn (\n\t\tcontroller && {\n\t\t\t...controllerTargets[controller.target].device,\n\t\t\tversion: controller.version,\n\t\t}\n\t);\n};\n\n/** The name of the device `command` runs on: the configured controller, else Linux SL, the local runtime `run` deploys to. */\nexport const controllerDeviceName = (\n\tconfig: ResolvedTsplcConfig,\n\tcommand: string,\n) =>\n\tcontrollerTargets[\n\t\tconfig.codesys?.controllers?.[buildTargetFor(command)]?.target ?? \"linux-sl\"\n\t].deviceName;\n\n/**\n * The variable holding the bearer token the PLC sends the project's own server: the HTTP\n * credential for the server's base URL.\n */\nexport const serverTokenEnv = (config: ResolvedTsplcConfig) =>\n\tconfig.codesys?.http?.credentials.find(\n\t\t({ originEnv }) => originEnv === config.server?.baseUrlEnv,\n\t)?.bearerTokenEnv;\n\n/** The project's server's base URL as `env` holds it, before any normalisation. */\nexport const serverBaseUrl = (\n\tconfig: { server?: Pick<ServerConfig, \"baseUrlEnv\"> },\n\tenv: Environment,\n) =>\n\tconfig.server?.baseUrlEnv === undefined\n\t\t? undefined\n\t\t: env[config.server.baseUrlEnv];\n\n/** Typegen's settings, with their defaults when the config has no `typegen` section. */\nexport const typegenSettings = (config: ResolvedTsplcConfig) =>\n\tconfig.typegen ?? typegenSchema.parse({});\n\n/**\n * The project's name as a slug: `kebab` splits acronyms (`PLCDemo` is `plc-demo`), `runtime` is\n * the Docker Compose project name (`PLCDemo` is `plcdemo`).\n */\nexport const projectSlugs = {\n\tkebab: (name: string) =>\n\t\tname\n\t\t\t.replace(/([a-z0-9])([A-Z])|([A-Z])([A-Z][a-z])/g, \"$1$3-$2$4\")\n\t\t\t.replace(/[^A-Za-z0-9]+/g, \"-\")\n\t\t\t.replace(/^-|-$/g, \"\")\n\t\t\t.toLowerCase(),\n\truntime: (name: string) =>\n\t\tname\n\t\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n\t\t\t.toLowerCase()\n\t\t\t.replace(/[^a-z0-9_-]+/g, \"-\"),\n};\n\n/**\n * The project without fieldbus I/O, for a plant simulator that writes inputs over\n * OPC UA: fieldbus input copies would overwrite those writes every scan.\n */\nexport const simulationConfig = (\n\tconfig: ResolvedTsplcConfig,\n): ResolvedTsplcConfig => ({\n\t...config,\n\teds: [],\n\tdevices: {},\n\tio: {},\n\t...(config.codesys && {\n\t\tcodesys: {\n\t\t\t...config.codesys,\n\t\t\tdeviceTree: undefined,\n\t\t},\n\t}),\n});\n\n/** All paths are relative to this file. */\nexport function defineConfig<const C extends TsplcConfig>(config: C): C {\n\treturn config;\n}\n\n/** Raw ST program names already are IEC names; use the shared schedule directly. */\nexport function rawBuildConfig(\n\tconfig: ResolvedTsplcConfig,\n): CodesysBuildConfig {\n\tif (config.compiler) {\n\t\tthrow new Error(\"Use the compiler build plan for TypeScript projects.\");\n\t}\n\tif (!config.build) {\n\t\tthrow new Error(\"Configure build settings.\");\n\t}\n\tif (!config.tasks) {\n\t\treturn config.build;\n\t}\n\tif (config.build.tasks || config.build.task !== undefined) {\n\t\tthrow new Error(\n\t\t\t\"Configure the raw ST schedule in tasks or build.tasks/build.task, not both.\",\n\t\t);\n\t}\n\treturn {\n\t\t...config.build,\n\t\ttasks: cyclicTasksSchema.parse(taskPlan(config.tasks)),\n\t};\n}\n\n/** The project's tasks as the CODESYS schedule states them. */\nexport const taskPlan = (tasks: NonNullable<ResolvedTsplcConfig[\"tasks\"]>) =>\n\ttasks.map((task) => ({\n\t\tname: task.name,\n\t\tintervalNanoseconds: task.schedule.interval.nanoseconds,\n\t\tpriority: task.priority,\n\t\tprograms: task.programs,\n\t}));\n\n/** Adapt the shared project to the compiler's backend-independent scan model. */\nexport function compilerConfig(\n\tconfig: ResolvedTsplcConfig,\n\tio: Record<string, DirectIoBinding>,\n\tbuildTarget: BuildTarget = \"production\",\n) {\n\tif (!config.compiler || !config.tasks) {\n\t\tthrow new Error(\n\t\t\t\"This project uses raw Structured Text; no TypeScript compiler is configured.\",\n\t\t);\n\t}\n\t// The device tree and controllers are build-time engineering; the compiler only sees addresses.\n\tconst {\n\t\tdeviceTree: _deviceTree,\n\t\tcontrollers: _controllers,\n\t\t...codesys\n\t} = config.codesys ?? {};\n\tconst value: PlcConfig = {\n\t\tname: config.name,\n\t\ttsconfig: config.compiler.tsconfig,\n\t\tprograms: config.compiler.programs,\n\t\ttasks: config.tasks,\n\t\ttarget: {\n\t\t\tkind: config.backend,\n\t\t\toptions: {\n\t\t\t\t...codesys,\n\t\t\t\tpublish: config.publish,\n\t\t\t\tbuildTarget,\n\t\t\t\tio: Object.fromEntries(\n\t\t\t\t\tObject.entries(io).map(([name, binding]) => [\n\t\t\t\t\t\tname,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkind: \"direct\",\n\t\t\t\t\t\t\t...binding,\n\t\t\t\t\t\t\t...(mappedChannel(config, name, binding) && { mapped: true }),\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tengineering: {\n\t\t\t\t\tkind: \"v3.5\",\n\t\t\t\t\t...(config.build\n\t\t\t\t\t\t? { build: engineeringBuildOptions(config.build) }\n\t\t\t\t\t\t: {}),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t};\n\tconst validated = validateCompilerConfig(value);\n\tif (!validated.config) {\n\t\tthrow new Error(\n\t\t\tvalidated.diagnostics.map((item) => item.message).join(\"\\n\"),\n\t\t);\n\t}\n\treturn validated.config;\n}\n\n/**\n * A generated device tree maps a device's bit or byte scalar to its variable in the\n * I/O mapping. Wider values span several byte channels and keep an AT declaration.\n */\nfunction mappedChannel(\n\tconfig: ResolvedTsplcConfig,\n\tname: string,\n\tbinding: DirectIoBinding,\n) {\n\tconst source = config.io[name];\n\treturn (\n\t\tconfig.codesys?.deviceTree !== undefined &&\n\t\tsource !== undefined &&\n\t\t\"device\" in source &&\n\t\t// A channel maps to one variable as it stands, so these need an AT wire and a copy.\n\t\t!binding.inverted &&\n\t\t!binding.shared &&\n\t\tchannelAddress.safeParse(binding.address).success &&\n\t\t!/^ARRAY/i.test(binding.type ?? \"\")\n\t);\n}\n",
|
|
9
|
+
"import { dirname, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport type { z } from \"zod\";\nimport {\n\ttype CodesysBuildConfig,\n\tconfigSchema,\n\tcontainerCodesys,\n\tlocalCodesysSchema,\n} from \"./build-schema\";\nimport { configExport } from \"./config-module\";\nimport { configFileName } from \"./project-files\";\n\nexport {\n\ttype CodesysBuildConfig,\n\ttype Controller,\n\ttype CyclicTask,\n\tcodesysTimeouts,\n\tcommandArgumentSchema,\n\tconfigSchema,\n\tcontainerCodesys,\n\tcontrollerBudgets,\n\tcontrollerSchema,\n\tcyclicTasksSchema,\n\ttype DeviceTree,\n\ttype DirectIoBinding,\n\tdeviceTreeSchema,\n\tdirectIoBindingSchema,\n\tdockerImage,\n\tengineeringBuildSchema,\n\tenvName,\n\tethernetSchema,\n\tgatewayPort,\n\tiecName,\n\topcuaPort,\n\ttype ReleaseConfig,\n\treleaseConfigSchema,\n\truntimePort,\n\tsha256Digest,\n\ttaskPriority,\n\ttcpPort,\n} from \"./build-schema\";\nexport { scheduleRepeats } from \"./compiler\";\n\nexport type ResolvedConfig = z.output<typeof configSchema> & {\n\ttemplate: string;\n\tconfigFile: string;\n\tcodesys: z.output<typeof localCodesysSchema>;\n};\n\nexport const defineBuildConfig = (\n\tconfig: CodesysBuildConfig,\n): CodesysBuildConfig => config;\n\nexport const resolveConfig = (\n\tinput: unknown,\n\tconfigFile: string,\n): ResolvedConfig => {\n\tconst parsed = configSchema.parse(input);\n\tconst root = dirname(resolve(configFile));\n\tconst codesys = localCodesysSchema.parse(containerCodesys);\n\treturn {\n\t\t...parsed,\n\t\tdocker: parsed.docker ?? {},\n\t\tconfigFile: resolve(configFile),\n\t\ttemplate: parsed.template\n\t\t\t? resolve(root, parsed.template)\n\t\t\t: fileURLToPath(new URL(\"../templates/default.project\", import.meta.url)),\n\t\tremoveObjects: parsed.template\n\t\t\t? parsed.removeObjects\n\t\t\t: [\"PLC_PRG\", ...parsed.removeObjects],\n\t\tlibraries: parsed.libraries?.map((library) => ({\n\t\t\t...library,\n\t\t\tpath: resolve(root, library.path),\n\t\t})),\n\t\tsourceDir: resolve(root, parsed.sourceDir),\n\t\tentry: resolve(root, parsed.entry),\n\t\toutDir: resolve(root, parsed.outDir),\n\t\tcodesys: {\n\t\t\t...codesys,\n\t\t\texecutable: resolve(root, codesys.executable),\n\t\t\twine: codesys.wine\n\t\t\t\t? { ...codesys.wine, prefix: resolve(root, codesys.wine.prefix) }\n\t\t\t\t: undefined,\n\t\t},\n\t};\n};\n\nexport const loadConfig = async (file = configFileName) => {\n\tconst path = resolve(file);\n\tconst input = configExport(await import(pathToFileURL(path).href), path);\n\tif (input && typeof input === \"object\" && \"build\" in input) {\n\t\tconst { rawBuildConfig, tsplcConfigSchema } = await import(\"./schema\");\n\t\treturn resolveConfig(rawBuildConfig(tsplcConfigSchema.parse(input)), path);\n\t}\n\treturn resolveConfig(input, path);\n};\n",
|
|
10
|
+
"import { z } from \"zod\";\n\nconst configModuleSchema = z.object({\n\tdefault: z.unknown(),\n\tconfig: z.unknown(),\n});\n\n/** The config a config module exports: its default export, else its `config` export. */\nexport const configExport = (module: unknown, path: string) => {\n\tconst exports = configModuleSchema.parse(module);\n\tif (exports.default === undefined && exports.config === undefined) {\n\t\tthrow new Error(`${path} must export a default config`);\n\t}\n\treturn exports.default ?? exports.config;\n};\n"
|
|
10
11
|
],
|
|
11
|
-
"mappings": ";;;;;;;;;;;;;AAAA;AAAA,IASa,oBACA,gBA+BP,oBAIO,YAYP,cAQA,QAMA,mBAGA;AAAA;AAAA,EAjEO,qBAAqB;AAAA,EACrB,iBAAiB,EAC5B,OAAO;AAAA,IACP,MAAM,EAAE,QAAQ,UAAU;AAAA,IAC1B,aAAa,EAAE,OAAO,EAAE,MAAM,kBAAkB;AAAA,EACjD,CAAC,EACA,OAAO;AAAA,EA0BH,qBAAqB,EACzB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,EAC/D,OAAO;AAAA,EAEI,aAAa,EAAE,aAAa;AAAA,IACxC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC1B,UAAU,EAAE,aAAa;AAAA,MACxB,MAAM,EAAE,QAAQ,QAAQ;AAAA,MACxB,UAAU;AAAA,IACX,CAAC;AAAA,IACD,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,IACvC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;AAAA,EACnD,CAAC;AAAA,EAIK,eAAe,EACnB,OAAO;AAAA,IACP,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IACtB,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,UAAU,UAAU,WAAW;AAAA,MAC3D,SA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