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

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/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @ontrails/http
2
2
 
3
+ ## 1.0.0-beta.16
4
+
5
+ ### Minor Changes
6
+
7
+ - 2bf239e: Move OpenAPI generation ownership to the HTTP surface.
8
+
9
+ **http**: Export `deriveOpenApiSpec()` and its OpenAPI types from `@ontrails/http`.
10
+
11
+ **schema**: Remove the OpenAPI helper export so schema stays focused on surface maps, locks, and semantic diffing.
12
+
13
+ - 26f9ffd: Project typed-layer `input` schemas onto MCP and HTTP surfaces. Closes Phase 7. Lifts `collectAttachedTypedLayers` and `projectLayerFieldName` (collision-rename rule) into `@ontrails/core/internal/layer-projection` so all three surfaces share one source of truth. The CLI surface refactors to consume the lifted helpers (no behavior change). MCP merges layer fields into each tool's `inputSchema` and partitions inbound args at invocation time. HTTP merges layer fields into the route's request schema (query for reads, body for writes) and exposes new optional `HttpRouteDefinition.inputSchema` + `layerInputProjections` for surface adapters / OpenAPI generators. Collision rule matches TRL-473's: deterministic rename to a layer-prefixed camelCase name with the original captured in the routing table. Side fix: MCP and HTTP handlers now forward `topoLayers: graph.layers` + `surfaceLayers: layers` so topo-scope layers actually compose at runtime (previously the handlers used the deprecated `layers` alias and never read `graph.layers`).
14
+ - 22c6c06: Accept ADR-0041 Unified Observability and ship the first activation and
15
+ observability primitives it depends on: activation trace records, topo-level
16
+ observe configuration, webhook activation materialization, signal/webhook
17
+ warden coaching, the `@ontrails/observe` package, sink composition, and
18
+ zero-dependency observe sinks.
19
+
20
+ ### Patch Changes
21
+
22
+ - 6300f70: Refresh source comments and test labels for retired connector terminology as adapter guardrails become strict.
23
+ - 95bf132: Wire HTTP permit resolution through the Hono adapter, including request headers for Bearer Authorization handling.
24
+ - 49c2e7d: Refresh published package README taxonomy to use adapter language instead of retired connector vocabulary.
25
+ - df9a7d0: Add project-aware public export-map governance for @ontrails workspace docs,
26
+ imports, root barrels, and bin-only package surfaces.
27
+ - Updated dependencies [73622ae]
28
+ - Updated dependencies [6300f70]
29
+ - Updated dependencies [d172013]
30
+ - Updated dependencies [c3fc5c3]
31
+ - Updated dependencies [20d7a5c]
32
+ - Updated dependencies [be5fb46]
33
+ - Updated dependencies [e898cc4]
34
+ - Updated dependencies [3395234]
35
+ - Updated dependencies [bcdc484]
36
+ - Updated dependencies [331e3a9]
37
+ - Updated dependencies [4399fdb]
38
+ - Updated dependencies [4b8d13b]
39
+ - Updated dependencies [112b9f2]
40
+ - Updated dependencies [893025e]
41
+ - Updated dependencies [eec5e9d]
42
+ - Updated dependencies [ebd4434]
43
+ - Updated dependencies [863d473]
44
+ - Updated dependencies [344f2f7]
45
+ - Updated dependencies [26f9ffd]
46
+ - Updated dependencies [10eae9a]
47
+ - Updated dependencies [22c6c06]
48
+ - @ontrails/core@1.0.0-beta.16
49
+
3
50
  ## 1.0.0-beta.15
4
51
 
5
52
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ontrails/http
2
2
 
3
- Framework-agnostic HTTP route derivation for Trails. Pair this package with `@ontrails/hono` when you want the Hono surface connector.
3
+ Framework-agnostic HTTP route derivation for Trails. Pair this package with `@ontrails/hono` when you want the Hono surface adapter.
4
4
 
5
5
  ## Usage
6
6
 
