@altopelago/aeon-runtime 0.9.0
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 +173 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime.d.ts +62 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +297 -0
- package/dist/runtime.js.map +1 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# @altopelago/aeon-runtime
|
|
2
|
+
|
|
3
|
+
Phase-ordered runtime orchestration for AEON.
|
|
4
|
+
|
|
5
|
+
Implementation docs:
|
|
6
|
+
|
|
7
|
+
- [`docs/implementations/typescript/api/runtime.md`](../../../../docs/implementations/typescript/api/runtime.md)
|
|
8
|
+
|
|
9
|
+
This package runs a deterministic pipeline:
|
|
10
|
+
|
|
11
|
+
1. Profile compilation (Phases 1-5)
|
|
12
|
+
2. Schema validation (Phase 6)
|
|
13
|
+
3. Reference resolution (Phase 7)
|
|
14
|
+
4. Finalization (Phase 8)
|
|
15
|
+
|
|
16
|
+
It enforces `schema -> resolve` ordering by skipping profile-level processors.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { runRuntime } from '@altopelago/aeon-runtime';
|
|
22
|
+
|
|
23
|
+
const result = runRuntime('name = "AEON"\ncopy = ~name', {
|
|
24
|
+
mode: 'strict',
|
|
25
|
+
output: 'json',
|
|
26
|
+
schema: {
|
|
27
|
+
rules: [
|
|
28
|
+
{ path: '$.copy', constraints: { type: 'CloneReference' } }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (!result.meta.errors.length) {
|
|
34
|
+
console.log(result.document);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## When To Use This Package
|
|
39
|
+
|
|
40
|
+
Use `@altopelago/aeon-runtime` when you need the full orchestrated pipeline.
|
|
41
|
+
|
|
42
|
+
If you only need:
|
|
43
|
+
|
|
44
|
+
- compile-only behavior, use `@altopelago/aeon-core`
|
|
45
|
+
- AEOS validation over AES, use `@altopelago/aeos-core`
|
|
46
|
+
|
|
47
|
+
## Common Patterns
|
|
48
|
+
|
|
49
|
+
### Request JSON finalization output
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const result = runRuntime('name = "AEON"', {
|
|
53
|
+
output: 'json',
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Request linked JSON pointer aliases
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
const result = runRuntime('a = 2\nb = ~>a', {
|
|
61
|
+
output: 'linked-json',
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Include annotations for tooling
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
const result = runRuntime('a = 1', {
|
|
69
|
+
includeAnnotations: true,
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
export interface RuntimeOptions {
|
|
77
|
+
mode?: 'strict' | 'loose';
|
|
78
|
+
preset?: 'rich';
|
|
79
|
+
datatypePolicy?: 'reserved_only' | 'allow_custom';
|
|
80
|
+
profile?: ProfileRef;
|
|
81
|
+
registry?: ProfileRegistry;
|
|
82
|
+
schema?: SchemaV1;
|
|
83
|
+
output?: 'json' | 'linked-json' | 'map' | 'node';
|
|
84
|
+
materialization?: 'all' | 'projected';
|
|
85
|
+
includePaths?: readonly string[];
|
|
86
|
+
includeAnnotations?: boolean;
|
|
87
|
+
maxInputBytes?: number;
|
|
88
|
+
maxAttributeDepth?: number;
|
|
89
|
+
maxSeparatorDepth?: number;
|
|
90
|
+
scope?: 'payload' | 'header' | 'full';
|
|
91
|
+
trailingSeparatorDelimiterPolicy?: 'off' | 'warn' | 'error';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function runRuntime(input: string, options?: RuntimeOptions): RuntimeResult;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
When `includeAnnotations` is enabled, `RuntimeResult` may include:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
annotations?: readonly AnnotationRecord[];
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This annotation stream is a parallel metadata channel and does not affect phase ordering,
|
|
104
|
+
schema validation, reference resolution, or finalization semantics.
|
|
105
|
+
|
|
106
|
+
Example (`includeAnnotations: true`):
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"aes": [
|
|
111
|
+
{
|
|
112
|
+
"path": { "segments": [{ "type": "root" }, { "type": "member", "key": "a" }] },
|
|
113
|
+
"key": "a",
|
|
114
|
+
"value": { "type": "NumberLiteral", "raw": "1", "value": "1" },
|
|
115
|
+
"span": { "start": { "line": 2, "column": 1, "offset": 9 }, "end": { "line": 2, "column": 6, "offset": 14 } }
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"annotations": [
|
|
119
|
+
{
|
|
120
|
+
"kind": "doc",
|
|
121
|
+
"form": "line",
|
|
122
|
+
"raw": "//# docs",
|
|
123
|
+
"span": {
|
|
124
|
+
"start": { "line": 1, "column": 1, "offset": 0 },
|
|
125
|
+
"end": { "line": 1, "column": 9, "offset": 8 }
|
|
126
|
+
},
|
|
127
|
+
"target": { "kind": "path", "path": "$.a" }
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"document": { "a": 1 },
|
|
131
|
+
"meta": {
|
|
132
|
+
"errors": [],
|
|
133
|
+
"warnings": []
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Typed binding API (JSON output):
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
export function runTypedRuntime<TDocument>(
|
|
142
|
+
input: string,
|
|
143
|
+
options: TypedRuntimeOptions<TDocument>
|
|
144
|
+
): TypedRuntimeResult<TDocument>;
|
|
145
|
+
|
|
146
|
+
export function createTypedRuntimeBinder<TDocument>(
|
|
147
|
+
schema: SchemaV1,
|
|
148
|
+
options?: TypedBinderOptions<TDocument>
|
|
149
|
+
): (input: string) => TypedRuntimeResult<TDocument>;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Example:
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import { runTypedRuntime } from '@altopelago/aeon-runtime';
|
|
156
|
+
import type { AppConfig } from './generated-types.js';
|
|
157
|
+
|
|
158
|
+
const result = runTypedRuntime<AppConfig>('name = "AEON"\\nport = 8080', {
|
|
159
|
+
schema,
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Notes
|
|
164
|
+
|
|
165
|
+
- Default profile is `altopelago.core.v1`.
|
|
166
|
+
- Strict mode stops at the first phase that emits errors.
|
|
167
|
+
- Loose mode continues and aggregates diagnostics.
|
|
168
|
+
- Output document format is selected via `output` (`json` default).
|
|
169
|
+
- `linked-json` is the opt-in live JSON materialization mode for `~>` pointer aliases.
|
|
170
|
+
- Typed binding APIs operate on JSON finalization output and support optional runtime guards.
|
|
171
|
+
- `includeAnnotations` opts into annotation-stream passthrough for tooling/debug output.
|
|
172
|
+
- Annotations are non-authoritative and non-influencing relative to runtime decisions.
|
|
173
|
+
- `maxInputBytes` is available as an input-boundary fail-closed limit.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ProfileRef, type ProfileRegistry } from '@altopelago/aeon-profiles';
|
|
2
|
+
import { type AnnotationRecord } from '@altopelago/aeon-core';
|
|
3
|
+
import { type AssignmentEvent, type ResolveMeta } from '@altopelago/aeon-aes';
|
|
4
|
+
import { type FinalizedMap, type FinalizedNodeDocument, type FinalizeMeta, type FinalizeScope, type JsonObject } from '@altopelago/aeon-finalize';
|
|
5
|
+
import { type ResultEnvelope, type SchemaV1 } from '@altopelago/aeos-core';
|
|
6
|
+
export type RuntimeMode = 'strict' | 'loose';
|
|
7
|
+
export type RuntimeOutput = 'json' | 'linked-json' | 'map' | 'node';
|
|
8
|
+
export interface RuntimeOptions {
|
|
9
|
+
readonly mode?: RuntimeMode;
|
|
10
|
+
/** Runtime preset alias. 'rich' maps to datatypePolicy=allow_custom unless explicitly overridden. */
|
|
11
|
+
readonly preset?: 'rich';
|
|
12
|
+
readonly datatypePolicy?: 'reserved_only' | 'allow_custom';
|
|
13
|
+
readonly profile?: ProfileRef;
|
|
14
|
+
readonly registry?: ProfileRegistry;
|
|
15
|
+
readonly schema?: SchemaV1;
|
|
16
|
+
readonly output?: RuntimeOutput;
|
|
17
|
+
readonly materialization?: 'all' | 'projected';
|
|
18
|
+
readonly includePaths?: readonly string[];
|
|
19
|
+
readonly scope?: FinalizeScope;
|
|
20
|
+
readonly includeAnnotations?: boolean;
|
|
21
|
+
readonly maxInputBytes?: number;
|
|
22
|
+
readonly maxAttributeDepth?: number;
|
|
23
|
+
readonly maxSeparatorDepth?: number;
|
|
24
|
+
readonly maxGenericDepth?: number;
|
|
25
|
+
readonly trailingSeparatorDelimiterPolicy?: 'off' | 'warn' | 'error';
|
|
26
|
+
}
|
|
27
|
+
export interface RuntimeDiagnostic {
|
|
28
|
+
readonly level: 'error' | 'warning';
|
|
29
|
+
readonly phase: 5 | 6 | 7 | 8;
|
|
30
|
+
readonly message: string;
|
|
31
|
+
readonly code?: string;
|
|
32
|
+
readonly path?: string;
|
|
33
|
+
readonly span?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface RuntimeMeta {
|
|
36
|
+
readonly errors: readonly RuntimeDiagnostic[];
|
|
37
|
+
readonly warnings: readonly RuntimeDiagnostic[];
|
|
38
|
+
readonly profileId?: string;
|
|
39
|
+
readonly version?: string;
|
|
40
|
+
readonly schema?: ResultEnvelope;
|
|
41
|
+
readonly resolution?: ResolveMeta;
|
|
42
|
+
readonly finalization?: FinalizeMeta;
|
|
43
|
+
}
|
|
44
|
+
export interface RuntimeResult {
|
|
45
|
+
readonly aes: readonly AssignmentEvent[];
|
|
46
|
+
readonly annotations?: readonly AnnotationRecord[];
|
|
47
|
+
readonly document?: JsonObject | FinalizedMap | FinalizedNodeDocument;
|
|
48
|
+
readonly meta: RuntimeMeta;
|
|
49
|
+
}
|
|
50
|
+
export interface TypedRuntimeOptions<TDocument> extends Omit<RuntimeOptions, 'schema' | 'output'> {
|
|
51
|
+
readonly schema: SchemaV1;
|
|
52
|
+
readonly guard?: (value: unknown) => value is TDocument;
|
|
53
|
+
readonly output?: 'json' | 'linked-json';
|
|
54
|
+
}
|
|
55
|
+
export interface TypedRuntimeResult<TDocument> extends Omit<RuntimeResult, 'document'> {
|
|
56
|
+
readonly document?: TDocument;
|
|
57
|
+
}
|
|
58
|
+
export type TypedBinderOptions<TDocument> = Omit<TypedRuntimeOptions<TDocument>, 'schema'>;
|
|
59
|
+
export declare function runRuntime(input: string, options?: RuntimeOptions): RuntimeResult;
|
|
60
|
+
export declare function runTypedRuntime<TDocument>(input: string, options: TypedRuntimeOptions<TDocument>): TypedRuntimeResult<TDocument>;
|
|
61
|
+
export declare function createTypedRuntimeBinder<TDocument>(schema: SchemaV1, options?: TypedBinderOptions<TDocument>): (input: string) => TypedRuntimeResult<TDocument>;
|
|
62
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts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;IACtE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB,CAAC,SAAS,CAAE,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7F,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,SAAS,CAAC;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB,CAAC,SAAS,CAAE,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IAClF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACjC;AAED,MAAM,MAAM,kBAAkB,CAAC,SAAS,IAAI,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AAqH3F,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,aAAa,CA2JrF;AAED,wBAAgB,eAAe,CAAC,SAAS,EACrC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,GACxC,kBAAkB,CAAC,SAAS,CAAC,CAwE/B;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAC9C,MAAM,EAAE,QAAQ,EAChB,OAAO,GAAE,kBAAkB,CAAC,SAAS,CAAM,GAC5C,CAAC,KAAK,EAAE,MAAM,KAAK,kBAAkB,CAAC,SAAS,CAAC,CAKlD"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { compile as compileProfile, createDefaultRegistry, } from '@altopelago/aeon-profiles';
|
|
2
|
+
import { compile as compileCore } from '@altopelago/aeon-core';
|
|
3
|
+
import { resolveRefs } from '@altopelago/aeon-aes';
|
|
4
|
+
import { materialize } from '@altopelago/aeon-tonic';
|
|
5
|
+
import { finalizeJson, finalizeLinkedJson, finalizeMap, finalizeNode, } from '@altopelago/aeon-finalize';
|
|
6
|
+
import { validate } from '@altopelago/aeos-core';
|
|
7
|
+
function asDiag(level, phase, source) {
|
|
8
|
+
return {
|
|
9
|
+
level,
|
|
10
|
+
phase,
|
|
11
|
+
message: source.message,
|
|
12
|
+
...(source.code !== undefined ? { code: source.code } : {}),
|
|
13
|
+
...(source.path !== undefined ? { path: source.path } : {}),
|
|
14
|
+
...(source.span !== undefined ? { span: source.span } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function resolveProfile(profile, registry) {
|
|
18
|
+
if (!profile)
|
|
19
|
+
return registry.get('altopelago.core.v1') ?? null;
|
|
20
|
+
if (typeof profile === 'string')
|
|
21
|
+
return registry.get(profile) ?? null;
|
|
22
|
+
return profile;
|
|
23
|
+
}
|
|
24
|
+
function stripProfileProcessors(profile) {
|
|
25
|
+
return {
|
|
26
|
+
id: profile.id,
|
|
27
|
+
...(profile.version !== undefined ? { version: profile.version } : {}),
|
|
28
|
+
compile: profile.compile,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function finalizeByOutput(aes, output, mode, options) {
|
|
32
|
+
const finalizeOptions = {
|
|
33
|
+
mode,
|
|
34
|
+
...(options.materialization !== undefined ? { materialization: options.materialization } : {}),
|
|
35
|
+
...(options.includePaths !== undefined ? { includePaths: options.includePaths } : {}),
|
|
36
|
+
...(options.scope !== undefined ? { scope: options.scope } : {}),
|
|
37
|
+
...(options.header !== undefined ? { header: options.header } : {}),
|
|
38
|
+
};
|
|
39
|
+
if (output === 'map')
|
|
40
|
+
return finalizeMap(aes, finalizeOptions);
|
|
41
|
+
if (output === 'node')
|
|
42
|
+
return finalizeNode(aes, finalizeOptions);
|
|
43
|
+
if (output === 'linked-json')
|
|
44
|
+
return finalizeLinkedJson(aes, finalizeOptions);
|
|
45
|
+
return finalizeJson(aes, finalizeOptions);
|
|
46
|
+
}
|
|
47
|
+
function appendProfileDiagnostics(errors, warnings, diagnostics) {
|
|
48
|
+
if (!diagnostics)
|
|
49
|
+
return;
|
|
50
|
+
for (const diag of diagnostics) {
|
|
51
|
+
if (diag.level === 'error') {
|
|
52
|
+
errors.push(asDiag('error', 5, diag));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
warnings.push(asDiag('warning', 5, diag));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function appendSchemaDiagnostics(errors, warnings, diagnostics, level) {
|
|
60
|
+
for (const diag of diagnostics) {
|
|
61
|
+
const target = level === 'error' ? errors : warnings;
|
|
62
|
+
target.push(asDiag(level, 6, {
|
|
63
|
+
message: diag.message,
|
|
64
|
+
code: diag.code,
|
|
65
|
+
path: diag.path,
|
|
66
|
+
span: diag.span,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function appendResolveDiagnostics(errors, warnings, diagnostics, level) {
|
|
71
|
+
if (!diagnostics)
|
|
72
|
+
return;
|
|
73
|
+
for (const diag of diagnostics) {
|
|
74
|
+
const target = level === 'error' ? errors : warnings;
|
|
75
|
+
target.push(asDiag(level, 7, diag));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function appendFinalizeDiagnostics(errors, warnings, diagnostics, level) {
|
|
79
|
+
if (!diagnostics)
|
|
80
|
+
return;
|
|
81
|
+
for (const diag of diagnostics) {
|
|
82
|
+
const target = level === 'error' ? errors : warnings;
|
|
83
|
+
target.push(asDiag(level, 8, diag));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export function runRuntime(input, options = {}) {
|
|
87
|
+
const mode = options.mode ?? 'strict';
|
|
88
|
+
const output = options.output ?? 'json';
|
|
89
|
+
const datatypePolicy = options.datatypePolicy ?? (options.preset === 'rich' ? 'allow_custom' : 'reserved_only');
|
|
90
|
+
const includeAnnotations = options.includeAnnotations ?? false;
|
|
91
|
+
const scope = options.scope ?? 'payload';
|
|
92
|
+
const maxInputBytes = options.maxInputBytes;
|
|
93
|
+
const maxAttributeDepth = options.maxAttributeDepth ?? 1;
|
|
94
|
+
const maxSeparatorDepth = options.maxSeparatorDepth ?? 1;
|
|
95
|
+
const maxGenericDepth = options.maxGenericDepth ?? 1;
|
|
96
|
+
const errors = [];
|
|
97
|
+
const warnings = [];
|
|
98
|
+
const registry = options.registry ?? createDefaultRegistry();
|
|
99
|
+
const profile = resolveProfile(options.profile, registry);
|
|
100
|
+
if (!profile) {
|
|
101
|
+
errors.push(asDiag('error', 5, {
|
|
102
|
+
message: `Unknown profile: ${String(options.profile ?? 'altopelago.core.v1')}`,
|
|
103
|
+
code: 'PROFILE_NOT_FOUND',
|
|
104
|
+
}));
|
|
105
|
+
return {
|
|
106
|
+
aes: [],
|
|
107
|
+
meta: { errors, warnings },
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (profile.processors && profile.processors.length > 0) {
|
|
111
|
+
warnings.push(asDiag('warning', 5, {
|
|
112
|
+
message: `Profile '${profile.id}' processors were skipped to enforce phase order (schema before resolve).`,
|
|
113
|
+
code: 'PROFILE_PROCESSORS_SKIPPED',
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
const compileResult = compileProfile(input, {
|
|
117
|
+
profile: stripProfileProcessors(profile),
|
|
118
|
+
registry,
|
|
119
|
+
mode,
|
|
120
|
+
datatypePolicy,
|
|
121
|
+
...(maxInputBytes !== undefined ? { maxInputBytes } : {}),
|
|
122
|
+
maxAttributeDepth,
|
|
123
|
+
maxSeparatorDepth,
|
|
124
|
+
maxGenericDepth,
|
|
125
|
+
});
|
|
126
|
+
const needCoreMetadata = includeAnnotations || scope !== 'payload';
|
|
127
|
+
const coreResult = needCoreMetadata
|
|
128
|
+
? compileCore(input, {
|
|
129
|
+
recovery: mode === 'loose',
|
|
130
|
+
datatypePolicy,
|
|
131
|
+
...(maxInputBytes !== undefined ? { maxInputBytes } : {}),
|
|
132
|
+
maxAttributeDepth,
|
|
133
|
+
maxSeparatorDepth,
|
|
134
|
+
maxGenericDepth,
|
|
135
|
+
emitAnnotations: includeAnnotations,
|
|
136
|
+
})
|
|
137
|
+
: null;
|
|
138
|
+
const annotations = includeAnnotations ? (coreResult?.annotations ?? []) : undefined;
|
|
139
|
+
appendProfileDiagnostics(errors, warnings, compileResult.meta?.errors);
|
|
140
|
+
appendProfileDiagnostics(errors, warnings, compileResult.meta?.warnings);
|
|
141
|
+
let aes = compileResult.aes;
|
|
142
|
+
if (mode === 'strict' && errors.length > 0) {
|
|
143
|
+
return {
|
|
144
|
+
aes,
|
|
145
|
+
...(annotations ? { annotations } : {}),
|
|
146
|
+
meta: {
|
|
147
|
+
errors,
|
|
148
|
+
warnings,
|
|
149
|
+
...(compileResult.meta?.profileId ? { profileId: compileResult.meta.profileId } : {}),
|
|
150
|
+
...(compileResult.meta?.version ? { version: compileResult.meta.version } : {}),
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
let schemaResult;
|
|
155
|
+
if (options.schema) {
|
|
156
|
+
schemaResult = validate(aes, options.schema, {
|
|
157
|
+
...(options.trailingSeparatorDelimiterPolicy !== undefined
|
|
158
|
+
? { trailingSeparatorDelimiterPolicy: options.trailingSeparatorDelimiterPolicy }
|
|
159
|
+
: {}),
|
|
160
|
+
});
|
|
161
|
+
appendSchemaDiagnostics(errors, warnings, schemaResult.errors, 'error');
|
|
162
|
+
appendSchemaDiagnostics(errors, warnings, schemaResult.warnings, 'warning');
|
|
163
|
+
if (mode === 'strict' && schemaResult.errors.length > 0) {
|
|
164
|
+
return {
|
|
165
|
+
aes,
|
|
166
|
+
...(annotations ? { annotations } : {}),
|
|
167
|
+
meta: {
|
|
168
|
+
errors,
|
|
169
|
+
warnings,
|
|
170
|
+
...(compileResult.meta?.profileId ? { profileId: compileResult.meta.profileId } : {}),
|
|
171
|
+
...(compileResult.meta?.version ? { version: compileResult.meta.version } : {}),
|
|
172
|
+
schema: schemaResult,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const resolved = resolveRefs(aes, { mode });
|
|
178
|
+
appendResolveDiagnostics(errors, warnings, resolved.meta?.errors, 'error');
|
|
179
|
+
appendResolveDiagnostics(errors, warnings, resolved.meta?.warnings, 'warning');
|
|
180
|
+
aes = resolved.aes;
|
|
181
|
+
const tonicResult = materialize({
|
|
182
|
+
aes,
|
|
183
|
+
...(annotations ? { annotations } : {}),
|
|
184
|
+
});
|
|
185
|
+
aes = tonicResult.aes;
|
|
186
|
+
const materializedAnnotations = tonicResult.annotations;
|
|
187
|
+
if (mode === 'strict' && resolved.meta?.errors && resolved.meta.errors.length > 0) {
|
|
188
|
+
return {
|
|
189
|
+
aes,
|
|
190
|
+
...(materializedAnnotations ? { annotations: materializedAnnotations } : {}),
|
|
191
|
+
meta: {
|
|
192
|
+
errors,
|
|
193
|
+
warnings,
|
|
194
|
+
...(compileResult.meta?.profileId ? { profileId: compileResult.meta.profileId } : {}),
|
|
195
|
+
...(compileResult.meta?.version ? { version: compileResult.meta.version } : {}),
|
|
196
|
+
...(schemaResult ? { schema: schemaResult } : {}),
|
|
197
|
+
...(resolved.meta ? { resolution: resolved.meta } : {}),
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const finalized = finalizeByOutput(aes, output, mode, {
|
|
202
|
+
materialization: options.materialization,
|
|
203
|
+
includePaths: options.includePaths,
|
|
204
|
+
scope,
|
|
205
|
+
...(coreResult?.header ? { header: coreResult.header } : {}),
|
|
206
|
+
});
|
|
207
|
+
appendFinalizeDiagnostics(errors, warnings, finalized.meta?.errors, 'error');
|
|
208
|
+
appendFinalizeDiagnostics(errors, warnings, finalized.meta?.warnings, 'warning');
|
|
209
|
+
return {
|
|
210
|
+
aes,
|
|
211
|
+
...(materializedAnnotations ? { annotations: materializedAnnotations } : {}),
|
|
212
|
+
document: finalized.document,
|
|
213
|
+
meta: {
|
|
214
|
+
errors,
|
|
215
|
+
warnings,
|
|
216
|
+
...(compileResult.meta?.profileId ? { profileId: compileResult.meta.profileId } : {}),
|
|
217
|
+
...(compileResult.meta?.version ? { version: compileResult.meta.version } : {}),
|
|
218
|
+
...(schemaResult ? { schema: schemaResult } : {}),
|
|
219
|
+
...(resolved.meta ? { resolution: resolved.meta } : {}),
|
|
220
|
+
...(finalized.meta ? { finalization: finalized.meta } : {}),
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
export function runTypedRuntime(input, options) {
|
|
225
|
+
const mode = options.mode ?? 'strict';
|
|
226
|
+
const runtimeOptions = {
|
|
227
|
+
mode,
|
|
228
|
+
...(options.preset !== undefined ? { preset: options.preset } : {}),
|
|
229
|
+
...(options.datatypePolicy !== undefined ? { datatypePolicy: options.datatypePolicy } : {}),
|
|
230
|
+
schema: options.schema,
|
|
231
|
+
output: 'json',
|
|
232
|
+
...(options.maxAttributeDepth !== undefined ? { maxAttributeDepth: options.maxAttributeDepth } : {}),
|
|
233
|
+
...(options.maxSeparatorDepth !== undefined ? { maxSeparatorDepth: options.maxSeparatorDepth } : {}),
|
|
234
|
+
...(options.maxGenericDepth !== undefined ? { maxGenericDepth: options.maxGenericDepth } : {}),
|
|
235
|
+
...(options.materialization !== undefined ? { materialization: options.materialization } : {}),
|
|
236
|
+
...(options.includePaths !== undefined ? { includePaths: options.includePaths } : {}),
|
|
237
|
+
...(options.scope !== undefined ? { scope: options.scope } : {}),
|
|
238
|
+
...(options.trailingSeparatorDelimiterPolicy !== undefined
|
|
239
|
+
? { trailingSeparatorDelimiterPolicy: options.trailingSeparatorDelimiterPolicy }
|
|
240
|
+
: {}),
|
|
241
|
+
...(options.includeAnnotations !== undefined ? { includeAnnotations: options.includeAnnotations } : {}),
|
|
242
|
+
...(options.maxInputBytes !== undefined ? { maxInputBytes: options.maxInputBytes } : {}),
|
|
243
|
+
...(options.profile !== undefined ? { profile: options.profile } : {}),
|
|
244
|
+
...(options.registry !== undefined ? { registry: options.registry } : {}),
|
|
245
|
+
};
|
|
246
|
+
const base = runRuntime(input, runtimeOptions);
|
|
247
|
+
const errors = [...base.meta.errors];
|
|
248
|
+
const warnings = [...base.meta.warnings];
|
|
249
|
+
if (base.document === undefined) {
|
|
250
|
+
return {
|
|
251
|
+
aes: base.aes,
|
|
252
|
+
...(base.annotations !== undefined ? { annotations: base.annotations } : {}),
|
|
253
|
+
meta: {
|
|
254
|
+
...base.meta,
|
|
255
|
+
errors,
|
|
256
|
+
warnings,
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const candidate = base.document;
|
|
261
|
+
if (options.guard && !options.guard(candidate)) {
|
|
262
|
+
const diag = asDiag(mode === 'strict' ? 'error' : 'warning', 8, {
|
|
263
|
+
message: 'Typed runtime guard rejected finalized JSON output.',
|
|
264
|
+
code: 'TYPE_GUARD_FAILED',
|
|
265
|
+
});
|
|
266
|
+
if (mode === 'strict') {
|
|
267
|
+
errors.push(diag);
|
|
268
|
+
return {
|
|
269
|
+
aes: base.aes,
|
|
270
|
+
...(base.annotations !== undefined ? { annotations: base.annotations } : {}),
|
|
271
|
+
meta: {
|
|
272
|
+
...base.meta,
|
|
273
|
+
errors,
|
|
274
|
+
warnings,
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
warnings.push(diag);
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
aes: base.aes,
|
|
282
|
+
...(base.annotations !== undefined ? { annotations: base.annotations } : {}),
|
|
283
|
+
document: candidate,
|
|
284
|
+
meta: {
|
|
285
|
+
...base.meta,
|
|
286
|
+
errors,
|
|
287
|
+
warnings,
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
export function createTypedRuntimeBinder(schema, options = {}) {
|
|
292
|
+
return (input) => runTypedRuntime(input, {
|
|
293
|
+
...options,
|
|
294
|
+
schema,
|
|
295
|
+
});
|
|
296
|
+
}
|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,CAAC,CAAC;IACxB,CAAC;IAED,OAAO;QACH,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,QAAQ,EAAE,SAAsB;QAChC,IAAI,EAAE;YACF,GAAG,IAAI,CAAC,IAAI;YACZ,MAAM;YACN,QAAQ;SACX;KACJ,CAAC;AACN,CAAC;AAED,MAAM,UAAU,wBAAwB,CACpC,MAAgB,EAChB,UAAyC,EAAE;IAE3C,OAAO,CAAC,KAAa,EAAE,EAAE,CAAC,eAAe,CAAY,KAAK,EAAE;QACxD,GAAG,OAAO;QACV,MAAM;KACT,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@altopelago/aeon-runtime",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"!dist/**/*.test.d.ts",
|
|
16
|
+
"!dist/**/*.test.d.ts.map",
|
|
17
|
+
"!dist/**/*.test.js",
|
|
18
|
+
"!dist/**/*.test.js.map"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@altopelago/aeon-aes": "0.9.0",
|
|
22
|
+
"@altopelago/aeon-tonic": "0.9.0",
|
|
23
|
+
"@altopelago/aeon-profiles": "0.9.0",
|
|
24
|
+
"@altopelago/aeon-core": "0.9.0",
|
|
25
|
+
"@altopelago/aeon-finalize": "0.9.0",
|
|
26
|
+
"@altopelago/aeos-core": "0.9.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.json",
|
|
30
|
+
"test": "node --test dist/*.test.js",
|
|
31
|
+
"clean": "rm -rf dist",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
33
|
+
}
|
|
34
|
+
}
|