@astrale-os/kernel-dsl 0.2.0-beta.46 → 0.2.0-beta.48

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.
Files changed (159) hide show
  1. package/dist/v1/addressing/patterns.d.ts +0 -5
  2. package/dist/v1/addressing/patterns.js +5 -5
  3. package/dist/v1/builder/callable/authoring.d.ts +1 -1
  4. package/dist/v1/builder/class/authoring.d.ts +0 -12
  5. package/dist/v1/builder/class/property.d.ts +4 -2
  6. package/dist/v1/builder/class/property.js +9 -1
  7. package/dist/v1/builder/index.d.ts +1 -1
  8. package/dist/v1/builder/lowering/callable.d.ts +2 -1
  9. package/dist/v1/builder/lowering/core.d.ts +3 -2
  10. package/dist/v1/builder/lowering/schema/compile.js +15 -2
  11. package/dist/v1/builder/lowering/value/compile.js +3 -0
  12. package/dist/v1/builder/lowering/value/zod.d.ts +3 -2
  13. package/dist/v1/builder/lowering/view.d.ts +4 -3
  14. package/dist/v1/builder/lowering/view.js +2 -14
  15. package/dist/v1/builder/schema/define.d.ts +4 -2
  16. package/dist/v1/builder/schema/diagnostic.d.ts +1 -1
  17. package/dist/v1/builder/schema/handle.d.ts +2 -1
  18. package/dist/v1/builder/schema/input.d.ts +8 -0
  19. package/dist/v1/builder/schema/projection/callable.d.ts +51 -0
  20. package/dist/v1/builder/schema/projection/callable.js +1 -0
  21. package/dist/v1/builder/schema/projection/class.d.ts +89 -0
  22. package/dist/v1/builder/schema/projection/class.js +1 -0
  23. package/dist/v1/builder/schema/projection/core-input.d.ts +32 -0
  24. package/dist/v1/builder/schema/projection/core-input.js +1 -0
  25. package/dist/v1/builder/schema/projection/domain.d.ts +59 -0
  26. package/dist/v1/builder/schema/projection/domain.js +1 -0
  27. package/dist/v1/builder/schema/projection/identity.d.ts +39 -0
  28. package/dist/v1/builder/schema/projection/identity.js +1 -0
  29. package/dist/v1/builder/schema/projection/model.d.ts +59 -0
  30. package/dist/v1/builder/schema/projection/model.js +1 -0
  31. package/dist/v1/builder/schema/projection/property.d.ts +32 -0
  32. package/dist/v1/builder/schema/projection/property.js +1 -0
  33. package/dist/v1/builder/schema/projection/resolved-class.d.ts +76 -0
  34. package/dist/v1/builder/schema/projection/resolved-class.js +1 -0
  35. package/dist/v1/builder/schema/projection.d.ts +4 -375
  36. package/dist/v1/builder/view/authoring.d.ts +3 -7
  37. package/dist/v1/builder/view/authoring.js +5 -2
  38. package/dist/v1/bundle/structure.d.ts +2 -1
  39. package/dist/v1/compiled/admission/accept.d.ts +1 -1
  40. package/dist/v1/compiled/admission/accept.js +7 -1001
  41. package/dist/v1/compiled/admission/closure.d.ts +3 -0
  42. package/dist/v1/compiled/admission/closure.js +173 -0
  43. package/dist/v1/compiled/admission/diagnostic.d.ts +7 -0
  44. package/dist/v1/compiled/admission/diagnostic.js +13 -0
  45. package/dist/v1/compiled/admission/revision.js +2 -0
  46. package/dist/v1/compiled/admission/semantics/cardinality.d.ts +5 -0
  47. package/dist/v1/compiled/admission/semantics/cardinality.js +113 -0
  48. package/dist/v1/compiled/admission/semantics/class.d.ts +5 -0
  49. package/dist/v1/compiled/admission/semantics/class.js +125 -0
  50. package/dist/v1/compiled/admission/semantics/context.d.ts +60 -0
  51. package/dist/v1/compiled/admission/semantics/context.js +81 -0
  52. package/dist/v1/compiled/admission/semantics/core.d.ts +35 -0
  53. package/dist/v1/compiled/admission/semantics/core.js +123 -0
  54. package/dist/v1/compiled/admission/semantics/edge.d.ts +8 -0
  55. package/dist/v1/compiled/admission/semantics/edge.js +89 -0
  56. package/dist/v1/compiled/admission/semantics/policy/admit.d.ts +4 -0
  57. package/dist/v1/compiled/admission/semantics/policy/admit.js +57 -0
  58. package/dist/v1/compiled/admission/semantics/policy/callable.d.ts +5 -0
  59. package/dist/v1/compiled/admission/semantics/policy/callable.js +72 -0
  60. package/dist/v1/compiled/admission/semantics/policy/contracts.d.ts +24 -0
  61. package/dist/v1/compiled/admission/semantics/policy/contracts.js +45 -0
  62. package/dist/v1/compiled/admission/semantics/policy/equality.d.ts +8 -0
  63. package/dist/v1/compiled/admission/semantics/policy/equality.js +27 -0
  64. package/dist/v1/compiled/admission/semantics/policy/measure.d.ts +9 -0
  65. package/dist/v1/compiled/admission/semantics/policy/measure.js +81 -0
  66. package/dist/v1/compiled/admission/semantics/policy/parity.d.ts +4 -0
  67. package/dist/v1/compiled/admission/semantics/policy/parity.js +126 -0
  68. package/dist/v1/compiled/admission/semantics/policy/pattern.d.ts +8 -0
  69. package/dist/v1/compiled/admission/semantics/policy/pattern.js +78 -0
  70. package/dist/v1/compiled/admission/semantics/policy/typing.d.ts +28 -0
  71. package/dist/v1/compiled/admission/semantics/policy/typing.js +206 -0
  72. package/dist/v1/compiled/admission/semantics/policy/variants.d.ts +10 -0
  73. package/dist/v1/compiled/admission/semantics/policy/variants.js +65 -0
  74. package/dist/v1/compiled/admission/semantics.d.ts +1 -1
  75. package/dist/v1/compiled/admission/semantics.js +8 -1214
  76. package/dist/v1/compiled/admission/wire/callable.d.ts +6 -0
  77. package/dist/v1/compiled/admission/wire/callable.js +90 -0
  78. package/dist/v1/compiled/admission/wire/class.d.ts +4 -0
  79. package/dist/v1/compiled/admission/wire/class.js +117 -0
  80. package/dist/v1/compiled/admission/wire/core.d.ts +5 -0
  81. package/dist/v1/compiled/admission/wire/core.js +32 -0
  82. package/dist/v1/compiled/admission/wire/dependency.d.ts +14 -0
  83. package/dist/v1/compiled/admission/wire/dependency.js +43 -0
  84. package/dist/v1/compiled/admission/wire/entry.d.ts +5 -0
  85. package/dist/v1/compiled/admission/wire/entry.js +100 -0
  86. package/dist/v1/compiled/admission/wire/pattern.d.ts +12 -0
  87. package/dist/v1/compiled/admission/wire/pattern.js +111 -0
  88. package/dist/v1/compiled/admission/wire/policy.d.ts +5 -0
  89. package/dist/v1/compiled/admission/wire/policy.js +168 -0
  90. package/dist/v1/compiled/admission/wire/program.d.ts +4 -0
  91. package/dist/v1/compiled/admission/wire/program.js +52 -0
  92. package/dist/v1/compiled/admission/wire/property.d.ts +4 -0
  93. package/dist/v1/compiled/admission/wire/property.js +74 -0
  94. package/dist/v1/compiled/admission/wire/reference.d.ts +8 -0
  95. package/dist/v1/compiled/admission/wire/reference.js +33 -0
  96. package/dist/v1/compiled/admission/wire/value.d.ts +29 -0
  97. package/dist/v1/compiled/admission/wire/value.js +98 -0
  98. package/dist/v1/compiled/admission/wire/view.d.ts +3 -0
  99. package/dist/v1/compiled/admission/wire/view.js +17 -0
  100. package/dist/v1/compiled/compiler/compile.js +3 -0
  101. package/dist/v1/compiled/model/schema.d.ts +5 -1
  102. package/dist/v1/domain/create.js +0 -19
  103. package/dist/v1/domain/model/domain.d.ts +0 -1
  104. package/dist/v1/domain/projection/classes.js +2 -9
  105. package/dist/v1/index.d.ts +1 -1
  106. package/dist/v1/language/class/inheritance.d.ts +12 -0
  107. package/dist/v1/language/class/inheritance.js +25 -0
  108. package/dist/v1/language/class/model/property.d.ts +3 -0
  109. package/dist/v1/language/class/resolved.d.ts +5 -1
  110. package/dist/v1/language/definition/metadata.d.ts +8 -0
  111. package/dist/v1/language/definition/metadata.js +12 -0
  112. package/dist/v1/language/value/model/blob.d.ts +0 -2
  113. package/dist/v1/language/value/model/blob.js +2 -2
  114. package/dist/v1/language/value/model/instant.d.ts +0 -2
  115. package/dist/v1/language/value/model/instant.js +1 -1
  116. package/dist/v1/language/value/model/schema.d.ts +2 -1
  117. package/dist/v1/language/value/model/schema.js +1 -5
  118. package/dist/v1/language/value/reference/registry.d.ts +2 -1
  119. package/dist/v1/language/value/regexp/syntax.d.ts +2 -1
  120. package/dist/v1/language/view/model/view.d.ts +2 -4
  121. package/dist/v1/language/view/resolved.d.ts +2 -2
  122. package/dist/v1/schema/analysis/class.d.ts +4 -2
  123. package/dist/v1/schema/analysis/class.js +1 -0
  124. package/dist/v1/schema/canonical/revision.d.ts +2 -1
  125. package/dist/v1/schema/compatibility/comparators/classes.d.ts +2 -1
  126. package/dist/v1/schema/compatibility/context.d.ts +6 -2
  127. package/dist/v1/schema/compatibility/context.js +12 -6
  128. package/dist/v1/schema/compatibility/coordinate.d.ts +2 -1
  129. package/dist/v1/schema/compatibility/fields.d.ts +2 -0
  130. package/dist/v1/schema/compatibility/fields.js +1 -0
  131. package/dist/v1/schema/compatibility/references.js +1 -10
  132. package/dist/v1/schema/compatibility/report.d.ts +2 -1
  133. package/dist/v1/schema/compatibility/scope.d.ts +0 -4
  134. package/dist/v1/schema/compatibility/scope.js +1 -1
  135. package/dist/v1/schema/diagnostic.d.ts +1 -1
  136. package/dist/v1/schema/model/schema.d.ts +5 -1
  137. package/dist/v1/schema/normalization/domain.js +12 -6
  138. package/dist/v1/schema/resolution/definition.index.d.ts +1 -2
  139. package/dist/v1/schema/resolution/definition.index.js +0 -3
  140. package/dist/v1/schema/resolution/domain.d.ts +4 -1
  141. package/dist/v1/schema/resolution/domain.js +6 -7
  142. package/dist/v1/schema/resolution/origins.d.ts +1 -1
  143. package/dist/v1/schema/resolution/origins.js +0 -5
  144. package/dist/v1/schema/validation/class.js +19 -50
  145. package/dist/v1/schema/validation/core.js +1 -27
  146. package/dist/v1/schema/validation/domain.d.ts +2 -1
  147. package/dist/v1/schema/validation/domain.structure.d.ts +0 -2
  148. package/dist/v1/schema/validation/domain.structure.js +9 -8
  149. package/dist/v1/schema/validation/policy/context.js +5 -16
  150. package/dist/v1/schema/validation/view.js +14 -9
  151. package/dist/value/accept.d.ts +1 -1
  152. package/dist/value/accept.js +32 -6
  153. package/dist/value/canonical.js +10 -2
  154. package/dist/value/immutable.optimization.d.ts +4 -1
  155. package/dist/value/immutable.optimization.js +8 -2
  156. package/dist/value/limits.d.ts +1 -1
  157. package/dist/value/unicode.d.ts +3 -0
  158. package/dist/value/unicode.js +27 -0
  159. package/package.json +1 -1
