halfcode-compiler.xnl 0.2.8 → 0.2.9

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.
@@ -1,39 +0,0 @@
1
- import { AsyncLocalStorage } from "node:async_hooks";
2
- //#region ../runtime-authoring/src/index.ts
3
- const runtimeScope = new AsyncLocalStorage();
4
- function runWithRuntime(runtime, callback) {
5
- return runtimeScope.run(runtime, callback);
6
- }
7
- function currentRuntime() {
8
- const runtime = runtimeScope.getStore();
9
- if (!runtime) throw new Error("No authoring runtime is active in the current async scope");
10
- return runtime;
11
- }
12
- function createAuthoringBindings(runtime = currentRuntime()) {
13
- return {
14
- runtime,
15
- logger: runtime.effects.logger,
16
- invokeEffect: (effectFqn, input) => runtime.effects.invoke(effectFqn, input)
17
- };
18
- }
19
- const logger = {
20
- info(message, fields) {
21
- currentRuntime().effects.logger.info(message, fields);
22
- },
23
- warn(message, fields) {
24
- currentRuntime().effects.logger.warn(message, fields);
25
- },
26
- error(message, fields) {
27
- currentRuntime().effects.logger.error(message, fields);
28
- }
29
- };
30
- function invokeEffect(effectFqn, input) {
31
- return currentRuntime().effects.invoke(effectFqn, input);
32
- }
33
- const runtimeAuthoringPackage = {
34
- role: "framework",
35
- area: "runtime-authoring",
36
- owns: "target-neutral deterministic-code runtime and effect boundary"
37
- };
38
- //#endregion
39
- export { runWithRuntime as a, logger as i, currentRuntime as n, runtimeAuthoringPackage as o, invokeEffect as r, createAuthoringBindings as t };