@tsplc/compiler 0.5.5 → 0.5.7
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/dist/bun-runtime.js +152 -31
- package/dist/bun-runtime.js.map +10 -9
- package/dist/cli.js +8 -5
- package/dist/cli.js.map +3 -3
- package/dist/codesys.js +260 -85
- package/dist/codesys.js.map +9 -9
- package/dist/collections.js +395 -0
- package/dist/collections.js.map +10 -0
- package/dist/elaborate-capture.js +62 -4
- package/dist/elaborate-capture.js.map +4 -4
- package/dist/index.js +5322 -1058
- package/dist/index.js.map +30 -23
- package/dist/ir.js +122 -1
- package/dist/ir.js.map +6 -6
- package/dist/project.js +8 -5
- package/dist/project.js.map +3 -3
- package/package.json +14 -9
- package/src/codesys/emit.ts +8 -2
- package/src/codesys/http.ts +114 -72
- package/src/codesys/instrumentation.ts +30 -6
- package/src/codesys/numeric.ts +61 -0
- package/src/codesys/routines.ts +39 -9
- package/src/codesys/st-files.ts +73 -6
- package/src/codesys/telemetry.ts +70 -35
- package/src/frontend/control-flow.ts +752 -0
- package/src/frontend/coroutines.ts +171 -7
- package/src/frontend/elaborate/array-searches.ts +216 -0
- package/src/frontend/elaborate/assignments.ts +352 -0
- package/src/frontend/elaborate/calls.ts +467 -42
- package/src/frontend/elaborate/capture-protocol.ts +19 -0
- package/src/frontend/elaborate/capture.ts +80 -2
- package/src/frontend/elaborate/dialect.ts +116 -2
- package/src/frontend/elaborate/expressions.ts +927 -80
- package/src/frontend/elaborate/filtered-arrays.ts +607 -0
- package/src/frontend/elaborate/frame.ts +44 -1
- package/src/frontend/elaborate/generics.ts +137 -0
- package/src/frontend/elaborate/graph.ts +91 -0
- package/src/frontend/elaborate/index.ts +30 -5
- package/src/frontend/elaborate/initializers.ts +15 -1
- package/src/frontend/elaborate/iterators.ts +1677 -0
- package/src/frontend/elaborate/layouts.ts +41 -19
- package/src/frontend/elaborate/model.ts +64 -8
- package/src/frontend/elaborate/references.ts +749 -0
- package/src/frontend/elaborate/specialize.ts +459 -29
- package/src/frontend/elaborate/statements.ts +552 -133
- package/src/frontend/elaborate/storage.ts +151 -10
- package/src/frontend/elaborate/values.ts +72 -0
- package/src/frontend/elaborate/writes.ts +302 -1
- package/src/frontend/intrinsics.ts +32 -0
- package/src/frontend/module-graph.ts +2 -1
- package/src/frontend/positions.ts +12 -5
- package/src/frontend/typescript.ts +5 -1
- package/src/ir/core-model.ts +2 -6
- package/src/ir/fold.ts +30 -1
- package/src/ir/index.ts +5 -0
- package/src/ir/model.ts +53 -2
- package/src/ir/scalars.ts +126 -0
- package/src/runtime/.runtime-VaUSOu/server/router.ts +17 -0
- package/src/runtime/.runtime-VaUSOu/src/cell.ts +45 -0
- package/src/runtime/.runtime-VaUSOu/src/controller.ts +58 -0
- package/src/runtime/.runtime-VaUSOu/src/lane.ts +6 -0
- package/src/runtime/.runtime-VaUSOu/src/main.ts +11 -0
- package/src/runtime/.runtime-VaUSOu/src/services.ts +8 -0
- package/src/runtime/.runtime-VaUSOu/tsconfig.json +13 -0
- package/src/runtime/.runtime-VaUSOu/tsplc.config.ts +31 -0
- package/src/runtime/.runtime-ybIxYh/server/router.ts +17 -0
- package/src/runtime/.runtime-ybIxYh/src/cell.ts +45 -0
- package/src/runtime/.runtime-ybIxYh/src/controller.ts +58 -0
- package/src/runtime/.runtime-ybIxYh/src/lane.ts +6 -0
- package/src/runtime/.runtime-ybIxYh/src/main.ts +11 -0
- package/src/runtime/.runtime-ybIxYh/src/services.ts +8 -0
- package/src/runtime/.runtime-ybIxYh/tsconfig.json +13 -0
- package/src/runtime/.runtime-ybIxYh/tsplc.config.ts +31 -0
- package/src/runtime/async.ts +15 -12
- package/src/runtime/launch.ts +11 -4
- package/src/runtime/runtime.ts +26 -23
- package/src/runtime/telemetry.ts +14 -6
- package/src/runtime/transport.ts +172 -0
- package/stdlib/collections.ts +514 -0
- package/types/index.d.ts +18 -0
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/frontend/elaborate/capture.ts", "../src/frontend/elaborate/capture-protocol.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.\n/**\n * Runs a program's setup code in Bun and writes the object graph it builds: every module binding,\n * and every object, array, class instance and function reachable from them. The compiler runs\n * this in a subprocess (graph.ts), so setup code never shares the compiler's process.\n *\n * Usage: bun capture.ts <request.json> <graph.json>\n */\n\nimport { readFileSync, realpathSync, writeFileSync } from \"node:fs\";\nimport { plugin } from \"bun\";\nimport {\n\ttype CapturedGraph,\n\ttype CapturedNode,\n\ttype CapturedValue,\n\ttype CaptureRequest,\n\tcaptureRequestSchema,\n\twithBindingRegistry,\n} from \"./capture-protocol\";\n\nconst request: CaptureRequest = captureRequestSchema.parse(\n\tJSON.parse(readFileSync(process.argv[2]!, \"utf8\")),\n);\n// Bun loads modules by their real path; the compiler may name them through a symlink.\nconst real = new Map(request.files.map((file) => [realpathSync(file), file]));\nconst runtime = new Set(real.keys());\nconst exportName = \"__tsplcCapture\";\n\nconst servicePath = Symbol(\"tsplc service path\");\n/** A service client: any property is a deeper procedure path, and its identity names that path. */\nconst service = (path: readonly string[]): unknown =>\n\tnew Proxy(function serviceProcedure() {}, {\n\t\tget: (_, key) =>\n\t\t\tkey === servicePath ? path.join(\".\") : service([...path, String(key)]),\n\t\tapply: () => {\n\t\t\tthrow new Error(`Setup code called the PLC service ${path.join(\".\")}.`);\n\t\t},\n\t});\n\nplugin({\n\tname: \"tsplc-capture\",\n\tsetup(build) {\n\t\tbuild.onLoad(\n\t\t\t{\n\t\t\t\tfilter: new RegExp(\n\t\t\t\t\t`^(${[...runtime].map((file) => file.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")})$`,\n\t\t\t\t),\n\t\t\t},\n\t\t\t({ path }) => ({\n\t\t\t\tcontents: withBindingRegistry(\n\t\t\t\t\treadFileSync(path, \"utf8\"),\n\t\t\t\t\trequest.bindings[real.get(path)!]!,\n\t\t\t\t\texportName,\n\t\t\t\t),\n\t\t\t\tloader: \"ts\",\n\t\t\t}),\n\t\t);\n\t\t// Setup runs before the first scan, so the clock reads 0 there.\n\t\tbuild.module(\"@tsplc/compiler/clock\", () => ({\n\t\t\tcontents: \"export const now = () => 0;\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Records describe scans, so setup has none to make.\n\t\tbuild.module(\"@tsplc/compiler/telemetry\", () => ({\n\t\t\tcontents: `const unsupported = (name) => () => { throw new Error(\"telemetry.\" + name + \" cannot run during PLC setup.\"); };\n export const telemetry = Object.fromEntries([\"capture\", \"info\", \"warn\", \"error\", \"captureException\", \"text\"].map((name) => [name, unsupported(name)]));\n export const onTelemetry = () => () => {};`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Retention belongs to storage, so setup notes each object it retains for the compiler.\n\t\tbuild.module(\"@tsplc/compiler/retain\", () => ({\n\t\t\tcontents:\n\t\t\t\t\"export const retain = (value) => globalThis.__tsplcRetain(value);\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\tbuild.module(\"@tsplc/compiler/async\", () => ({\n\t\t\tcontents: `export const createServiceClient = () => globalThis.__tsplcService([]);\n const unsupported = (name) => () => { throw new Error(name + \" cannot run during PLC setup.\"); };\n export const sleep = unsupported(\"sleep\"), fetch = unsupported(\"fetch\"), cancelAsync = unsupported(\"cancelAsync\");\n export const errorCode = unsupported(\"errorCode\"), asyncDiagnostics = unsupported(\"asyncDiagnostics\"), opcuaCall = unsupported(\"opcuaCall\");`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t},\n});\n(globalThis as { __tsplcService?: unknown }).__tsplcService = service;\n/** Objects setup passed to `retain`. A retained primitive has no identity; the compiler finds those in the source. */\nconst retainedObjects = new Set<object>();\n(globalThis as { __tsplcRetain?: unknown }).__tsplcRetain = (\n\tvalue: unknown,\n) => {\n\tif (typeof value === \"object\" && value !== null) {\n\t\tretainedObjects.add(value);\n\t}\n\treturn value;\n};\n\n/** The bindings each runtime module exports for capture, as `bindings` above adds them. */\ninterface Registry {\n\tvalues: Record<string, () => unknown>;\n\tclasses: Record<string, unknown>;\n\tfunctions: Record<string, unknown>;\n}\n\nconst modules = new Map<string, Registry>();\nfor (const file of [\n\trequest.entry,\n\t...request.files.filter((file) => file !== request.entry),\n]) {\n\tconst loaded = (await import(realpathSync(file))) as Record<string, unknown>;\n\tmodules.set(file, loaded[exportName] as Registry);\n}\n\nconst classes = new Map<unknown, { file: string; name: string }>();\nconst functions = new Map<unknown, { file: string; name: string }>();\nfor (const [file, registry] of modules) {\n\tfor (const [name, value] of Object.entries(registry.classes)) {\n\t\tclasses.set(value, { file, name });\n\t}\n\tfor (const [name, value] of Object.entries(registry.functions)) {\n\t\tfunctions.set(value, { file, name });\n\t}\n}\n\nconst nodes: CapturedNode[] = [];\nconst ids = new Map<object, number>();\nconst capture = (value: unknown, where: string): CapturedValue => {\n\tif (value === undefined) {\n\t\treturn { kind: \"undefined\" };\n\t}\n\tif (value === null) {\n\t\tthrow new Error(`${where}: null has no PLC value; use undefined.`);\n\t}\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) {\n\t\t\tthrow new Error(`${where}: ${value} has no PLC value.`);\n\t\t}\n\t\treturn { kind: \"number\", value };\n\t}\n\tif (typeof value === \"boolean\") {\n\t\treturn { kind: \"boolean\", value };\n\t}\n\tif (typeof value === \"string\") {\n\t\treturn { kind: \"string\", value };\n\t}\n\tif (typeof value === \"bigint\") {\n\t\treturn { kind: \"bigint\", value: String(value) };\n\t}\n\tif (typeof value !== \"object\" && typeof value !== \"function\") {\n\t\tthrow new Error(`${where}: a ${typeof value} has no PLC value.`);\n\t}\n\tconst known = ids.get(value);\n\tif (known !== undefined) {\n\t\treturn { kind: \"node\", id: known };\n\t}\n\tconst id = nodes.length;\n\tids.set(value, id);\n\tnodes.push({ kind: \"object\", fields: {} });\n\tif (typeof value === \"function\") {\n\t\tconst path = (value as { [servicePath]?: string })[servicePath];\n\t\tconst named = functions.get(value) ?? classes.get(value);\n\t\tif (path !== undefined) {\n\t\t\tnodes[id] = { kind: \"service\", path };\n\t\t} else if (named) {\n\t\t\tnodes[id] = { kind: \"function\", ...named };\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`${where}: setup stored a function that is not a module-level function, so the PLC can't call it.`,\n\t\t\t);\n\t\t}\n\t\treturn { kind: \"node\", id };\n\t}\n\tif (Array.isArray(value)) {\n\t\tnodes[id] = {\n\t\t\tkind: \"array\",\n\t\t\titems: value.map((item, index) => capture(item, `${where}[${index}]`)),\n\t\t};\n\t\treturn { kind: \"node\", id };\n\t}\n\tconst prototype = Object.getPrototypeOf(value);\n\tconst owner =\n\t\tprototype === Object.prototype || prototype === null\n\t\t\t? undefined\n\t\t\t: prototype.constructor;\n\tconst registered = owner && classes.get(owner);\n\tif (owner && !registered) {\n\t\tthrow new Error(\n\t\t\t`${where}: a ${owner.name} has no PLC layout; use a class from the program.`,\n\t\t);\n\t}\n\tconst fields: Record<string, CapturedValue> = {};\n\tfor (const [key, field] of Object.entries(value)) {\n\t\tfields[key] = capture(field, `${where}.${key}`);\n\t}\n\tnodes[id] = registered\n\t\t? { kind: \"instance\", ...registered, fields }\n\t\t: { kind: \"object\", fields };\n\treturn { kind: \"node\", id };\n};\n\nconst graph: CapturedGraph = { nodes, bindings: [], retained: [] };\nfor (const [file, registry] of modules) {\n\tfor (const [name, read] of Object.entries(registry.values)) {\n\t\tlet value: unknown;\n\t\ttry {\n\t\t\tvalue = read();\n\t\t} catch {\n\t\t\tcontinue; // A binding the module never initialized.\n\t\t}\n\t\tif (\n\t\t\ttypeof value === \"function\" &&\n\t\t\t(functions.has(value) || classes.has(value))\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tgraph.bindings.push({ file, name, value: capture(value, name) });\n\t}\n}\n// A retained object no binding reaches is stored nowhere, so it has no id.\ngraph.retained = [...retainedObjects].flatMap((value) => {\n\tconst id = ids.get(value);\n\treturn id === undefined ? [] : [id];\n});\nwriteFileSync(process.argv[3]!, JSON.stringify(graph));\n",
|
|
6
|
-
"import { z } from \"zod\";\n\n/**\n * The files the compiler and its setup subprocess (capture.ts) exchange: the request names the\n * program's runtime files and the bindings each declares; the graph is what setup built.\n */\nexport const captureRequestSchema = z.strictObject({\n\tentry: z.string().nonempty(),\n\tfiles: z.array(z.string().nonempty()),\n\tbindings: z.record(\n\t\tz.string(),\n\t\tz.strictObject({\n\t\t\tvalues: z.array(z.string()),\n\t\t\tclasses: z.array(z.string()),\n\t\t\tfunctions: z.array(z.string()),\n\t\t}),\n\t),\n});\nexport type CaptureRequest = z.infer<typeof captureRequestSchema>;\n\n/**\n * A module's source with one more export, `exportName`, through which a host reads the module's\n * top-level bindings: each value through a getter, so a `let` reads as it is now, and its classes\n * and functions themselves.\n */\nexport const withBindingRegistry = (\n\tsource: string,\n\tnames: CaptureRequest[\"bindings\"][string],\n\texportName: string,\n) =>\n\t`${source}\\n;export const ${exportName} = { values: { ${names.values\n\t\t.map((name) => `${JSON.stringify(name)}: () => ${name}`)\n\t\t.join(\", \")} }, classes: { ${names.classes\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} }, functions: { ${names.functions\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} } };\\n`;\n\nconst capturedValueSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"undefined\") }),\n\t// JSON has no NaN or infinity; capture rejects them rather than write null.\n\tz.strictObject({ kind: z.literal(\"number\"), value: z.number() }),\n\tz.strictObject({ kind: z.literal(\"boolean\"), value: z.boolean() }),\n\tz.strictObject({ kind: z.literal(\"string\"), value: z.string() }),\n\tz.strictObject({\n\t\tkind: z.literal(\"bigint\"),\n\t\tvalue: z.string().regex(/^-?\\d+$/),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"node\"),\n\t\tid: z.number().int().nonnegative(),\n\t}),\n]);\nexport type CapturedValue = z.infer<typeof capturedValueSchema>;\n\n/** A captured value that is not an object setup built. */\nexport type CapturedPrimitive = Exclude<CapturedValue, { kind: \"node\" }>;\n\nconst fieldsSchema = z.record(z.string(), capturedValueSchema);\n\nconst capturedNodeSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"object\"), fields: fieldsSchema }),\n\tz.strictObject({\n\t\tkind: z.literal(\"instance\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t\tfields: fieldsSchema,\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"array\"),\n\t\titems: z.array(capturedValueSchema),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"function\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t}),\n\tz.strictObject({ kind: z.literal(\"service\"), path: z.string() }),\n]);\nexport type CapturedNode = z.infer<typeof capturedNodeSchema>;\n\nexport const capturedGraphSchema = z\n\t.strictObject({\n\t\tnodes: z.array(capturedNodeSchema),\n\t\t/** Every module-level value binding, in module evaluation order. */\n\t\tbindings: z.array(\n\t\t\tz.strictObject({\n\t\t\t\tfile: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tvalue: capturedValueSchema,\n\t\t\t}),\n\t\t),\n\t\t/** The objects setup passed to `retain`. */\n\t\tretained: z.array(z.number().int().nonnegative()),\n\t})\n\t.superRefine((graph, context) => {\n\t\tconst references = [\n\t\t\t...graph.bindings.map((binding) => binding.value),\n\t\t\t...graph.nodes.flatMap((node) => {\n\t\t\t\tif (node.kind === \"array\") {\n\t\t\t\t\treturn node.items;\n\t\t\t\t}\n\t\t\t\tif (node.kind === \"object\" || node.kind === \"instance\") {\n\t\t\t\t\treturn Object.values(node.fields);\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}),\n\t\t];\n\t\tfor (const id of graph.retained) {\n\t\t\treferences.push({ kind: \"node\", id });\n\t\t}\n\t\tfor (const value of references) {\n\t\t\tif (value.kind === \"node\" && value.id >= graph.nodes.length) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tmessage: `Captured value refers to missing node ${value.id}.`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\nexport type CapturedGraph = z.infer<typeof capturedGraphSchema>;\n"
|
|
5
|
+
"// biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.\n/**\n * Runs a program's setup code in Bun and writes the object graph it builds: every module binding,\n * and every object, array, class instance and function reachable from them. The compiler runs\n * this in a subprocess (graph.ts), so setup code never shares the compiler's process.\n *\n * Usage: bun capture.ts <request.json> <graph.json>\n */\n\nimport { readFileSync, realpathSync, writeFileSync } from \"node:fs\";\nimport { plugin } from \"bun\";\nimport {\n\ttype CapturedGraph,\n\ttype CapturedNode,\n\ttype CapturedValue,\n\ttype CaptureRequest,\n\ttype ClosureSite,\n\tcaptureRequestSchema,\n\twithBindingRegistry,\n} from \"./capture-protocol\";\n\nconst request: CaptureRequest = captureRequestSchema.parse(\n\tJSON.parse(readFileSync(process.argv[2]!, \"utf8\")),\n);\n// Bun loads modules by their real path; the compiler may name them through a symlink.\nconst real = new Map(request.files.map((file) => [realpathSync(file), file]));\nconst runtime = new Set(real.keys());\nconst exportName = \"__tsplcCapture\";\n\nconst servicePath = Symbol(\"tsplc service path\");\n/** A service client: any property is a deeper procedure path, and its identity names that path. */\nconst service = (path: readonly string[]): unknown =>\n\tnew Proxy(function serviceProcedure() {}, {\n\t\tget: (_, key) =>\n\t\t\tkey === servicePath ? path.join(\".\") : service([...path, String(key)]),\n\t\tapply: () => {\n\t\t\tthrow new Error(`Setup code called the PLC service ${path.join(\".\")}.`);\n\t\t},\n\t});\n\nplugin({\n\tname: \"tsplc-capture\",\n\tsetup(build) {\n\t\tbuild.onLoad(\n\t\t\t{\n\t\t\t\tfilter: new RegExp(\n\t\t\t\t\t`^(${[...runtime].map((file) => file.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")})$`,\n\t\t\t\t),\n\t\t\t},\n\t\t\t({ path }) => ({\n\t\t\t\tcontents: withBindingRegistry(\n\t\t\t\t\twithClosureNotes(\n\t\t\t\t\t\treadFileSync(path, \"utf8\"),\n\t\t\t\t\t\treal.get(path)!,\n\t\t\t\t\t\trequest.closures[real.get(path)!] ?? [],\n\t\t\t\t\t),\n\t\t\t\t\trequest.bindings[real.get(path)!]!,\n\t\t\t\t\texportName,\n\t\t\t\t),\n\t\t\t\tloader: \"ts\",\n\t\t\t}),\n\t\t);\n\t\t// Setup runs before the first scan, so the clock reads 0 there.\n\t\tbuild.module(\"@tsplc/compiler/clock\", () => ({\n\t\t\tcontents: \"export const now = () => 0;\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Records describe scans, so setup has none to make.\n\t\tbuild.module(\"@tsplc/compiler/telemetry\", () => ({\n\t\t\tcontents: `const unsupported = (name) => () => { throw new Error(\"telemetry.\" + name + \" cannot run during PLC setup.\"); };\n export const telemetry = Object.fromEntries([\"capture\", \"info\", \"warn\", \"error\", \"captureException\", \"text\"].map((name) => [name, unsupported(name)]));\n export const onTelemetry = () => () => {};`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Retention belongs to storage, so setup notes each object it retains for the compiler.\n\t\tbuild.module(\"@tsplc/compiler/retain\", () => ({\n\t\t\tcontents:\n\t\t\t\t\"export const retain = (value) => globalThis.__tsplcRetain(value);\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// The SDK's types module has no runtime of its own; a module importing a time constructor still loads.\n\t\tbuild.module(\"@tsplc/compiler/types\", () => ({\n\t\t\tcontents: `const unsupported = (name) => () => { throw new Error(name + \" cannot run during PLC setup.\"); };\n export const ms = (value) => value, seconds = (value) => value * 1000, minutes = (value) => value * 60000;\n export const exact = unsupported(\"exact\"), wrap = unsupported(\"wrap\"), saturate = unsupported(\"saturate\");\n export const wrapAdd = unsupported(\"wrapAdd\"), wrapSubtract = unsupported(\"wrapSubtract\"), wrapMultiply = unsupported(\"wrapMultiply\");\n export const saturatingAdd = unsupported(\"saturatingAdd\"), saturatingSubtract = unsupported(\"saturatingSubtract\"), saturatingMultiply = unsupported(\"saturatingMultiply\");\n export const div = unsupported(\"div\"), defaultValue = unsupported(\"defaultValue\"), copy = unsupported(\"copy\"), entries = unsupported(\"entries\");\n export const ref = unsupported(\"ref\"), retain = unsupported(\"retain\"), timeToMilliseconds = unsupported(\"timeToMilliseconds\");\n export const date = unsupported(\"date\"), timeOfDay = unsupported(\"timeOfDay\"), dateAndTime = unsupported(\"dateAndTime\");\n export const sqrt = Math.sqrt, ln = Math.log, log10 = Math.log10, exp = Math.exp, sin = Math.sin, cos = Math.cos, tan = Math.tan;\n export const asin = Math.asin, acos = Math.acos, atan = Math.atan, trunc = Math.trunc, expt = Math.pow;`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t\tbuild.module(\"@tsplc/compiler/async\", () => ({\n\t\t\tcontents: `export const createServiceClient = () => globalThis.__tsplcService([]);\n const unsupported = (name) => () => { throw new Error(name + \" cannot run during PLC setup.\"); };\n export const sleep = unsupported(\"sleep\"), fetch = unsupported(\"fetch\"), cancelAsync = unsupported(\"cancelAsync\");\n export const errorCode = unsupported(\"errorCode\"), asyncDiagnostics = unsupported(\"asyncDiagnostics\"), opcuaCall = unsupported(\"opcuaCall\");`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t},\n});\n(globalThis as { __tsplcService?: unknown }).__tsplcService = service;\n\n/** Closures setup made, with where each is written and a reader of what it captured. */\nconst closures = new Map<\n\tunknown,\n\t{ file: string; start: number; names: string[]; captured: () => unknown[] }\n>();\n(globalThis as { __tsplcClosure?: unknown }).__tsplcClosure = (\n\tfile: string,\n\tstart: number,\n\tnames: string[],\n\tmade: unknown,\n\tcaptured: () => unknown[],\n) => {\n\tclosures.set(made, { file, start, names, captured });\n\treturn made;\n};\n\n/**\n * Wraps each closure in the source so making it notes it. The wrapper keeps the expression's value,\n * and its reader is an arrow beside it, so it reads the same variables and `this`.\n */\nconst withClosureNotes = (\n\ttext: string,\n\tfile: string,\n\tsites: readonly ClosureSite[],\n): string => {\n\tconst inserts = sites.flatMap((site) => [\n\t\t{\n\t\t\tat: site.start,\n\t\t\torder: 1,\n\t\t\ttext: `globalThis.__tsplcClosure(${JSON.stringify(file)}, ${site.start}, ${JSON.stringify(site.captures)}, (`,\n\t\t},\n\t\t{\n\t\t\tat: site.end,\n\t\t\torder: 0,\n\t\t\ttext: `), () => [${site.captures.join(\", \")}])`,\n\t\t},\n\t]);\n\t// From the end, so earlier offsets stay valid; at one offset, a closing wrapper before an opening one.\n\tinserts.sort((left, right) => right.at - left.at || left.order - right.order);\n\treturn inserts.reduce(\n\t\t(result, insert) =>\n\t\t\tresult.slice(0, insert.at) + insert.text + result.slice(insert.at),\n\t\ttext,\n\t);\n};\n/** Objects setup passed to `retain`. A retained primitive has no identity; the compiler finds those in the source. */\nconst retainedObjects = new Set<object>();\n(globalThis as { __tsplcRetain?: unknown }).__tsplcRetain = (\n\tvalue: unknown,\n) => {\n\tif (typeof value === \"object\" && value !== null) {\n\t\tretainedObjects.add(value);\n\t}\n\treturn value;\n};\n\n/** The bindings each runtime module exports for capture, as `bindings` above adds them. */\ninterface Registry {\n\tvalues: Record<string, () => unknown>;\n\tclasses: Record<string, unknown>;\n\tfunctions: Record<string, unknown>;\n}\n\nconst modules = new Map<string, Registry>();\nfor (const file of [\n\trequest.entry,\n\t...request.files.filter((file) => file !== request.entry),\n]) {\n\tconst loaded = (await import(realpathSync(file))) as Record<string, unknown>;\n\tmodules.set(file, loaded[exportName] as Registry);\n}\n\nconst classes = new Map<unknown, { file: string; name: string }>();\nconst functions = new Map<unknown, { file: string; name: string }>();\nfor (const [file, registry] of modules) {\n\tfor (const [name, value] of Object.entries(registry.classes)) {\n\t\tclasses.set(value, { file, name });\n\t}\n\tfor (const [name, value] of Object.entries(registry.functions)) {\n\t\tfunctions.set(value, { file, name });\n\t}\n}\n\nconst nodes: CapturedNode[] = [];\nconst ids = new Map<object, number>();\nconst capture = (value: unknown, where: string): CapturedValue => {\n\tif (value === undefined) {\n\t\treturn { kind: \"undefined\" };\n\t}\n\t// null is the PLC's one empty value, as undefined is.\n\tif (value === null) {\n\t\treturn { kind: \"undefined\" };\n\t}\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) {\n\t\t\tthrow new Error(`${where}: ${value} has no PLC value.`);\n\t\t}\n\t\treturn { kind: \"number\", value };\n\t}\n\tif (typeof value === \"boolean\") {\n\t\treturn { kind: \"boolean\", value };\n\t}\n\tif (typeof value === \"string\") {\n\t\treturn { kind: \"string\", value };\n\t}\n\tif (typeof value === \"bigint\") {\n\t\treturn { kind: \"bigint\", value: String(value) };\n\t}\n\tif (typeof value !== \"object\" && typeof value !== \"function\") {\n\t\tthrow new Error(`${where}: a ${typeof value} has no PLC value.`);\n\t}\n\tconst known = ids.get(value);\n\tif (known !== undefined) {\n\t\treturn { kind: \"node\", id: known };\n\t}\n\tconst id = nodes.length;\n\tids.set(value, id);\n\tnodes.push({ kind: \"object\", fields: {} });\n\tif (typeof value === \"function\") {\n\t\tconst path = (value as { [servicePath]?: string })[servicePath];\n\t\tconst named = functions.get(value) ?? classes.get(value);\n\t\tconst closure = closures.get(value);\n\t\tif (path !== undefined) {\n\t\t\tnodes[id] = { kind: \"service\", path };\n\t\t} else if (named) {\n\t\t\tnodes[id] = { kind: \"function\", ...named };\n\t\t} else if (closure) {\n\t\t\tconst values = closure.captured();\n\t\t\tnodes[id] = {\n\t\t\t\tkind: \"closure\",\n\t\t\t\tfile: closure.file,\n\t\t\t\tstart: closure.start,\n\t\t\t\tcaptures: closure.names.map((name, index) => ({\n\t\t\t\t\tname,\n\t\t\t\t\tvalue: capture(values[index], `${where} (captured ${name})`),\n\t\t\t\t})),\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`${where}: setup stored a function that is not a module-level function, so the PLC can't call it.`,\n\t\t\t);\n\t\t}\n\t\treturn { kind: \"node\", id };\n\t}\n\tif (Array.isArray(value)) {\n\t\tnodes[id] = {\n\t\t\tkind: \"array\",\n\t\t\titems: value.map((item, index) => capture(item, `${where}[${index}]`)),\n\t\t};\n\t\treturn { kind: \"node\", id };\n\t}\n\tconst prototype = Object.getPrototypeOf(value);\n\tconst owner =\n\t\tprototype === Object.prototype || prototype === null\n\t\t\t? undefined\n\t\t\t: prototype.constructor;\n\tconst registered = owner && classes.get(owner);\n\tif (owner && !registered) {\n\t\tthrow new Error(\n\t\t\t`${where}: a ${owner.name} has no PLC layout; use a class from the program.`,\n\t\t);\n\t}\n\tconst fields: Record<string, CapturedValue> = {};\n\tfor (const [key, field] of Object.entries(value)) {\n\t\tfields[key] = capture(field, `${where}.${key}`);\n\t}\n\tnodes[id] = registered\n\t\t? { kind: \"instance\", ...registered, fields }\n\t\t: { kind: \"object\", fields };\n\treturn { kind: \"node\", id };\n};\n\nconst graph: CapturedGraph = { nodes, bindings: [], retained: [] };\nfor (const [file, registry] of modules) {\n\tfor (const [name, read] of Object.entries(registry.values)) {\n\t\tlet value: unknown;\n\t\ttry {\n\t\t\tvalue = read();\n\t\t} catch {\n\t\t\tcontinue; // A binding the module never initialized.\n\t\t}\n\t\tif (\n\t\t\ttypeof value === \"function\" &&\n\t\t\t(functions.has(value) || classes.has(value))\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tgraph.bindings.push({ file, name, value: capture(value, name) });\n\t}\n}\n// A retained object no binding reaches is stored nowhere, so it has no id.\ngraph.retained = [...retainedObjects].flatMap((value) => {\n\tconst id = ids.get(value);\n\treturn id === undefined ? [] : [id];\n});\nwriteFileSync(process.argv[3]!, JSON.stringify(graph));\n",
|
|
6
|
+
"import { z } from \"zod\";\n\n/**\n * The files the compiler and its setup subprocess (capture.ts) exchange: the request names the\n * program's runtime files and the bindings each declares; the graph is what setup built.\n */\n/** An arrow or function expression setup may store, and the names it captures from around it. */\nconst closureSiteSchema = z.strictObject({\n\tstart: z.number().int().nonnegative(),\n\tend: z.number().int().nonnegative(),\n\tcaptures: z.array(z.string()),\n});\nexport type ClosureSite = z.infer<typeof closureSiteSchema>;\n\nexport const captureRequestSchema = z.strictObject({\n\tentry: z.string().nonempty(),\n\tfiles: z.array(z.string().nonempty()),\n\t/** By file, each closure whose creation setup notes, with what it captured. */\n\tclosures: z.record(z.string(), z.array(closureSiteSchema)),\n\tbindings: z.record(\n\t\tz.string(),\n\t\tz.strictObject({\n\t\t\tvalues: z.array(z.string()),\n\t\t\tclasses: z.array(z.string()),\n\t\t\tfunctions: z.array(z.string()),\n\t\t}),\n\t),\n});\nexport type CaptureRequest = z.infer<typeof captureRequestSchema>;\n\n/**\n * A module's source with one more export, `exportName`, through which a host reads the module's\n * top-level bindings: each value through a getter, so a `let` reads as it is now, and its classes\n * and functions themselves.\n */\nexport const withBindingRegistry = (\n\tsource: string,\n\tnames: CaptureRequest[\"bindings\"][string],\n\texportName: string,\n) =>\n\t`${source}\\n;export const ${exportName} = { values: { ${names.values\n\t\t.map((name) => `${JSON.stringify(name)}: () => ${name}`)\n\t\t.join(\", \")} }, classes: { ${names.classes\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} }, functions: { ${names.functions\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} } };\\n`;\n\nconst capturedValueSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"undefined\") }),\n\t// JSON has no NaN or infinity; capture rejects them rather than write null.\n\tz.strictObject({ kind: z.literal(\"number\"), value: z.number() }),\n\tz.strictObject({ kind: z.literal(\"boolean\"), value: z.boolean() }),\n\tz.strictObject({ kind: z.literal(\"string\"), value: z.string() }),\n\tz.strictObject({\n\t\tkind: z.literal(\"bigint\"),\n\t\tvalue: z.string().regex(/^-?\\d+$/),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"node\"),\n\t\tid: z.number().int().nonnegative(),\n\t}),\n]);\nexport type CapturedValue = z.infer<typeof capturedValueSchema>;\n\n/** A captured value that is not an object setup built. */\nexport type CapturedPrimitive = Exclude<CapturedValue, { kind: \"node\" }>;\n\nconst fieldsSchema = z.record(z.string(), capturedValueSchema);\n\nconst capturedNodeSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"object\"), fields: fieldsSchema }),\n\tz.strictObject({\n\t\tkind: z.literal(\"instance\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t\tfields: fieldsSchema,\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"array\"),\n\t\titems: z.array(capturedValueSchema),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"function\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t}),\n\tz.strictObject({ kind: z.literal(\"service\"), path: z.string() }),\n\t/** A function setup made inside another, by where it is written, with the values it captured. */\n\tz.strictObject({\n\t\tkind: z.literal(\"closure\"),\n\t\tfile: z.string(),\n\t\tstart: z.number().int().nonnegative(),\n\t\tcaptures: z.array(\n\t\t\tz.strictObject({ name: z.string(), value: capturedValueSchema }),\n\t\t),\n\t}),\n]);\nexport type CapturedNode = z.infer<typeof capturedNodeSchema>;\n\nexport const capturedGraphSchema = z\n\t.strictObject({\n\t\tnodes: z.array(capturedNodeSchema),\n\t\t/** Every module-level value binding, in module evaluation order. */\n\t\tbindings: z.array(\n\t\t\tz.strictObject({\n\t\t\t\tfile: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tvalue: capturedValueSchema,\n\t\t\t}),\n\t\t),\n\t\t/** The objects setup passed to `retain`. */\n\t\tretained: z.array(z.number().int().nonnegative()),\n\t})\n\t.superRefine((graph, context) => {\n\t\tconst references = [\n\t\t\t...graph.bindings.map((binding) => binding.value),\n\t\t\t...graph.nodes.flatMap((node) => {\n\t\t\t\tif (node.kind === \"array\") {\n\t\t\t\t\treturn node.items;\n\t\t\t\t}\n\t\t\t\tif (node.kind === \"object\" || node.kind === \"instance\") {\n\t\t\t\t\treturn Object.values(node.fields);\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}),\n\t\t];\n\t\tfor (const id of graph.retained) {\n\t\t\treferences.push({ kind: \"node\", id });\n\t\t}\n\t\tfor (const value of references) {\n\t\t\tif (value.kind === \"node\" && value.id >= graph.nodes.length) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tmessage: `Captured value refers to missing node ${value.id}.`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\nexport type CapturedGraph = z.infer<typeof capturedGraphSchema>;\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;AASA;AACA;;;ACVA;
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;AASA;AACA;;;ACVA;AAOA,IAAM,oBAAoB,EAAE,aAAa;AAAA,EACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,EACpC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,EAClC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;AAC7B,CAAC;AAGM,IAAM,uBAAuB,EAAE,aAAa;AAAA,EAClD,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC;AAAA,EAEpC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAAA,EACzD,UAAU,EAAE,OACX,EAAE,OAAO,GACT,EAAE,aAAa;AAAA,IACd,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,IAC1B,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,IAC3B,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EAC9B,CAAC,CACF;AACD,CAAC;AAQM,IAAM,sBAAsB,CAClC,QACA,OACA,eAEA,GAAG;AAAA,gBAAyB,4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