halfcode-compiler.xnl 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ import { a as runWithRuntime } from "./src-B87eJQat.js";
2
+ //#region ../runtime-mock/src/index.ts
3
+ function createMockRuntime(options = {}) {
4
+ const effectCalls = [];
5
+ const logs = [];
6
+ return {
7
+ context: options.context ?? {},
8
+ effects: {
9
+ logger: {
10
+ info(message, fields) {
11
+ logs.push({
12
+ level: "info",
13
+ message,
14
+ fields
15
+ });
16
+ },
17
+ warn(message, fields) {
18
+ logs.push({
19
+ level: "warn",
20
+ message,
21
+ fields
22
+ });
23
+ },
24
+ error(message, fields) {
25
+ logs.push({
26
+ level: "error",
27
+ message,
28
+ fields
29
+ });
30
+ }
31
+ },
32
+ async invoke(effectFqn, input) {
33
+ effectCalls.push({
34
+ effectFqn,
35
+ input
36
+ });
37
+ const handler = options.handlers?.[effectFqn];
38
+ if (!handler) throw new Error(`No mock effect handler registered for ${effectFqn}`);
39
+ return await handler(input);
40
+ }
41
+ },
42
+ mock: {
43
+ effectCalls,
44
+ logs
45
+ }
46
+ };
47
+ }
48
+ function runWithMockRuntime(runtime, callback) {
49
+ return runWithRuntime(runtime, callback);
50
+ }
51
+ const runtimeMockPackage = {
52
+ role: "framework",
53
+ area: "runtime-mock",
54
+ owns: "inspectable target-neutral effect harness for deterministic authoring tests"
55
+ };
56
+ //#endregion
57
+ export { createMockRuntime, runWithMockRuntime, runtimeMockPackage };
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "halfcode-compiler.xnl",
3
+ "version": "0.1.1",
4
+ "description": "Compile XNL-described applications into runtime-ready skill capsules.",
5
+ "type": "module",
6
+ "private": false,
7
+ "packageKind": "framework",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ },
17
+ "./application-assembly": {
18
+ "types": "./dist/application-assembly.d.ts",
19
+ "import": "./dist/application-assembly.js"
20
+ },
21
+ "./skill-capsule": {
22
+ "types": "./dist/skill-capsule.d.ts",
23
+ "import": "./dist/skill-capsule.js"
24
+ },
25
+ "./contract-schema": {
26
+ "types": "./dist/contract-schema.d.ts",
27
+ "import": "./dist/contract-schema.js"
28
+ },
29
+ "./authoring-runtime": {
30
+ "types": "./dist/authoring-runtime.d.ts",
31
+ "import": "./dist/authoring-runtime.js"
32
+ },
33
+ "./resource-core": {
34
+ "types": "./dist/resource-core.d.ts",
35
+ "import": "./dist/resource-core.js"
36
+ },
37
+ "./resource-mapping": {
38
+ "types": "./dist/resource-mapping.d.ts",
39
+ "import": "./dist/resource-mapping.js"
40
+ },
41
+ "./resource-projection": {
42
+ "types": "./dist/resource-projection.d.ts",
43
+ "import": "./dist/resource-projection.js"
44
+ },
45
+ "./kind-definition": {
46
+ "types": "./dist/kind-definition.d.ts",
47
+ "import": "./dist/kind-definition.js"
48
+ },
49
+ "./testing": {
50
+ "types": "./dist/testing.d.ts",
51
+ "import": "./dist/testing.js"
52
+ }
53
+ },
54
+ "scripts": {
55
+ "build": "tsdown",
56
+ "check": "bun run build && bun run tools/verify-package.ts"
57
+ },
58
+ "dependencies": {
59
+ "typescript": "5.9.3",
60
+ "yaml": "^2.8.0"
61
+ },
62
+ "devDependencies": {
63
+ "halfcode-compiler-application-assembly": "workspace:*",
64
+ "halfcode-compiler-authoring-runtime": "workspace:*",
65
+ "halfcode-compiler-contract-schema": "workspace:*",
66
+ "halfcode-compiler-kind-definition": "workspace:*",
67
+ "halfcode-compiler-resource-core": "workspace:*",
68
+ "halfcode-compiler-resource-mapping": "workspace:*",
69
+ "halfcode-compiler-resource-projection": "workspace:*",
70
+ "halfcode-compiler-runtime-testing": "workspace:*",
71
+ "halfcode-compiler-skill-capsule": "workspace:*",
72
+ "tsdown": "0.22.14"
73
+ }
74
+ }