@ontrails/core 1.0.0-beta.5 → 1.0.0-beta.7

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,3 +1,3 @@
1
1
  $ oxlint ./src
2
2
  Found 0 warnings and 0 errors.
3
- Finished in 21ms on 60 files with 93 rules using 24 threads.
3
+ Finished in 23ms on 60 files with 93 rules using 24 threads.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ontrails/core
2
2
 
3
+ ## 1.0.0-beta.7
4
+
5
+ ## 1.0.0-beta.6
6
+
7
+ ### Patch Changes
8
+
9
+ - Fix Codex review findings on type-utils and follow-declarations.
10
+
11
+ **core**: `inputOf()`/`outputOf()` now preserve the exact Zod schema subtype instead of widening to `z.ZodType`.
12
+
13
+ **warden**: `follow-declarations` rule now recognizes single-object trail overload, detects any context parameter name (not just `ctx`), matches destructured `follow()` calls, resolves const identifiers in `follow` arrays, and restricts run body extraction to top-level config properties.
14
+
3
15
  ## 1.0.0-beta.5
4
16
 
5
17
  ### Minor Changes
@@ -1,14 +1,13 @@
1
1
  /**
2
2
  * Type utilities for extracting input/output types from trails.
3
3
  */
4
- import type { z } from 'zod';
5
4
  import type { AnyTrail, Trail } from './trail.js';
6
5
  /** Extract the input type from a Trail. */
7
6
  export type TrailInput<T extends AnyTrail> = T extends Trail<infer I, any> ? I : never;
8
7
  /** Extract the output type from a Trail. */
9
8
  export type TrailOutput<T extends AnyTrail> = T extends Trail<any, infer O> ? O : never;
10
- /** Get the input Zod schema from a trail. */
11
- export declare const inputOf: <I, O>(trail: Trail<I, O>) => z.ZodType<I>;
12
- /** Get the output Zod schema from a trail, if defined. */
13
- export declare const outputOf: <I, O>(trail: Trail<I, O>) => z.ZodType<O> | undefined;
9
+ /** Get the input Zod schema from a trail, preserving the specific schema type. */
10
+ export declare const inputOf: <T extends AnyTrail>(trail: T) => T["input"];
11
+ /** Get the output Zod schema from a trail, if defined, preserving the specific schema type. */
12
+ export declare const outputOf: <T extends AnyTrail>(trail: T) => T["output"];
14
13
  //# sourceMappingURL=type-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-utils.d.ts","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAQlD,2CAA2C;AAC3C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,QAAQ,IACvC,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5C,4CAA4C;AAC5C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,IACxC,CAAC,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAQ5C,6CAA6C;AAC7C,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAgB,CAAC;AAE/E,0DAA0D;AAC1D,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SACrD,CAAC"}
1
+ {"version":3,"file":"type-utils.d.ts","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAQlD,2CAA2C;AAC3C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,QAAQ,IACvC,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5C,4CAA4C;AAC5C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,IACxC,CAAC,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAQ5C,kFAAkF;AAClF,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,QAAQ,EAAE,OAAO,CAAC,KAAG,CAAC,CAAC,OAAO,CACnD,CAAC;AAEd,+FAA+F;AAC/F,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,QAAQ,EAAE,OAAO,CAAC,KAAG,CAAC,CAAC,QAAQ,CACpD,CAAC"}
@@ -5,8 +5,8 @@
5
5
  // ---------------------------------------------------------------------------
6
6
  // Runtime schema accessors
7
7
  // ---------------------------------------------------------------------------
8
- /** Get the input Zod schema from a trail. */
8
+ /** Get the input Zod schema from a trail, preserving the specific schema type. */
9
9
  export const inputOf = (trail) => trail.input;
10
- /** Get the output Zod schema from a trail, if defined. */
10
+ /** Get the output Zod schema from a trail, if defined, preserving the specific schema type. */
11
11
  export const outputOf = (trail) => trail.output;
12
12
  //# sourceMappingURL=type-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoBH,mCAAmC;AAEnC,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAO,KAAkB,EAAgB,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;AAE/E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAO,KAAkB,EAA4B,EAAE,CAC7E,KAAK,CAAC,MAAM,CAAC"}
1
+ {"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,mCAAmC;AAEnC,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E,kFAAkF;AAClF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAqB,KAAQ,EAAc,EAAE,CAClE,KAAK,CAAC,KAAK,CAAC;AAEd,+FAA+F;AAC/F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAqB,KAAQ,EAAe,EAAE,CACpE,KAAK,CAAC,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ontrails/core",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -30,6 +30,13 @@ describe('type-utils', () => {
30
30
  name: 'Alice',
31
31
  });
32
32
  });
33
+
34
+ test('preserves specific schema type so .shape is accessible', () => {
35
+ const schema = inputOf(greetTrail);
36
+ // .shape is only available on z.ZodObject, not the broader z.ZodType
37
+ expect(schema.shape).toBeDefined();
38
+ expect(schema.shape.name).toBeDefined();
39
+ });
33
40
  });
34
41
 
35
42
  describe('outputOf', () => {
package/src/type-utils.ts CHANGED
@@ -2,8 +2,6 @@
2
2
  * Type utilities for extracting input/output types from trails.
3
3
  */
4
4
 
5
- import type { z } from 'zod';
6
-
7
5
  import type { AnyTrail, Trail } from './trail.js';
8
6
 
9
7
  // ---------------------------------------------------------------------------
@@ -26,9 +24,10 @@ export type TrailOutput<T extends AnyTrail> =
26
24
  // Runtime schema accessors
27
25
  // ---------------------------------------------------------------------------
28
26
 
29
- /** Get the input Zod schema from a trail. */
30
- export const inputOf = <I, O>(trail: Trail<I, O>): z.ZodType<I> => trail.input;
27
+ /** Get the input Zod schema from a trail, preserving the specific schema type. */
28
+ export const inputOf = <T extends AnyTrail>(trail: T): T['input'] =>
29
+ trail.input;
31
30
 
32
- /** Get the output Zod schema from a trail, if defined. */
33
- export const outputOf = <I, O>(trail: Trail<I, O>): z.ZodType<O> | undefined =>
31
+ /** Get the output Zod schema from a trail, if defined, preserving the specific schema type. */
32
+ export const outputOf = <T extends AnyTrail>(trail: T): T['output'] =>
34
33
  trail.output;