@@ -36,11 +36,23 @@ for (const route of result.value) {
36
36
 
37
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
+ OpenAPI is the HTTP surface's persisted client contract projection:
40
+
41
+ ```typescript
42
+ import { deriveOpenApiSpec } from '@ontrails/http';
43
+
44
+ const spec = deriveOpenApiSpec(graph, { basePath: '/api' });
45
+ ```
46
+
47
+ `deriveOpenApiSpec()` emits an OpenAPI 3.1 document from the same trail
48
+ contracts used by `deriveHttpRoutes()`.
49
+
39
50
  ## API
40
51
 
41
52
  | Export | What it does |
42
53
  | --- | --- |
43
54
  | `deriveHttpRoutes(graph, options?)` | Build framework-agnostic route definitions from a topo |
55
+ | `deriveOpenApiSpec(graph, options?)` | Generate an OpenAPI 3.1 document for the HTTP surface |
44
56
 
45
57
  ## Route derivation
46
58
 
@@ -76,9 +88,9 @@ const result = deriveHttpRoutes(graph, {
76
88
  with `visibility: 'internal'` stay hidden unless you include their exact trail
77
89
  ID intentionally.
78
90
 
79
- ## AbortSignal propagation
91
+ ## Request context and abort propagation
80
92
 
81
- The `execute` function on each `HttpRouteDefinition` accepts an optional `abortSignal`. The Hono connector extracts `signal` from `c.req.raw` and forwards it as `abortSignal`, so client disconnects propagate into trail execution.
93
+ The `execute` function on each `HttpRouteDefinition` accepts optional `requestId`, `abortSignal`, and request context arguments. HTTP adapters should pass the request's `AbortSignal` so client disconnects propagate into trail execution, and pass headers in the request context when Bearer auth should resolve into `ctx.permit`.
82
94
 
83
95
  ## `HttpRouteDefinition`
84
96
 
@@ -91,11 +103,11 @@ Each route definition produced by `deriveHttpRoutes` includes:
91
103
  | `trailId` | `string` | The trail ID this route was derived from |
92
104
  | `inputSource` | `'query' \| 'body'` | Where to read input |
93
105
  | `trail` | `Trail` | The original trail definition |
94
- | `execute` | `(input, requestId?, abortSignal?) => Promise<Result>` | Validates, layers, and runs the implementation |
106
+ | `execute` | `(input, requestId?, abortSignal?, context?) => Promise<Result>` | Validates, layers, resolves request auth when configured, and runs the implementation |
95
107
 
96
108
  For GET routes on the Hono surface, repeated query keys are passed through as
97
109
  arrays (`?tag=one&tag=two` -> `{ tag: ['one', 'two'] }`) while a single
98
- occurrence stays a scalar string. The connector does not coerce singleton query
110
+ occurrence stays a scalar string. The adapter does not coerce singleton query
99
111
  values into arrays.
100
112
 
101
113
  ## Installation
@@ -108,5 +120,6 @@ bun add @ontrails/http @ontrails/hono
108
120
 
109
121
  Hono integration now lives in `@ontrails/hono`.
110
122
 
123
+ <!-- warden-ignore-next-line -->
111
124
  - Replace `import { trailhead } from '@ontrails/http/hono'` with `import { surface } from '@ontrails/hono'`
112
125
  - Keep `deriveHttpRoutes()` and the route model imports on `@ontrails/http`
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "@ontrails/http",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.16",
4
+ "files": [
5
+ "src/**/*.ts",
6
+ "!src/**/__tests__/**",
7
+ "!src/**/*.test.ts",
8
+ "!src/**/*.test-d.ts",
9
+ "README.md",
10
+ "CHANGELOG.md"
11
+ ],
4
12
  "type": "module",
5
13
  "exports": {
6
14
  ".": "./src/index.ts",
@@ -14,7 +22,7 @@
14
22
  "clean": "rm -rf dist *.tsbuildinfo"
15
23
  },
16
24
  "dependencies": {
17
- "@ontrails/core": "^1.0.0-beta.14"
25
+ "@ontrails/core": "^1.0.0-beta.15"
18
26
  },
19
27
  "peerDependencies": {
20
28
  "zod": "^4.3.5"