@ontrails/mcp 1.0.0-beta.15 → 1.0.0-beta.17

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 (50) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +19 -3
  3. package/package.json +11 -3
  4. package/src/build.ts +657 -70
  5. package/src/index.ts +5 -0
  6. package/src/stdio.ts +8 -0
  7. package/src/surface.ts +86 -53
  8. package/.turbo/turbo-build.log +0 -1
  9. package/.turbo/turbo-lint.log +0 -3
  10. package/.turbo/turbo-typecheck.log +0 -1
  11. package/dist/annotations.d.ts +0 -19
  12. package/dist/annotations.d.ts.map +0 -1
  13. package/dist/annotations.js +0 -31
  14. package/dist/annotations.js.map +0 -1
  15. package/dist/build.d.ts +0 -49
  16. package/dist/build.d.ts.map +0 -1
  17. package/dist/build.js +0 -220
  18. package/dist/build.js.map +0 -1
  19. package/dist/index.d.ts +0 -7
  20. package/dist/index.d.ts.map +0 -1
  21. package/dist/index.js +0 -13
  22. package/dist/index.js.map +0 -1
  23. package/dist/progress.d.ts +0 -13
  24. package/dist/progress.d.ts.map +0 -1
  25. package/dist/progress.js +0 -51
  26. package/dist/progress.js.map +0 -1
  27. package/dist/stdio.d.ts +0 -12
  28. package/dist/stdio.d.ts.map +0 -1
  29. package/dist/stdio.js +0 -15
  30. package/dist/stdio.js.map +0 -1
  31. package/dist/surface.d.ts +0 -35
  32. package/dist/surface.d.ts.map +0 -1
  33. package/dist/surface.js +0 -123
  34. package/dist/surface.js.map +0 -1
  35. package/dist/tool-name.d.ts +0 -15
  36. package/dist/tool-name.d.ts.map +0 -1
  37. package/dist/tool-name.js +0 -19
  38. package/dist/tool-name.js.map +0 -1
  39. package/dist/trailhead.d.ts +0 -57
  40. package/dist/trailhead.d.ts.map +0 -1
  41. package/dist/trailhead.js +0 -136
  42. package/dist/trailhead.js.map +0 -1
  43. package/src/__tests__/annotations.test.ts +0 -63
  44. package/src/__tests__/build.test.ts +0 -648
  45. package/src/__tests__/progress.test.ts +0 -136
  46. package/src/__tests__/surface.test.ts +0 -191
  47. package/src/__tests__/tool-name.test.ts +0 -46
  48. package/tsconfig.json +0 -9
  49. package/tsconfig.tests.json +0 -10
  50. package/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @ontrails/mcp
2
2
 
