@ontrails/http 1.0.0-beta.13 → 1.0.0-beta.15

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 39ms on 6 files with 93 rules using 24 threads.
3
+ Finished in 67ms on 4 files with 93 rules using 24 threads.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @ontrails/http
2
2
 
3
+ ## 1.0.0-beta.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [4ad6b25]
8
+ - @ontrails/core@1.0.0-beta.15
9
+
10
+ ## 1.0.0-beta.14
11
+
12
+ ### Minor Changes
13
+
14
+ - 69057e9: Add hierarchical CLI command trees and structured input, enforce established-only topo exports across trailheads, move developer topo and tracker state onto shared `trails.db` with pins and maintenance flows, and ship schema-derived stores through `@ontrails/store` and its Drizzle runtime.
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [69057e9]
19
+ - @ontrails/core@1.0.0-beta.14
20
+
3
21
  ## 1.0.0-beta.13
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # @ontrails/http
2
2
 
3
- HTTP trailhead connector. One `trailhead()` call turns a topo into a Hono-based HTTP server with routes, input validation, and error mapping -- all derived from the trail contracts.
3
+ Framework-agnostic HTTP route derivation for Trails. Pair this package with `@ontrails/hono` when you want the Hono surface connector.
4
4
 
5
5
  ## Usage
6
6
 
7
7
  ```typescript
8
8
  import { trail, topo, Result } from '@ontrails/core';
9
- import { trailhead } from '@ontrails/http/hono';
9
+ import { surface } from '@ontrails/hono';
10
10
  import { z } from 'zod';
11
11
 
12
12
  const greet = trail('greet', {
@@ -16,8 +16,8 @@ const greet = trail('greet', {
16
16
  blaze: (input) => Result.ok({ message: `Hello, ${input.name}!` }),
17
17
  });
18
18
 
19
- const app = topo('myapp', { greet });
20
- await trailhead(app, { port: 3000 });
19
+ const graph = topo('myapp', { greet });
20
+ await surface(graph, { port: 3000 });
21
21
  ```
22
22
 
23
23
  This starts a Hono-based HTTP server. The `greet` trail becomes `GET /greet?name=...` because its `intent` is `'read'`.
@@ -25,23 +25,22 @@ This starts a Hono-based HTTP server. The `greet` trail becomes `GET /greet?name
25
25
  For more control, build the routes yourself:
26
26
 
27
27
  ```typescript
28
- import { buildHttpRoutes } from '@ontrails/http';
28
+ import { deriveHttpRoutes } from '@ontrails/http';
29
29
 
30
- const result = buildHttpRoutes(app);
30
+ const result = deriveHttpRoutes(graph);
31
31
  if (result.isErr()) throw result.error; // ValidationError on route collision
32
32
  for (const route of result.value) {
33
33
  console.log(`${route.method} ${route.path} → ${route.trailId}`);
34
34
  }
35
35
  ```
36
36
 
37
- `buildHttpRoutes` returns `Result<HttpRouteDefinition[], Error>` rather than a bare array. It returns `Result.err(ValidationError)` if two trails derive the same `(method, path)` pair.
37
+ `deriveHttpRoutes` returns `Result<HttpRouteDefinition[], Error>` rather than a bare array. It returns `Result.err(ValidationError)` if two trails derive the same `(method, path)` pair.
38
38
 
39
39
  ## API
40
40
 
41
41
  | Export | What it does |
42
42
  | --- | --- |
43
- | `buildHttpRoutes(app, options?)` | Build framework-agnostic route definitions from a topo |
44
- | `trailhead(app, options?)` (`@ontrails/http/hono`) | Start a Hono HTTP server with all trails as routes |
43
+ | `deriveHttpRoutes(graph, options?)` | Build framework-agnostic route definitions from a topo |
45
44
 
46
45
  ## Route derivation
47
46
 
@@ -58,11 +57,24 @@ Trail IDs map to paths: `entity.show` becomes `/entity/show`. Dots become slashe
58
57
 
59
58
  ## Collision detection
60
59
 
61
- `buildHttpRoutes` detects when two trails would produce the same `(method, path)` pair and returns `Result.err(ValidationError)` describing both trail IDs. The `trailhead()` Hono connector throws on collision.
60
+ `deriveHttpRoutes` detects when two trails would produce the same `(method, path)` pair and returns `Result.err(ValidationError)` describing both trail IDs. The `surface()` helper from `@ontrails/hono` throws on collision.
62
61
 
63
- ## Provision resolution
62
+ ## Resource resolution
64
63
 
65
- Declared provisions on each trail are resolved into the context before the implementation runs.
64
+ Declared resources on each trail are resolved into the context before the implementation runs.
65
+
66
+ ## Filtering
67
+
68
+ ```typescript
69
+ const result = deriveHttpRoutes(graph, {
70
+ include: ['entity.**'],
71
+ exclude: ['dev.**'],
72
+ });
73
+ ```
74
+
75
+ `*` matches one dotted segment and `**` matches any depth. Trails declared
76
+ with `visibility: 'internal'` stay hidden unless you include their exact trail
77
+ ID intentionally.
66
78
 
67
79
  ## AbortSignal propagation
68
80
 
@@ -70,7 +82,7 @@ The `execute` function on each `HttpRouteDefinition` accepts an optional `abortS
70
82
 
71
83
  ## `HttpRouteDefinition`
72
84
 
73
- Each route definition produced by `buildHttpRoutes` includes:
85
+ Each route definition produced by `deriveHttpRoutes` includes:
74
86
 
75
87
  | Field | Type | What it is |
76
88
  | --- | --- | --- |
@@ -79,10 +91,22 @@ Each route definition produced by `buildHttpRoutes` includes:
79
91
  | `trailId` | `string` | The trail ID this route was derived from |
80
92
  | `inputSource` | `'query' \| 'body'` | Where to read input |
81
93
  | `trail` | `Trail` | The original trail definition |
82
- | `execute` | `(input, requestId?, abortSignal?) => Promise<Result>` | Validates, gates, and runs the implementation |
94
+ | `execute` | `(input, requestId?, abortSignal?) => Promise<Result>` | Validates, layers, and runs the implementation |
95
+
96
+ For GET routes on the Hono surface, repeated query keys are passed through as
97
+ arrays (`?tag=one&tag=two` -> `{ tag: ['one', 'two'] }`) while a single
98
+ occurrence stays a scalar string. The connector does not coerce singleton query
99
+ values into arrays.
83
100
 
84
101
  ## Installation
85
102
 
86
103
  ```bash
87
- bun add @ontrails/http hono
104
+ bun add @ontrails/http @ontrails/hono
88
105
  ```
106
+
107
+ ## Migration
108
+
109
+ Hono integration now lives in `@ontrails/hono`.
110
+
111
+ - Replace `import { trailhead } from '@ontrails/http/hono'` with `import { surface } from '@ontrails/hono'`
112
+ - Keep `deriveHttpRoutes()` and the route model imports on `@ontrails/http`
package/dist/build.d.ts CHANGED
@@ -2,18 +2,23 @@
2
2
  * Build framework-agnostic HTTP route definitions from a Trails topo.
3
3
  *
4
4
  * Each route definition describes the path, method, input source, and an
5
- * `execute` function that validates input, composes gates, and runs the
5
+ * `execute` function that validates input, composes layers, and runs the
6
6
  * implementation -- all without referencing any HTTP framework types.
7
7
  */
8
8
  import { Result } from '@ontrails/core';