@@ -5,11 +5,6 @@ export declare const MEMBER_NAME_PATTERN: RegExp;
5
5
  export declare const DEPENDENCY_ALIAS_PATTERN: RegExp;
6
6
  export declare const CORE_SLUG_PATTERN: RegExp;
7
7
  export declare const DOMAIN_REVISION_PATTERN: RegExp;
8
- export declare const DOMAIN_REVISION_FULL_MATCH = "sha256:[0-9a-f]{64}";
9
- export declare const DOMAIN_ORIGIN_FULL_MATCH = "([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?";
10
- export declare const MEMBER_NAME_FULL_MATCH = "[A-Za-z][A-Za-z0-9_]*";
11
- export declare const DEPENDENCY_ALIAS_FULL_MATCH = "[a-z][A-Za-z0-9]*";
12
- export declare const PROPERTY_KEY_FULL_MATCH = "([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?:class\\.[A-Za-z][A-Za-z0-9_]*\\.property\\.[A-Za-z][A-Za-z0-9_]*";
13
8
  export declare const PROPERTY_KEY_PATTERN: RegExp;
14
9
  export declare const patterns: Readonly<{
15
10
  coreSlug: RegExp;
@@ -3,11 +3,11 @@ export const MEMBER_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_]*$/u;
3
3
  export const DEPENDENCY_ALIAS_PATTERN = /^[a-z][A-Za-z0-9]*$/u;
4
4
  export const CORE_SLUG_PATTERN = /^[a-z][a-z0-9-]{0,99}$/u;
5
5
  export const DOMAIN_REVISION_PATTERN = /^sha256:[0-9a-f]{64}$/u;
6
- export const DOMAIN_REVISION_FULL_MATCH = 'sha256:[0-9a-f]{64}';
7
- export const DOMAIN_ORIGIN_FULL_MATCH = '([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?';
8
- export const MEMBER_NAME_FULL_MATCH = '[A-Za-z][A-Za-z0-9_]*';
9
- export const DEPENDENCY_ALIAS_FULL_MATCH = '[a-z][A-Za-z0-9]*';
10
- export const PROPERTY_KEY_FULL_MATCH = '([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?:class\\.[A-Za-z][A-Za-z0-9_]*\\.property\\.[A-Za-z][A-Za-z0-9_]*';
6
+ const DOMAIN_REVISION_FULL_MATCH = 'sha256:[0-9a-f]{64}';
7
+ const DOMAIN_ORIGIN_FULL_MATCH = '([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?';
8
+ const MEMBER_NAME_FULL_MATCH = '[A-Za-z][A-Za-z0-9_]*';
9
+ const DEPENDENCY_ALIAS_FULL_MATCH = '[a-z][A-Za-z0-9]*';
10
+ const PROPERTY_KEY_FULL_MATCH = '([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?:class\\.[A-Za-z][A-Za-z0-9_]*\\.property\\.[A-Za-z][A-Za-z0-9_]*';
11
11
  export const PROPERTY_KEY_PATTERN = new RegExp(`^(?:${PROPERTY_KEY_FULL_MATCH})$`, 'u');