3
+ ## 1.0.0-beta.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 61497c5: Add v1-minimum public API examples for shipped surface entrypoints.
8
+ - Updated dependencies [3dc8254]
9
+ - @ontrails/core@1.0.0-beta.17
10
+
11
+ ## 1.0.0-beta.16
12
+
13
+ ### Minor Changes
14
+
15
+ - 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`).
16
+
17
+ ### Patch Changes
18
+
19
+ - 6300f70: Refresh source comments and test labels for retired connector terminology as adapter guardrails become strict.
20
+ - 20d7a5c: Enforce the shared safe error projection policy for public error bodies, diagnostics, serialized payloads, and CLI stderr.
21
+ - 49c2e7d: Refresh published package README taxonomy to use adapter language instead of retired connector vocabulary.
22
+ - Updated dependencies [73622ae]
23
+ - Updated dependencies [6300f70]
24
+ - Updated dependencies [d172013]
25
+ - Updated dependencies [c3fc5c3]
26
+ - Updated dependencies [20d7a5c]
27
+ - Updated dependencies [be5fb46]
28
+ - Updated dependencies [e898cc4]
29
+ - Updated dependencies [3395234]
30
+ - Updated dependencies [bcdc484]
31
+ - Updated dependencies [331e3a9]
32
+ - Updated dependencies [4399fdb]
33
+ - Updated dependencies [4b8d13b]
34
+ - Updated dependencies [112b9f2]
35
+ - Updated dependencies [893025e]
36
+ - Updated dependencies [eec5e9d]
37
+ - Updated dependencies [ebd4434]
38
+ - Updated dependencies [863d473]
39
+ - Updated dependencies [344f2f7]
40
+ - Updated dependencies [26f9ffd]
41
+ - Updated dependencies [10eae9a]
42
+ - Updated dependencies [22c6c06]
43
+ - @ontrails/core@1.0.0-beta.16
44
+
3
45
  ## 1.0.0-beta.15
4
46
 
5
47
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ontrails/mcp
2
2
 
3
- MCP surface connector. One `surface()` call turns a topo into an MCP server with tool definitions, annotations, and progress bridging -- all derived from the trail contracts.
3
+ MCP surface adapter. One `surface()` call turns a topo into an MCP server with tool definitions, annotations, and progress bridging -- all derived from the trail contracts.
4
4
 
5
5
  ## Usage
6
6
 
@@ -11,15 +11,23 @@ import { z } from 'zod';
11
11
 
12
12
  const greet = trail('greet', {
13
13
  input: z.object({ name: z.string().describe('Who to greet') }),
14
+ output: z.object({ greeting: z.string() }),
14
15
  intent: 'read',
15
- blaze: (input) => Result.ok(`Hello, ${input.name}!`),
16
+ examples: [
17
+ {
18
+ expected: { greeting: 'Hello, Ada!' },
19
+ input: { name: 'Ada' },
20
+ name: 'Ada',
21
+ },
22
+ ],
23
+ blaze: (input) => Result.ok({ greeting: `Hello, ${input.name}!` }),
16
24
  });
17
25
 
18
26
  const graph = topo('myapp', { greet });
19
27
  await surface(graph);
20
28
  ```
21
29
 
22
- This starts an MCP server over stdio with a `myapp_greet` tool. The tool gets `readOnlyHint: true` and a JSON Schema input -- both derived from the trail definition.
30
+ This starts an MCP server over stdio with a `myapp_greet` tool. The tool gets `readOnlyHint: true`, JSON Schema input, JSON Schema output, and structured examples -- all derived from the trail definition.
23
31
 
24
32
  For more control, build the tools yourself:
25
33
 
@@ -31,7 +39,9 @@ if (result.isErr()) throw result.error; // ValidationError on tool-name collisio
31
39
  for (const tool of result.value) {
32
40
  server.registerTool(tool.name, tool.handler, {
33
41
  inputSchema: tool.inputSchema,
42
+ outputSchema: tool.outputSchema,
34
43
  annotations: tool.annotations,
44
+ _meta: tool._meta,
35
45
  });
36
46
  }
37
47
  ```
@@ -63,6 +73,12 @@ Trail intent, idempotency, and description map directly to MCP annotations:
63
73
 
64
74
  No manual annotation definitions. The contract is the source of truth.
65
75
 
76
+ ## Schemas and Examples
77
+
78
+ MCP tool definitions include the trail's input schema, and trails with an `output` schema also project that schema into MCP `outputSchema`. Non-object trail outputs are wrapped in a `{ data: ... }` object because MCP structured tool results are object-shaped.
79
+
80
+ Trail examples are projected as structured metadata under `_meta["ontrails/examples"]`. Each projected example preserves its input, expected output or error, a success/error kind, and provenance pointing back to the authored `trail.examples` field.
81
+
66
82
  ## Tool naming
67
83
 
68
84
  Trail IDs become MCP tool names with the app prefix: `entity.show` in app `myapp` becomes `myapp_entity_show`. Dots and hyphens become underscores, everything lowercase.
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "@ontrails/mcp",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.17",
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,10 +22,10 @@
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.16"
18
26
  },
19
27
  "peerDependencies": {
20
- "@modelcontextprotocol/sdk": "^1.12.0",
28
+ "@modelcontextprotocol/sdk": "^1.28.0",
21
29
  "zod": "^4.3.5"
22
30
  }
23
31
  }