9
- import type { Gate, ProvisionOverrideMap, Topo, Trail, TrailContextInit } from '@ontrails/core';
10
- export interface BuildHttpRoutesOptions {
9
+ import type { Intent, Layer, ResourceOverrideMap, Topo, Trail, TrailContextInit } from '@ontrails/core';
10
+ export interface DeriveHttpRoutesOptions {
11
11
  readonly basePath?: string | undefined;
12
- /** Config values for provisions that declare a `config` schema, keyed by provision ID. */
12
+ /** Config values for resources that declare a `config` schema, keyed by resource ID. */
13
13
  readonly configValues?: Readonly<Record<string, Record<string, unknown>>> | undefined;
14
14
  readonly createContext?: (() => TrailContextInit | Promise<TrailContextInit>) | undefined;
15
- readonly gates?: readonly Gate[] | undefined;
16
- readonly provisions?: ProvisionOverrideMap | undefined;
15
+ readonly exclude?: readonly string[] | undefined;
16
+ readonly include?: readonly string[] | undefined;
17
+ readonly intent?: readonly Intent[] | undefined;
18
+ readonly layers?: readonly Layer[] | undefined;
19
+ readonly resources?: ResourceOverrideMap | undefined;
20
+ /** Set to `false` to skip topo validation while building routes. */
21
+ readonly validate?: boolean | undefined;
17
22
  }
18
23
  export type HttpMethod = 'GET' | 'POST' | 'DELETE';
19
24
  /** Input source derived from the HTTP method. */
@@ -23,9 +28,9 @@ export interface HttpRouteDefinition {
23
28
  readonly path: string;
24
29
  readonly trailId: string;
25
30
  readonly inputSource: InputSource;
26
- readonly trail: Trail<unknown, unknown>;
31
+ readonly trail: Trail<unknown, unknown, unknown>;
27
32
  /**
28
- * Validate input, compose gates, and execute the trail implementation.
33
+ * Validate input, compose layers, and execute the trail implementation.
29
34
  *
30
35
  * The caller is responsible for parsing raw input from the request and
31
36
  * mapping the Result to an HTTP response. This function is framework-agnostic.
@@ -43,10 +48,10 @@ export interface HttpRouteDefinition {
43
48
  * - An HTTP method derived from intent (read -> GET, write -> POST, destroy -> DELETE)
44
49
  * - A path derived from the trail ID (dots become slashes)
45
50
  * - An input source derived from the method (GET -> query, others -> body)
46
- * - An `execute` function that validates, gates, and runs the implementation
51
+ * - An `execute` function that validates, layers, and runs the implementation
47
52
  *
48
53
  * Returns `Result.err(ValidationError)` if two trails derive the same
49
54
  * (method, path) pair. Returns `Result.ok(routes)` on success.
50
55
  */
51
- export declare const buildHttpRoutes: (app: Topo, options?: BuildHttpRoutesOptions) => Result<HttpRouteDefinition[], Error>;
56
+ export declare const deriveHttpRoutes: (graph: Topo, options?: DeriveHttpRoutesOptions) => Result<HttpRouteDefinition[], Error>;
52
57
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EAIP,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,IAAI,EACJ,oBAAoB,EACpB,IAAI,EACJ,KAAK,EACL,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,0FAA0F;IAC1F,QAAQ,CAAC,YAAY,CAAC,EAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GACjD,SAAS,CAAC;IACd,QAAQ,CAAC,aAAa,CAAC,EACnB,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,GACpD,SAAS,CAAC;IACd,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,CAAC;IAC7C,QAAQ,C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AAG,SAAS,KAClC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CACtC;AA2JD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,IAAI,EACX,UAAS,uBAA4B,KACpC,MAAM,CAAC,mBAAmB,EAAE,EAAE,KAAK,CAiBrC,CAAC"}
package/dist/build.js CHANGED
@@ -2,10 +2,10 @@
2
2
  * Build framework-agnostic HTTP route definitions from a Trails topo.
3
3
  *
4
4
  * Each route definition describes the path, method, input source, and an
5
- * `execute` function that validates input, composes gates, and runs the
5
+ * `execute` function that validates input, composes layers, and runs the
6
6
  * implementation -- all without referencing any HTTP framework types.
7
7
  */
8
- import { Result, TRAILHEAD_KEY, ValidationError, executeTrail, } from '@ontrails/core';
8
+ import { Result, TRAILHEAD_KEY, ValidationError, executeTrail, filterSurfaceTrails, validateEstablishedTopo, } from '@ontrails/core';
9
9
  // ---------------------------------------------------------------------------
10
10
  // Internal helpers
11
11
  // ---------------------------------------------------------------------------
@@ -25,8 +25,6 @@ const derivePath = (basePath, trailId) => {
25
25
  };
26
26
  /** Derive input source from HTTP method. */
27
27
  const deriveInputSource = (method) => method === 'GET' ? 'query' : 'body';
28
- /** Check if a trail should be included (skip internal trails). */
29
- const shouldInclude = (trail) => trail.meta?.['internal'] !== true;
30
28
  /** Build per-request context overrides with the HTTP trailhead marker. */
31
29
  const withHttpTrailhead = (requestId) => ({
32
30
  ...(requestId === undefined ? {} : { requestId }),
@@ -43,25 +41,30 @@ const withHttpTrailhead = (requestId) => ({
43
41
  * Delegates to the centralized `executeTrail` pipeline in core.
44
42
  * The returned function returns a `Result` and never throws.
45
43
  */
46
- const createExecute = (t, gates, options) => (input, requestId, abortSignal) => executeTrail(t, input, {
44
+ const createExecute = (graph, t, layers, options) => (input, requestId, abortSignal) => executeTrail(t, input, {
47
45
  abortSignal,
48
46
  configValues: options.configValues,
49
47
  createContext: options.createContext,
50
48
  ctx: withHttpTrailhead(requestId),
51
- gates,
52
- provisions: options.provisions,
49
+ layers,
50
+ resources: options.resources,
51
+ topo: graph,
53
52
  });
54
53
  // ---------------------------------------------------------------------------
55
54
  // Builder helpers
56
55
  // ---------------------------------------------------------------------------
57
56
  /** Filter topo items to eligible trails. */
58
- const eligibleTrails = (app) => app.list().filter((trail) => shouldInclude(trail));
57
+ const eligibleTrails = (graph, options) => filterSurfaceTrails(graph.list(), {
58
+ exclude: options.exclude,
59
+ include: options.include,
60
+ intent: options.intent,
61
+ });
59
62
  /** Build a single route definition from a trail. */
60
- const buildRoute = (trail, basePath, gates, options) => {
63
+ const buildRoute = (graph, trail, basePath, layers, options) => {
61
64
  const method = deriveMethod(trail);
62
65
  const path = derivePath(basePath, trail.id);
63
66
  return {
64
- execute: createExecute(trail, gates, options),
67
+ execute: createExecute(graph, trail, layers, options),
65
68
  inputSource: deriveInputSource(method),
66
69
  method,
67
70
  path,
@@ -86,11 +89,11 @@ const registerRoute = (route, seenRoutes, routes) => {
86
89
  return Result.ok();
87
90
  };
88
91
  /** Accumulate route definitions, returning early on the first collision. */
89
- const accumulateRoutes = (trails, basePath, gates, options) => {
92
+ const accumulateRoutes = (graph, trails, basePath, layers, options) => {
90
93
  const routes = [];
91
94
  const seenRoutes = new Map();
92
95
  for (const trail of trails) {
93
- const route = buildRoute(trail, basePath, gates, options);
96
+ const route = buildRoute(graph, trail, basePath, layers, options);
94
97
  const registered = registerRoute(route, seenRoutes, routes);
95
98
  if (registered.isErr()) {
96
99
  return registered;
@@ -108,14 +111,20 @@ const accumulateRoutes = (trails, basePath, gates, options) => {
108
111
  * - An HTTP method derived from intent (read -> GET, write -> POST, destroy -> DELETE)
109
112
  * - A path derived from the trail ID (dots become slashes)
110
113
  * - An input source derived from the method (GET -> query, others -> body)
111
- * - An `execute` function that validates, gates, and runs the implementation
114
+ * - An `execute` function that validates, layers, and runs the implementation
112
115
  *
113
116
  * Returns `Result.err(ValidationError)` if two trails derive the same
114
117
  * (method, path) pair. Returns `Result.ok(routes)` on success.
115
118
  */
116
- export const buildHttpRoutes = (app, options = {}) => {
119
+ export const deriveHttpRoutes = (graph, options = {}) => {
120
+ if (options.validate !== false) {
121
+ const validated = validateEstablishedTopo(graph);
122
+ if (validated.isErr()) {
123
+ return Result.err(validated.error);
124
+ }
125
+ }
117
126
  const basePath = (options.basePath ?? '').replace(/\/+$/, '');
118
- const gates = options.gates ?? [];
119
- return accumulateRoutes(eligibleTrails(app), basePath, gates, options);
127
+ const layers = options.layers ?? [];
128
+ return accumulateRoutes(graph, eligibleTrails(graph, options), basePath, layers, options);
120
129
  };
121
130
  //# sourceMappingURL=build.js.map
package/dist/build.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,eAAe,EACf,YAAY,GACb,MAAM,gBAAgB,CAAC;AAsDxB,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,6CAA6C;AAC7C,MAAM,cAAc,GAA+B;IACjD,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,4CAA4C;AAC5C,MAAM,YAAY,GAAG,CAAC,KAA8B,EAAc,EAAE,CAClE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;AAEzC,uEAAuE;AACvE,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAU,EAAE;IAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvE,OAAO,GAAG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AAE,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,KAAW,EACX,UAAmC,EAAE,EACC,EAAE;IACxC,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;IACpC,OAAO,gBAAgB,CACrB,KAAK,EACL,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { buildHttpRoutes, type BuildHttpRoutesOptions, type HttpMethod, type HttpRouteDefinition, type InputSource, } from './build.js';
1
+ export { deriveHttpRoutes, type DeriveHttpRoutesOptions, type HttpMethod, type HttpRouteDefinition, type InputSource, } from './build.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Build (framework-agnostic)
2
- export { buildHttpRoutes, } from './build.js';
2
+ export { deriveHttpRoutes, } from './build.js';
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EACL,eAAe,GAKhB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EACL,gBAAgB,GAKjB,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@ontrails/http",
3
- "version": "1.0.0-beta.13",
3
+ "version": "1.0.0-beta.15",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
7
- "./hono": "./src/hono/index.ts",
8
7
  "./package.json": "./package.json"
9
8
  },
10
9
  "scripts": {
@@ -15,15 +14,9 @@
15
14
  "clean": "rm -rf dist *.tsbuildinfo"
16
15
  },
17
16
  "dependencies": {
18
- "@ontrails/core": "^1.0.0-beta.12"
17
+ "@ontrails/core": "^1.0.0-beta.14"
19
18
  },
20
19
  "peerDependencies": {
21
- "hono": "^4.7.0",
22
20
  "zod": "^4.3.5"
23
- },
24
- "peerDependenciesMeta": {
25
- "hono": {
26
- "optional": true
27
- }
28
21
  }
29
22
  }