12
12
  export const patterns = Object.freeze({
13
13
  coreSlug: CORE_SLUG_PATTERN,
@@ -109,7 +109,7 @@ export interface Method<out Projection = unknown> {
109
109
  export type ProjectionOfCallable<Value extends Function | Method> = Value extends Function<infer Projection> ? Projection : Value extends Method<infer Projection> ? Projection : never;
110
110
  /** Internal lowering access; Callable authoring handles expose no public configuration object. */
111
111
  export declare function callableConfiguration(value: Function | Method): CallableInput;
112
- export type PolicyObjectAuthoring = Class | Function | Method | Policy | View | CoreNode;
112
+ type PolicyObjectAuthoring = Class | Function | Method | Policy | View | CoreNode;
113
113
  export type PolicyObjectInput = Lazy<PolicyObjectAuthoring | PolicyObjectRef>;
114
114
  export declare function func<const Config extends FunctionInput, Input = FunctionInputOf<Config['input']>, Output = CallableOutputOf<Config['output']>, Auth extends FunctionAuth = Config['auth'], Execution extends CallableExecution | undefined = ExecutionOfConfig<Config>>(config: Config): Function<CallableProjection<Input, Output, Auth, false, false, Execution>>;
115
115
  export declare function method<const Config extends MethodInput, Input = ValueInputOf<Config['input']>, Output = CallableOutputOf<Config['output']>, Auth extends FunctionAuth = Config['auth'], Static extends boolean = Config extends {
@@ -79,18 +79,6 @@ export interface UndirectedEdgeInput extends Omit<EdgeClassOptions, 'constraints
79
79
  }
80
80
  export type EdgeClassCommon = EdgeClassOptions;
81
81
  export type EdgeClassInput = DirectedEdgeInput | UndirectedEdgeInput;
82
- export type ClassInput = ({
83
- readonly kind: 'node';
84
- readonly abstract: boolean;
85
- } & NodeClassInput) | ({
86
- readonly kind: 'edge';
87
- readonly orientation: 'directed';
88
- readonly abstract: boolean;
89
- } & Omit<DirectedEdgeInput, 'orientation'>) | ({
90
- readonly kind: 'edge';
91
- readonly orientation: 'undirected';
92
- readonly abstract: boolean;
93
- } & Omit<UndirectedEdgeInput, 'orientation'>);
94
82
  export type Class = NodeClass | EdgeClass;
95
83
  export interface AuthoredPropertyProjection<out Input = unknown, out Output = unknown, out Required extends boolean = boolean, out Name extends string = string, out Owner = 'self', out State extends StateTopology | undefined = StateTopology | undefined> {
96
84
  readonly input: Input;
@@ -1,5 +1,5 @@
1
1
  import type { z } from 'zod';
2
- import type { AutoEvent, AutoSet } from '../../language/class/model/property.js';
2
+ import type { AutoEvent, AutoSet, PropertyImmutability } from '../../language/class/model/property.js';
3
3
  import type { StateMachine } from '../../language/state/index.js';
4
4
  import type { JsonSchema } from '../../language/value/model/schema.js';
5
5
  import type { AUTHORING } from '../schema/handle.js';
@@ -9,6 +9,8 @@ export type ValueSchemaInput = z.ZodType | JsonSchema;
9
9
  export interface PropertyOptions {
10
10
  readonly required?: boolean;
11
11
  readonly description?: string;
12
+ /** `create` freezes the value at creation; `once` admits one write while absent. */
13
+ readonly immutable?: PropertyImmutability;
12
14
  }
13
15
  export interface AutoOptions {
14
16
  readonly on: AutoEvent | readonly AutoEvent[];
@@ -35,7 +37,7 @@ export interface AutoProperty<out PropertyValue extends Property = Property> {
35
37
  };
36
38
  };
37
39
  }
38
- export type PropertyAuthoringInput<Value extends Property> = Value extends Property<infer Schema, infer Options, infer Machine> ? {
40
+ type PropertyAuthoringInput<Value extends Property> = Value extends Property<infer Schema, infer Options, infer Machine> ? {
39
41
  readonly schema: Schema;
40
42
  readonly options: Options;
41
43
  readonly machine?: Machine;
@@ -10,7 +10,12 @@ export function autoPropertyAuthoringInput(value) {
10
10
  }
11
11
  export function property(schema, options) {
12
12
  const admitted = options ?? {};
13
- assertKnownKeys(admitted, ['required', 'description']);
13
+ assertKnownKeys(admitted, ['required', 'description', 'immutable']);
14
+ if (admitted.immutable !== undefined &&
15
+ admitted.immutable !== 'create' &&
16
+ admitted.immutable !== 'once') {
17
+ fail('BUILDER_PROPERTY_IMMUTABLE_INVALID', '/immutable', 'immutable is create or once.');
18
+ }
14
19
  return authoringValue('property', {
15
20
  [PROPERTY_INPUT]: {
16
21
  schema,
@@ -34,6 +39,9 @@ export function auto(property, options) {
34
39
  fail('BUILDER_AUTO_NESTED', '', 'auto(...) cannot wrap another auto Property.');
35
40
  }
36
41
  assertKnownKeys(options, ['on', 'set']);
42
+ if (propertyAuthoringInput(property).options.immutable !== undefined) {
43
+ fail('BUILDER_AUTO_IMMUTABLE', '', 'An auto Property cannot be immutable.');
44
+ }
37
45
  const authored = Array.isArray(options.on) ? options.on : [options.on];
38
46
  if (authored.length === 0)
39
47
  fail('BUILDER_AUTO_EVENT_INVALID', '/on', 'auto(...) requires an event.');
@@ -21,6 +21,6 @@ export type { MatchPolicyInput, Policy, PolicyBuilder as PolicyFactory, PolicyEd
21
21
  export type { AutoOptions, AutoProperty, Property, PropertyFieldInput as PropertyField, PropertyOptions, ValueSchemaInput, } from './class/property.js';
22
22
  export type { CorePropertyInput } from './schema/projection.js';
23
23
  export type { ClassProjection, FunctionProjection, MethodProjection, PropertyProjection, } from './schema/projection.js';
24
- export type { DomainSchemaInput as SchemaInput } from './schema/input.js';
24
+ export type { DomainSchemaInput as SchemaInput, EntrypointOf } from './schema/input.js';
25
25
  export type { TypedValueSchema } from './value/schema.js';
26
26
  export type { View, ViewInput } from './view/authoring.js';
@@ -3,7 +3,7 @@ import type { FunctionDefinition, MethodDefinition } from '../../language/callab
3
3
  import type { Function, Method } from '../callable/authoring.js';
4
4
  import type { BuilderContext } from './schema/context.js';
5
5
  import type { BuilderValueSchemas } from './value/compile.js';
6
- export type CallablePlacement = {
6
+ type CallablePlacement = {
7
7
  readonly kind: 'function';
8
8
  readonly ref: FunctionRef;
9
9
  readonly pointer: string;
@@ -22,3 +22,4 @@ export declare class V1CallableCompiler implements CallableCompiler {
22
22
  private compileOutput;
23
23
  private policyContext;
24
24
  }
25
+ export {};
@@ -4,12 +4,12 @@ import type { CoreEndpointRef } from '../../language/core/model/core.js';
4
4
  import type { CoreInput } from '../core/authoring.js';
5
5
  import type { BuilderContext } from './schema/context.js';
6
6
  export declare function captureCore(input: CoreInput | undefined, context: BuilderContext): void;
7
- export interface UnqualifiedCoreDefinition {
7
+ interface UnqualifiedCoreDefinition {
8
8
  readonly ref: CoreRef;
9
9
  readonly class: ClassRef;
10
10
  readonly properties: JsonObject;
11
11
  }
12
- export interface UnqualifiedCoreEdge {
12
+ interface UnqualifiedCoreEdge {
13
13
  readonly class: ClassRef;
14
14
  readonly source: CoreEndpointRef;
15
15
  readonly target: CoreEndpointRef;
@@ -20,3 +20,4 @@ export interface UnqualifiedCoreContent {
20
20
  readonly edges: readonly UnqualifiedCoreEdge[];
21
21
  }
22
22
  export declare function compileCore(input: CoreInput | undefined, context: BuilderContext): UnqualifiedCoreContent;
23
+ export {};
@@ -29,7 +29,16 @@ export function compileSchema(origin, input) {
29
29
  }
30
30
  /** Structural assembly before whole-Domain semantic acceptance. */
31
31
  function assembleDomainSchema(origin, input, lookup) {
32
- assertKnownKeys(input, ['dependencies', 'classes', 'functions', 'policies', 'views', 'core']);
32
+ assertKnownKeys(input, [
33
+ 'name',
34
+ 'entrypoint',
35
+ 'dependencies',
36
+ 'classes',
37
+ 'functions',
38
+ 'policies',
39
+ 'views',
40
+ 'core',
41
+ ]);
33
42
  if (input.core !== undefined)
34
43
  assertKnownKeys(input.core, ['nodes', 'edges'], '/core');
35
44
  const context = new BuilderContext(origin, input.dependencies ?? {});
@@ -47,12 +56,16 @@ function assembleDomainSchema(origin, input, lookup) {
47
56
  }));
48
57
  const policies = mapRecord(input.policies ?? {}, (value, name) => policyCompiler.compile(value, name, `/policies/${escapeToken(name)}`));
49
58
  assertPolicyCompositionAcyclic(policies, origin);
50
- const views = mapRecord(input.views ?? {}, (value, name) => viewCompiler.compile(value, name, `/views/${escapeToken(name)}`));
59
+ const views = mapRecord(input.views ?? {}, (value, name) => viewCompiler.compile(value, name));
51
60
  const core = compileCore(input.core, context);
52
61
  const semanticContent = {
53
62
  format: 'astrale.dsl',
54
63
  version: 'v1',
55
64
  origin,
65
+ name: input.name,
66
+ ...(input.entrypoint === undefined
67
+ ? {}
68
+ : { entrypoint: { origin, kind: 'view', name: input.entrypoint } }),
56
69
  // Class/Property resolution needs every dependency already referenced by
57
70
  // authored Definitions. Core endpoint refs are added immediately below.
58
71
  dependencies: context.dependencies(),
@@ -37,6 +37,9 @@ export class BuilderValueSchemas {
37
37
  schema: canonicalizeValueSchema(schema, 'property-facet', this.registry),
38
38
  required: authoredInput?.options.required ?? isRequired(schemaInput),
39
39
  ...(autoInput === undefined ? {} : { auto: autoInput.options }),
40
+ ...(authoredInput?.options.immutable === undefined
41
+ ? {}
42
+ : { immutable: authoredInput.options.immutable }),
40
43
  ...(authoredInput?.options.description === undefined
41
44
  ? {}
42
45
  : { description: authoredInput.options.description }),
@@ -2,7 +2,7 @@ import { ZodType } from 'zod';
2
2
  import type { JsonSchema, ValueSchemaContext } from '../../../language/value/model/schema.js';
3
3
  import type { ValueSchemaRegistry } from '../../../language/value/reference/registry.js';
4
4
  import type { BuilderDiagnostic } from '../../schema/diagnostic.js';
5
- export type ZodValueSchemaConversion = {
5
+ type ZodValueSchemaConversion = {
6
6
  readonly ok: true;
7
7
  readonly schema: JsonSchema;
8
8
  readonly diagnostics: readonly [];
@@ -10,7 +10,7 @@ export type ZodValueSchemaConversion = {
10
10
  readonly ok: false;
11
11
  readonly diagnostics: readonly BuilderDiagnostic[];
12
12
  };
13
- export interface ZodValueSchemaConversionOptions {
13
+ interface ZodValueSchemaConversionOptions {
14
14
  /** Undefined is representable only as absence at a containing object-property boundary. */
15
15
  readonly position?: 'value' | 'object-property';
16
16
  /** Builder-only lowering hook keyed by the original Zod schema identity. */
@@ -30,3 +30,4 @@ export interface ZodValueSchemaOverrideContext {
30
30
  export declare function convertZodToValueSchema(zodSchema: ZodType, context: ValueSchemaContext, registry: ValueSchemaRegistry, pointer?: string, options?: ZodValueSchemaConversionOptions): ZodValueSchemaConversion;
31
31
  /** Whether explicit Zod optionality makes a containing object property absent-able. */
32
32
  export declare function zodObjectPropertyIsOptional(schema: ZodType): boolean;
33
+ export {};
@@ -1,11 +1,12 @@
1
1
  import type { ViewDefinition } from '../../language/view/model/view.js';
2
2
  import type { View } from '../view/authoring.js';
3
3
  import type { BuilderContext } from './schema/context.js';
4
- export interface ViewCompiler {
5
- compile(value: View, name: string, pointer: string): ViewDefinition;
4
+ interface ViewCompiler {
5
+ compile(value: View, name: string): ViewDefinition;
6
6
  }
7
7
  export declare class V1ViewCompiler implements ViewCompiler {
8
8
  readonly context: BuilderContext;
9
9
  constructor(context: BuilderContext);
10
- compile(value: View, name: string, pointer: string): ViewDefinition;
10
+ compile(value: View, name: string): ViewDefinition;
11
11
  }
12
+ export {};
@@ -1,27 +1,15 @@
1
- import { compareDefinitionRefs } from '../../addressing/ordering.js';
2
1
  import { viewAuthoringInput } from '../view/authoring.js';
3
2
  export class V1ViewCompiler {
4
3
  context;
5
4
  constructor(context) {
6
5
  this.context = context;
7
6
  }
8
- compile(value, name, pointer) {
7
+ compile(value, name) {
9
8
  const config = viewAuthoringInput(value);
10
- const target = config.target;
11
9
  return {
12
10
  ref: { origin: this.context.origin, kind: 'view', name },
13
11
  ...(config.description === undefined ? {} : { description: config.description }),
14
- target: target === undefined || target === 'domain'
15
- ? { kind: 'domain' }
16
- : {
17
- kind: 'definition',
18
- definitions: (isTargetList(target) ? target : [target])
19
- .map((entry, index) => this.context.resolveNodeClass(entry, `${pointer}/target/definitions/${index}`))
20
- .sort(compareDefinitionRefs),
21
- },
12
+ target: { kind: 'domain' },
22
13
  };
23
14
  }
24
15
  }
25
- function isTargetList(input) {
26
- return Array.isArray(input);
27
- }
@@ -1,11 +1,13 @@
1
1
  import type { Domain } from '../../domain/model/domain.js';
2
2
  import type { DomainSchema } from '../../schema/model/schema.js';
3
- import type { DomainSchemaInput } from './input.js';
3
+ import type { DomainSchemaInput, EntrypointOf } from './input.js';
4
4
  import type { ResolvedDomainOfInput } from './projection.js';
5
5
  export type { DomainSchemaInput } from './input.js';
6
6
  /** Exact named Schema produced from one authored input. */
7
7
  export interface DefinedSchema<Origin extends string, Resolved extends Domain> extends DomainSchema<Origin, Resolved> {
8
8
  }
9
9
  /** Build and semantically accept one immutable V1 DomainSchema. */
10
- export declare function defineSchema<const Origin extends string, const Input extends DomainSchemaInput>(origin: Origin, input: Input): DefinedSchema<Origin, ResolvedDomainOfInput<Origin, Input>>;
10
+ export declare function defineSchema<const Origin extends string, const Input extends DomainSchemaInput>(origin: Origin, input: Input & {
11
+ readonly entrypoint?: EntrypointOf<Input>;
12
+ }): DefinedSchema<Origin, ResolvedDomainOfInput<Origin, Input>>;
11
13
  export type { ResolvedDomainOfInput } from './projection.js';
@@ -1,5 +1,5 @@
1
1
  import type { DiagnosticCode as LanguageDiagnosticCode } from '../../language/validation/diagnostic.js';
2
- export type BuilderDiagnosticCode = LanguageDiagnosticCode | 'BUILDER_ABSTRACT_POLICY' | 'BUILDER_AMBIGUOUS_OWNERSHIP' | 'BUILDER_AUTO_EVENT_INVALID' | 'BUILDER_AUTO_NESTED' | 'BUILDER_AUTO_SET_INVALID' | 'BUILDER_CALLABLE_AUTH' | 'BUILDER_CALLABLE_PLACEMENT' | 'BUILDER_CALLABLE_POLICY_AUTH' | 'BUILDER_CORE_CLASS' | 'BUILDER_CORE_EDGE' | 'BUILDER_CORE_NODE' | 'BUILDER_CORE_PROPERTY' | 'BUILDER_CORE_REF' | 'BUILDER_DEFINITION' | 'BUILDER_DEPENDENCY_CONFLICT' | 'BUILDER_DEPENDENCY_ALIAS' | 'BUILDER_DEPENDENCY_DIRECT' | 'BUILDER_DUPLICATE_MEMBER' | 'BUILDER_FOREIGN_POLICY' | 'BUILDER_FULL_MATCH_INVALID' | 'BUILDER_FUNCTION' | 'BUILDER_METHOD' | 'BUILDER_PATH_DUPLICATE' | 'BUILDER_PATH_EMPTY' | 'BUILDER_POLICY' | 'BUILDER_POLICY_COMPOSITION' | 'BUILDER_POLICY_CYCLE' | 'BUILDER_POLICY_EMPTY_COMPOSITION' | 'BUILDER_POLICY_EMPTY_EXISTS' | 'BUILDER_POLICY_INPUT' | 'BUILDER_POLICY_REF' | 'BUILDER_POLICY_SELF' | 'BUILDER_REFERENCE_CYCLE' | 'BUILDER_REFERENCE_KIND' | 'BUILDER_REFERENCE_MISSING' | 'BUILDER_UNKNOWN_FIELD' | 'BUILDER_UNOWNED_REFERENCE' | 'BUILDER_VIEW' | 'ZOD_SCHEMA_NOT_LOSSLESS';
2
+ export type BuilderDiagnosticCode = LanguageDiagnosticCode | 'BUILDER_ABSTRACT_POLICY' | 'BUILDER_AMBIGUOUS_OWNERSHIP' | 'BUILDER_AUTO_EVENT_INVALID' | 'BUILDER_AUTO_IMMUTABLE' | 'BUILDER_AUTO_NESTED' | 'BUILDER_AUTO_SET_INVALID' | 'BUILDER_CALLABLE_AUTH' | 'BUILDER_CALLABLE_PLACEMENT' | 'BUILDER_CALLABLE_POLICY_AUTH' | 'BUILDER_CORE_CLASS' | 'BUILDER_CORE_EDGE' | 'BUILDER_CORE_NODE' | 'BUILDER_CORE_PROPERTY' | 'BUILDER_CORE_REF' | 'BUILDER_DEFINITION' | 'BUILDER_DEPENDENCY_CONFLICT' | 'BUILDER_DEPENDENCY_ALIAS' | 'BUILDER_DEPENDENCY_DIRECT' | 'BUILDER_DUPLICATE_MEMBER' | 'BUILDER_FOREIGN_POLICY' | 'BUILDER_FULL_MATCH_INVALID' | 'BUILDER_FUNCTION' | 'BUILDER_METHOD' | 'BUILDER_PATH_DUPLICATE' | 'BUILDER_PATH_EMPTY' | 'BUILDER_POLICY' | 'BUILDER_POLICY_COMPOSITION' | 'BUILDER_POLICY_CYCLE' | 'BUILDER_POLICY_EMPTY_COMPOSITION' | 'BUILDER_POLICY_EMPTY_EXISTS' | 'BUILDER_POLICY_INPUT' | 'BUILDER_POLICY_REF' | 'BUILDER_POLICY_SELF' | 'BUILDER_PROPERTY_IMMUTABLE_INVALID' | 'BUILDER_REFERENCE_CYCLE' | 'BUILDER_REFERENCE_KIND' | 'BUILDER_REFERENCE_MISSING' | 'BUILDER_UNKNOWN_FIELD' | 'BUILDER_UNOWNED_REFERENCE' | 'BUILDER_VIEW' | 'ZOD_SCHEMA_NOT_LOSSLESS';
3
3
  export interface BuilderDiagnostic<out Code extends BuilderDiagnosticCode = BuilderDiagnosticCode> {
4
4
  readonly code: Code;
5
5
  readonly pointer: string;
@@ -1,7 +1,8 @@
1
1
  export declare const AUTHORING: unique symbol;
2
- export type AuthoringKind = 'definition' | 'function' | 'method' | 'callable-input' | 'callable-output' | 'policy' | 'view' | 'core-node' | 'core-edge' | 'property' | 'auto';
2
+ type AuthoringKind = 'definition' | 'function' | 'method' | 'callable-input' | 'callable-output' | 'policy' | 'view' | 'core-node' | 'core-edge' | 'property' | 'auto';
3
3
  export interface AuthoringValue<Kind extends AuthoringKind> {
4
4
  readonly [AUTHORING]: Kind;
5
5
  }
6
6
  export declare function authoringValue<Kind extends AuthoringKind, Value extends object>(kind: Kind, value: Value): Readonly<Value & AuthoringValue<Kind>>;
7
7
  export declare function isAuthoringValue<Kind extends AuthoringKind>(value: unknown, kind: Kind): value is AuthoringValue<Kind> & object;
8
+ export {};
@@ -6,6 +6,10 @@ import type { Policy } from '../policy/authoring.js';
6
6
  import type { View } from '../view/authoring.js';
7
7
  /** Complete authoring input accepted by defineSchema. */
8
8
  export interface DomainSchemaInput {
9
+ /** Display name of the Domain, one trimmed line of 1 to 100 characters. */
10
+ readonly name: string;
11
+ /** Name of the one declared View this Domain opens by default. */
12
+ readonly entrypoint?: string;
9
13
  readonly dependencies?: Readonly<Record<string, DomainSchema<string>>>;
10
14
  readonly classes?: Readonly<Record<string, Class>>;
11
15
  readonly functions?: Readonly<Record<string, Function>>;
@@ -13,3 +17,7 @@ export interface DomainSchemaInput {
13
17
  readonly views?: Readonly<Record<string, View>>;
14
18
  readonly core?: CoreInput;
15
19
  }
20
+ /** An entrypoint can only name one of the Views the same input declares. */
21
+ export type EntrypointOf<Input extends DomainSchemaInput> = Input extends {
22
+ readonly views: infer Views;
23
+ } ? Extract<keyof Views, string> : never;
@@ -0,0 +1,51 @@
1
+ import type * as language from '../../../language/index.js';
2
+ import type { Method, CallableProjection, Function } from '../../callable/authoring.js';
3
+ import type { RecordField, ClassInputOf, AbstractOf } from './identity.js';
4
+ import type { MethodProjection, FunctionProjection } from './model.js';
5
+ type MethodExecutableOf<OwnerAbstract extends boolean, MethodAbstract extends boolean> = MethodAbstract extends false ? true : OwnerAbstract extends false ? true : false;
6
+ type MethodFieldsOf<Value> = RecordField<ClassInputOf<Value>, 'methods'>;
7
+ interface AuthoredMethodEntry<Owner, Name extends string, Value extends Method> {
8
+ readonly owner: Owner;
9
+ readonly name: Name;
10
+ readonly value: Value;
11
+ }
12
+ type OwnMethodEntries<Value, Static extends boolean> = {
13
+ [Name in keyof MethodFieldsOf<Value>]: MethodFieldsOf<Value>[Name] extends infer MethodValue extends Method ? CallableConfig<MethodValue> extends {
14
+ readonly static: true;
15
+ } ? Static extends true ? AuthoredMethodEntry<Value, Extract<Name, string>, MethodValue> : never : Static extends false ? AuthoredMethodEntry<Value, Extract<Name, string>, MethodValue> : never : never;
16
+ }[keyof MethodFieldsOf<Value>];
17
+ type CallableConfig<Value> = Value extends Method<infer Config> ? Config extends CallableProjection ? Config : never : Value extends Function<infer Config> ? Config extends CallableProjection ? Config : never : never;
18
+ type CallableInputValue<Value extends Method | Function> = CallableConfig<Value>['input'];
19
+ type CallableOutputValue<Value extends Method | Function> = CallableConfig<Value>['output'];
20
+ type CallableExecutionOf<Value extends Method | Function> = CallableConfig<Value>['execution'];
21
+ type CallableStaticOf<Value extends Method> = CallableConfig<Value> extends {
22
+ readonly static: true;
23
+ } ? true : false;
24
+ type CallableAbstractOf<Value extends Method> = CallableConfig<Value> extends {
25
+ readonly abstract: infer Abstract extends boolean;
26
+ } ? Abstract : false;
27
+ type CallableAuthOf<Value extends Method | Function> = CallableConfig<Value>['auth'];
28
+ type MethodProjectionOfEntry<Origin extends string, OwnerName extends string, Entry> = Entry extends language.ResolvedMethod ? MethodProjectionOfResolved<Entry> : Entry extends AuthoredMethodEntry<infer Owner, infer Name, infer Value> ? MethodProjection<CallableInputValue<Value>, CallableOutputValue<Value>, CallableStaticOf<Value>, CallableAbstractOf<Value>, CallableAuthOf<Value>, Name, language.MethodKey<Origin, OwnerName, Name>, MethodExecutableOf<AbstractOf<ClassInputOf<Owner>>, CallableAbstractOf<Value>>, CallableExecutionOf<Value>> : never;
29
+ type MethodProjectionOfEntries<Origin extends string, OwnerName extends string, Entries> = Entries extends unknown ? MethodProjectionOfEntry<Origin, OwnerName, Entries> : never;
30
+ type MethodProjectionOfResolved<Value> = Value extends language.ResolvedMethod<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer _Policy, infer Key> & {
31
+ readonly name: infer Name extends string;
32
+ } ? MethodProjection<Input, Output, Static, Abstract, Auth, Name, Key, Value['executable'], Value['execution']> : never;
33
+ /** Capture each Method through its qualified lookup key. */
34
+ export type MethodsOfCollection<Value> = Value extends {
35
+ readonly byKey: infer ByKey extends Readonly<Record<language.MethodKey, language.ResolvedMethod>>;
36
+ } ? MethodProjectionOfResolved<ByKey[keyof ByKey]> : never;
37
+ /** Project the instance Methods declared directly by one Class. */
38
+ export type OwnInstanceMethodProjectionsOf<Origin extends string, Name extends string, Value> = MethodProjectionOfEntries<Origin, Name, OwnMethodEntries<Value, false>>;
39
+ /** Project the static Methods declared directly by one Class. */
40
+ export type OwnStaticMethodProjectionsOf<Origin extends string, Name extends string, Value> = MethodProjectionOfEntries<Origin, Name, OwnMethodEntries<Value, true>>;
41
+ /** Bind an authored Function to its exact Domain coordinates. */
42
+ export type FunctionProjectionOfAuthoring<Origin extends string, Name extends string, Value> = Value extends Function ? FunctionProjection<CallableInputValue<Value>, CallableOutputValue<Value>, CallableAuthOf<Value>, language.FunctionRef<Name> & {
43
+ readonly origin: Origin;
44
+ }, language.DefinitionKey<Origin, 'function', Name>, CallableExecutionOf<Value>> : never;
45
+ /** Restore a resolved Function while preserving its execution modifier. */
46
+ export type ResolvedFunctionOfProjection<Value extends FunctionProjection> = Value extends FunctionProjection<infer Input, infer Output, infer Auth, infer Ref, infer Key, infer Execution> ? language.ResolvedFunction<Input, Output, Auth, language.PolicyCheckExpression> & {
47
+ readonly ref: Ref;
48
+ readonly key: Key;
49
+ readonly execution: Execution;
50
+ } : never;
51
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,89 @@
1
+ import type * as language from '../../../language/index.js';
2
+ import type { NodeClass, DirectedEdgeClass, UndirectedEdgeClass, ClassReferenceProjection, Class, ProjectionOfClass } from '../../class/authoring.js';
3
+ import type { DomainSchemaInput } from '../input.js';
4
+ import type { OwnInstanceMethodProjectionsOf, OwnStaticMethodProjectionsOf } from './callable.js';
5
+ import type { AbstractOf, ConstraintsOf, ResolveLazy, LocalNameOfReference, ClassesInputOf, LocalNameOf } from './identity.js';
6
+ import type { ClassProjection } from './model.js';
7
+ import type { EffectivePropertyProjectionsOf, OwnPropertyProjectionsOf } from './property.js';
8
+ import type { ClassProjectionOfResolved, ExactClass } from './resolved-class.js';
9
+ type ProjectedClassDefinition<Origin extends string, Name extends string, Value> = Value extends NodeClass<infer Config> ? language.NodeClassDefinition & {
10
+ readonly ref: language.ClassRef<Name> & {
11
+ readonly origin: Origin;
12
+ };
13
+ readonly kind: 'node';
14
+ readonly abstract: AbstractOf<Config>;
15
+ } : Value extends DirectedEdgeClass<infer Input> ? Input extends {
16
+ readonly source: infer Source extends {
17
+ readonly as: string;
18
+ readonly outgoing: language.EdgeCount;
19
+ };
20
+ readonly target: infer Target extends {
21
+ readonly as: string;
22
+ readonly incoming: language.EdgeCount;
23
+ };
24
+ } ? language.EdgeClassDefinition & {
25
+ readonly ref: language.ClassRef<Name> & {
26
+ readonly origin: Origin;
27
+ };
28
+ readonly kind: 'edge';
29
+ readonly abstract: AbstractOf<Input>;
30
+ readonly orientation: 'directed';
31
+ readonly endpoints: {
32
+ readonly source: language.DirectedSourceEndpoint & {
33
+ readonly role: Source['as'];
34
+ readonly outgoing: Source['outgoing'];
35
+ };
36
+ readonly target: language.DirectedTargetEndpoint & {
37
+ readonly role: Target['as'];
38
+ readonly incoming: Target['incoming'];
39
+ };
40
+ };
41
+ readonly constraints: language.DirectedEdgeConstraints & ConstraintsOf<Input>;
42
+ } : never : Value extends UndirectedEdgeClass<infer Input> ? Input extends {
43
+ readonly endpoints: readonly [
44
+ infer First extends {
45
+ readonly as: string;
46
+ readonly incident: language.EdgeCount;
47
+ },
48
+ infer Second extends {
49
+ readonly as: string;
50
+ readonly incident: language.EdgeCount;
51
+ }
52
+ ];
53
+ } ? language.EdgeClassDefinition & {
54
+ readonly ref: language.ClassRef<Name> & {
55
+ readonly origin: Origin;
56
+ };
57
+ readonly kind: 'edge';
58
+ readonly abstract: AbstractOf<Input>;
59
+ readonly orientation: 'undirected';
60
+ readonly endpoints: readonly [
61
+ language.IncidentEndpoint & {
62
+ readonly role: First['as'];
63
+ readonly incident: First['incident'];
64
+ },
65
+ language.IncidentEndpoint & {
66
+ readonly role: Second['as'];
67
+ readonly incident: Second['incident'];
68
+ }
69
+ ];
70
+ readonly constraints: language.UndirectedEdgeConstraints & ConstraintsOf<Input>;
71
+ } : never : never;
72
+ type ParentInputsOfConfig<Config> = Config extends {
73
+ readonly extends?: infer Parents extends readonly unknown[];
74
+ } ? Parents : readonly [];
75
+ type ParentClassProjectionOf<Origin extends string, Parent, Root extends DomainSchemaInput, Seen> = ResolveLazy<Parent> extends infer Resolved ? Resolved extends ClassReferenceProjection<infer _Kind, infer _Identity, infer _Properties, infer _InstanceMethods, infer _StaticMethods> ? LocalNameOfReference<Root, Resolved> extends infer Name extends string ? Name extends keyof ClassesInputOf<Root> ? ShallowClassProjectionOfAuthoring<Origin, Name, Extract<ClassesInputOf<Root>[Name], Class>, Root> : never : never : Resolved extends ClassProjection ? Resolved : Resolved extends language.AnyResolvedClass ? ClassProjectionOfResolved<ExactClass<Resolved>> : LocalNameOf<Root, Resolved> extends infer Name extends string ? Resolved extends Seen ? never : ClassProjectionOfAuthoring<Origin, Name, Resolved, Root, Seen | Resolved> : never : never;
76
+ type ParentClassProjectionTuple<Origin extends string, Parents extends readonly unknown[], Root extends DomainSchemaInput, Seen> = Parents extends readonly [] ? readonly [] : Parents extends readonly [infer Parent, ...infer Rest] ? readonly [
77
+ ParentClassProjectionOf<Origin, Parent, Root, Seen>,
78
+ ...ParentClassProjectionTuple<Origin, Rest, Root, Seen>
79
+ ] : readonly ParentClassProjectionOf<Origin, Parents[number], Root, Seen>[];
80
+ /** A shallow parent retains member contracts without expanding another parent tuple. */
81
+ type ShallowClassProjectionOfAuthoring<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput> = ClassProjectionWithParents<Origin, Name, Value, Root, readonly language.AnyResolvedClass[]>;
82
+ /** Project each authored Class independently before computing its parent tuple. */
83
+ export type ClassProjectionOfAuthoring<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput, Seen = Value> = Value extends Class ? ClassProjectionWithParents<Origin, Name, Value, Root, ParentClassProjectionTuple<Origin, ParentInputsOfConfig<ProjectionOfClass<Extract<Value, Class>>>, Root, Seen>> : never;
84
+ type ClassProjectionWithParents<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput, Parents extends readonly unknown[]> = Value extends NodeClass<infer _Config> ? ClassProjection<'node', Extract<ProjectedClassDefinition<Origin, Name, Value>, language.NodeClassDefinition>, language.ClassRef<Name> & {
85
+ readonly origin: Origin;
86
+ }, language.DefinitionKey<Origin, 'class', Name>, Parents, EffectivePropertyProjectionsOf<Origin, Name, Value, Root>, OwnInstanceMethodProjectionsOf<Origin, Name, Value>, OwnStaticMethodProjectionsOf<Origin, Name, Value>, OwnPropertyProjectionsOf<Origin, Name, Value>, OwnInstanceMethodProjectionsOf<Origin, Name, Value>, OwnStaticMethodProjectionsOf<Origin, Name, Value>> : Value extends DirectedEdgeClass | UndirectedEdgeClass ? ClassProjection<'edge', Extract<ProjectedClassDefinition<Origin, Name, Value>, language.EdgeClassDefinition>, language.ClassRef<Name> & {
87
+ readonly origin: Origin;
88
+ }, language.DefinitionKey<Origin, 'class', Name>, Parents, EffectivePropertyProjectionsOf<Origin, Name, Value, Root>, never, never, OwnPropertyProjectionsOf<Origin, Name, Value>, never, never> : never;
89
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import type * as language from '../../../language/index.js';
2
+ import type { BlobReceipt } from '../../../language/value/model/blob.js';
3
+ import type { Class, AuthoredPropertyProjection } from '../../class/authoring.js';
4
+ import type { ResolveLazy, IsMultiple } from './identity.js';
5
+ import type { EffectivePropertyEntriesOfClass } from './property.js';
6
+ /** Derive required, optional and forbidden Core Property inputs by name. */
7
+ export type CoreNamedPropertyInput<ClassValue> = ResolveLazy<ClassValue> extends infer Resolved ? Resolved extends Class ? CorePropertyInputFromAuthoredProjections<EffectivePropertyEntriesOfClass<Resolved>> : Resolved extends language.ResolvedClass ? language.PropertyInputOf<Resolved> : never : never;
8
+ /** Allow exact named Core inputs or canonical qualified Property keys. */
9
+ export type CorePropertyInput<ClassValue> = CoreNamedPropertyInput<ClassValue> | Readonly<Record<language.PropertyKey, language.PropertyValue>>;
10
+ type AuthoredProjectionName<Entry> = Entry extends AuthoredPropertyProjection<unknown, unknown, boolean, infer Name> ? Name : never;
11
+ type AuthoredProjectionInput<Entry> = Entry extends AuthoredPropertyProjection<infer Input, unknown, boolean, string> ? Input : never;
12
+ type CoreProjectionInput<Entry> = Entry extends AuthoredPropertyProjection<infer Input, infer Output, boolean, string> ? Input extends BlobReceipt ? Output : Input : never;
13
+ type AuthoredProjectionRequired<Entry> = Entry extends AuthoredPropertyProjection<unknown, unknown, infer Required, string> ? Required : false;
14
+ type UniqueAuthoredProjections<Entries> = Entries extends unknown ? IsMultiple<Extract<Entries, {
15
+ readonly name: AuthoredProjectionName<Entries>;
16
+ }>> extends true ? never : Entries : never;
17
+ type CoreAuthoredProjections<Entries> = UniqueAuthoredProjections<Entries> extends infer Entry ? Entry extends unknown ? [AuthoredProjectionInput<Entry>] extends [never] ? never : Entry : never : never;
18
+ type RequiredAuthoredPropertyNames<Entries> = CoreAuthoredProjections<Entries> extends infer Entry ? Entry extends unknown ? AuthoredProjectionRequired<Entry> extends true ? AuthoredProjectionName<Entry> : never : never : never;
19
+ type OptionalAuthoredPropertyNames<Entries> = Exclude<AuthoredProjectionName<CoreAuthoredProjections<Entries>>, RequiredAuthoredPropertyNames<Entries>>;
20
+ type AutomaticAuthoredPropertyNames<Entries> = UniqueAuthoredProjections<Entries> extends infer Entry ? Entry extends unknown ? [AuthoredProjectionInput<Entry>] extends [never] ? AuthoredProjectionName<Entry> : never : never : never;
21
+ type CorePropertyInputFromAuthoredProjections<Entries> = Readonly<{
22
+ [Name in RequiredAuthoredPropertyNames<Entries>]: CoreProjectionInput<Extract<CoreAuthoredProjections<Entries>, {
23
+ readonly name: Name;
24
+ }>>;
25
+ } & {
26
+ [Name in OptionalAuthoredPropertyNames<Entries>]?: CoreProjectionInput<Extract<CoreAuthoredProjections<Entries>, {
27
+ readonly name: Name;
28
+ }>>;
29
+ } & {
30
+ [Name in AutomaticAuthoredPropertyNames<Entries>]?: never;
31
+ }>;
32
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ import type { Revision } from '../../../addressing/index.js';
2
+ import type * as domain from '../../../domain/model/domain.js';
3
+ import type * as language from '../../../language/index.js';
4
+ import type { DomainSchema, DomainOfSchema } from '../../../schema/model/schema.js';
5
+ import type { DomainSchemaInput } from '../input.js';
6
+ import type { FunctionProjectionOfAuthoring, ResolvedFunctionOfProjection } from './callable.js';
7
+ import type { ClassProjectionOfAuthoring } from './class.js';
8
+ import type { ClassesInputOf, RecordField } from './identity.js';
9
+ import type { DomainProjection, ClassProjection, FunctionProjection } from './model.js';
10
+ import type { ResolvedClassOfProjection } from './resolved-class.js';
11
+ type ProjectionOfInput<Origin extends string, Input extends DomainSchemaInput> = DomainProjection<{
12
+ readonly [Name in keyof ClassesInputOf<Input>]: ClassProjectionOfAuthoring<Origin, Extract<Name, string>, ClassesInputOf<Input>[Name], Input>;
13
+ }, {
14
+ readonly [Name in keyof FunctionsInputOf<Input>]: FunctionProjectionOfAuthoring<Origin, Extract<Name, string>, FunctionsInputOf<Input>[Name]>;
15
+ }, {
16
+ readonly [Name in keyof PoliciesInputOf<Input>]: language.ResolvedPolicy & {
17
+ readonly ref: language.PolicyRef<Extract<Name, string>> & {
18
+ readonly origin: Origin;
19
+ };
20
+ readonly key: language.DefinitionKey<Origin, 'policy', Extract<Name, string>>;
21
+ };
22
+ }, {
23
+ readonly [Name in keyof ViewsInputOf<Input>]: language.ResolvedView & {
24
+ readonly ref: language.ViewRef<Extract<Name, string>> & {
25
+ readonly origin: Origin;
26
+ };
27
+ readonly key: language.DefinitionKey<Origin, 'view', Extract<Name, string>>;
28
+ };
29
+ }, {
30
+ readonly [Name in keyof CoreNodesInputOf<Input>]: language.ResolvedCoreDefinition & {
31
+ readonly ref: language.CoreRef<Extract<Name, string>> & {
32
+ readonly origin: Origin;
33
+ };
34
+ readonly key: language.DefinitionKey<Origin, 'core', Extract<Name, string>>;
35
+ };
36
+ }, DependencySchemasOf<Input>>;
37
+ interface DomainOfProjection<Projection extends DomainProjection> extends domain.Domain<{
38
+ readonly [Name in keyof Projection['classes']]: ResolvedClassOfProjection<Extract<Projection['classes'][Name], ClassProjection>>;
39
+ }, {
40
+ readonly [Name in keyof Projection['functions']]: ResolvedFunctionOfProjection<Extract<Projection['functions'][Name], FunctionProjection>>;
41
+ }, Extract<Projection['policies'], Readonly<Record<string, language.ResolvedPolicy>>>, Extract<Projection['views'], Readonly<Record<string, language.ResolvedView>>>, Extract<Projection['core'], Readonly<Record<string, language.ResolvedCoreDefinition>>>, Revision> {
42
+ readonly dependencies: domain.DependencyDomainNamespace<{
43
+ readonly [Alias in keyof Projection['dependencies']]: Projection['dependencies'][Alias] extends infer Dependency extends DomainSchema ? DomainOfSchema<Dependency> : never;
44
+ }>;
45
+ }
46
+ /** Resolve compact authored witnesses into the exact public Domain type. */
47
+ export type ResolvedDomainOfInput<Origin extends string, Input extends DomainSchemaInput> = DomainOfProjection<ProjectionOfInput<Origin, Input>>;
48
+ type DependenciesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'dependencies'>;
49
+ type DependencySchemasOf<Input extends DomainSchemaInput> = {
50
+ readonly [Alias in keyof DependenciesInputOf<Input>]: DependenciesInputOf<Input>[Alias];
51
+ };
52
+ type FunctionsInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'functions'>;
53
+ type PoliciesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'policies'>;
54
+ type ViewsInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'views'>;
55
+ type CoreInputOf<Input extends DomainSchemaInput> = Input extends {
56
+ readonly core?: infer CoreValue;
57
+ } ? NonNullable<CoreValue> : Record<never, never>;
58
+ type CoreNodesInputOf<Input extends DomainSchemaInput> = RecordField<CoreInputOf<Input>, 'nodes'>;
59
+ export {};
@@ -0,0 +1 @@
1
+ export {};