@astrale-os/kernel-dsl 1.0.0-beta.30 → 1.0.0-beta.31

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.
@@ -109,7 +109,7 @@ function programValidation(programs, properties, propertyOrdering, callables) {
109
109
  : { fields: Object.freeze(Object.keys(callable.fields)) }),
110
110
  validateInput: (value, options) => validateValueProgram(input, value, [input.root], options),
111
111
  validateInputField: (field, value) => validateInputField(input, callable.fields, field, value),
112
- validateOutput: (value) => output === undefined ? [] : validateValueProgram(output, value),
112
+ validateOutput: (value, options) => output === undefined ? [] : validateValueProgram(output, value, [output.root], options),
113
113
  }));
114
114
  }
115
115
  return { properties: propertyValidation, callables: callableValidation };
@@ -35,5 +35,9 @@ export interface CallableValidation {
35
35
  readonly fields?: readonly string[];
36
36
  validateInput(input: unknown, options?: StructuralOptions): readonly Diagnostic[];
37
37
  validateInputField(field: string, input: unknown): readonly Diagnostic[];
38
- validateOutput(output: unknown): readonly Diagnostic[];
38
+ /**
39
+ * The issues of `output` against the callable's output schema, `options` overriding the portable
40
+ * limits it is admitted under: a value judged for size in another form is held to the schema alone.
41
+ */
42
+ validateOutput(output: unknown, options?: StructuralOptions): readonly Diagnostic[];
39
43
  }
@@ -43,7 +43,11 @@ export interface ResolvedMethod<out Input = unknown, out Output = unknown, out S
43
43
  */
44
44
  validateInput(input: unknown, options?: StructuralOptions): readonly Diagnostic[];
45
45
  validateInputField(field: string, input: unknown): readonly Diagnostic[];
46
- validateOutput(output: unknown): readonly Diagnostic[];
46
+ /**
47
+ * The issues of `output` against the callable's output schema, `options` overriding the portable
48
+ * limits it is admitted under: a value judged for size in another form is held to the schema alone.
49
+ */
50
+ validateOutput(output: unknown, options?: StructuralOptions): readonly Diagnostic[];
47
51
  readonly __input?: Input;
48
52
  readonly __output?: Output;
49
53
  }
@@ -73,7 +77,11 @@ export interface ResolvedFunction<out Input = unknown, out Output = unknown, out
73
77
  */
74
78
  validateInput(input: unknown, options?: StructuralOptions): readonly Diagnostic[];
75
79
  validateInputField(field: string, input: unknown): readonly Diagnostic[];
76
- validateOutput(output: unknown): readonly Diagnostic[];
80
+ /**
81
+ * The issues of `output` against the callable's output schema, `options` overriding the portable
82
+ * limits it is admitted under: a value judged for size in another form is held to the schema alone.
83
+ */
84
+ validateOutput(output: unknown, options?: StructuralOptions): readonly Diagnostic[];
77
85
  readonly __input?: Input;
78
86
  readonly __output?: Output;
79
87
  }
@@ -11,6 +11,6 @@ import { type PatternPool } from './preparation.js';
11
11
  * resolution or dynamic source generation; patterns use the portable executor.
12
12
  * `format` remains annotation-only; the graph NodePath codec performs its separate locator check.
13
13
  */
14
- export declare function validateJsonInstance(schema: JsonSchema, value: unknown, registry: ValueSchemaRegistry, pointer?: string, patterns?: PatternPool): Diagnostic[];
14
+ export declare function validateJsonInstance(schema: JsonSchema, value: unknown, registry: ValueSchemaRegistry, pointer?: string, patterns?: PatternPool, options?: StructuralOptions): Diagnostic[];
15
15
  /** Validate with the exact preparation already retained by a source-resolved Property or Callable. */
16
16
  export declare function validatePreparedInstance(compiled: CompiledInstanceSchema, value: unknown, options?: StructuralOptions): Diagnostic[];
@@ -11,8 +11,8 @@ const validatorCache = new WeakMap();
11
11
  * resolution or dynamic source generation; patterns use the portable executor.
12
12
  * `format` remains annotation-only; the graph NodePath codec performs its separate locator check.
13
13
  */
14
- export function validateJsonInstance(schema, value, registry, pointer = '', patterns) {
15
- const accepted = acceptInstance(value, pointer);
14
+ export function validateJsonInstance(schema, value, registry, pointer = '', patterns, options) {
15
+ const accepted = acceptInstance(value, pointer, options);
16
16
  if ('refusal' in accepted)
17
17
  return [accepted.refusal];
18
18
  const prepared = preparedInstanceValidator(schema, registry, pointer, patterns);
@@ -98,7 +98,9 @@ export function callableValidation(input, output, registry, patterns) {
98
98
  ...(fields === undefined ? {} : { fields: Object.freeze(Object.keys(fields)) }),
99
99
  validateInput: (value, options) => validatePreparedInstance(prepared.value, value, options),
100
100
  validateInputField: (field, value) => validateInputField(inputProgram, fields, field, value),
101
- validateOutput: (value) => output === undefined ? [] : validateJsonInstance(output, value, registry, '', patterns),
101
+ validateOutput: (value, options) => output === undefined
102
+ ? []
103
+ : validateJsonInstance(output, value, registry, '', patterns, options),
102
104
  });
103
105
  }
104
106
  function definitionsOf(schema) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-dsl",
3
- "version": "1.0.0-beta.30",
3
+ "version": "1.0.0-beta.31",
4
4
  "description": "Astrale Kernel DSL - Schema authoring, inference, and IR serialization",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {