@ontrails/trails 1.0.0-beta.19 → 1.0.0-beta.21

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,88 @@
1
1
  # trails
2
2
 
3
+ ## 1.0.0-beta.21
4
+
5
+ ### Minor Changes
6
+
7
+ - bb5a219: Add the public `create.versions` trail (`trails create versions`). Scaffold dependency version derivation graduates from `scripts/sync-scaffold-versions.ts` into the `create` surface: check mode verifies `apps/trails/src/scaffold-versions.generated.ts` is current, write mode regenerates it, and the root script remains as a thin compatibility wrapper.
8
+
9
+ ### Patch Changes
10
+
11
+ - 4c0041c: Expose `wayfind.errors` and `wayfind.adapters` as read-only direct tools on the Trails operator MCP surface.
12
+ - 4cca012: Add the `wayfind.errors` graph-read trail and expose it through the Trails CLI for local error-fact inspection.
13
+ - 708b861: Expose `wayfind.adapters` over adapter-kit fact reports and add it to the Trails operator CLI Wayfinder surface.
14
+ - b6579b8: Expose selected Wayfinder graph-read queries through the local `trails wayfind` CLI command group for dogfooding saved topo artifacts.
15
+ - 52e15bc: Repair fresh app loading so mirrored workspace modules can resolve first-party workspace packages and their installed package dependencies from the mirror.
16
+ - d4ec336: Add a repo-level Wayfinder dogfood smoke command that exercises the local
17
+ Trails CLI against exported operator topo artifacts.
18
+ - 0d1472a: Expose release rules config helpers from `@ontrails/trails/release` so
19
+ projects can compose release policy into `trails.config.ts`.
20
+ - 8f681ae: Move release rule evaluation into the Trails app package and export the
21
+ release check and public trail contract fact helpers from
22
+ `@ontrails/trails/release`.
23
+ - 9e77ae1: Expose release rule evaluation through the `trails release check` command and
24
+ the Trails MCP operator surface, with JSON output available through the shared
25
+ CLI output mode.
26
+ - fd676c4: Expose the native Bun release binding from `@ontrails/trails/release` and keep publish and registry scripts as compatibility wrappers.
27
+ - 0ccb3e5: Add `release.smoke` as the public Trails release confidence surface for packed artifact and Wayfinder dogfood checks.
28
+ - Updated dependencies [99523f2]
29
+ - Updated dependencies [5e301d2]
30
+ - Updated dependencies [4cca012]
31
+ - Updated dependencies [3caa263]
32
+ - Updated dependencies [708b861]
33
+ - Updated dependencies [5be032c]
34
+ - @ontrails/core@1.0.0-beta.21
35
+ - @ontrails/permits@1.0.0-beta.21
36
+ - @ontrails/topographer@1.0.0-beta.21
37
+ - @ontrails/wayfinder@1.0.0-beta.21
38
+ - @ontrails/adapter-kit@1.0.0-beta.21
39
+ - @ontrails/warden@1.0.0-beta.21
40
+ - @ontrails/commander@1.0.0-beta.21
41
+ - @ontrails/cli@1.0.0-beta.21
42
+ - @ontrails/http@1.0.0-beta.21
43
+ - @ontrails/mcp@1.0.0-beta.21
44
+ - @ontrails/observe@1.0.0-beta.21
45
+ - @ontrails/tracing@1.0.0-beta.21
46
+
47
+ ## 1.0.0-beta.20
48
+
49
+ ### Minor Changes
50
+
51
+ - 396136a: Add the Trails operator MCP entrypoint with deferred surface facets and cold-context resources.
52
+
53
+ ### Patch Changes
54
+
55
+ - 851a2a3: Derive trail caller and blaze input types from the authored input schema while keeping one public input contract.
56
+ - d89a889: Project selected Wayfinder graph-read trails into the Trails operator MCP surface alongside clearer first-class operator tools.
57
+ - f67cd2a: Document Wayfinder as a real graph-read query catalog instead of a shell-only
58
+ package, including MCP exposure guidance, agent skill guidance, and release
59
+ notes for the v0 catalog and its deferred non-goals.
60
+ - Updated dependencies [851a2a3]
61
+ - Updated dependencies [eee1307]
62
+ - Updated dependencies [9bec01c]
63
+ - Updated dependencies [accb9ec]
64
+ - Updated dependencies [8bc0708]
65
+ - Updated dependencies [6901776]
66
+ - Updated dependencies [f67cd2a]
67
+ - Updated dependencies [c65c465]
68
+ - Updated dependencies [38f62f8]
69
+ - Updated dependencies [b248d4a]
70
+ - Updated dependencies [5364df1]
71
+ - Updated dependencies [2067441]
72
+ - Updated dependencies [6c3296c]
73
+ - @ontrails/core@1.0.0-beta.20
74
+ - @ontrails/warden@1.0.0-beta.20
75
+ - @ontrails/topographer@1.0.0-beta.20
76
+ - @ontrails/adapter-kit@1.0.0-beta.20
77
+ - @ontrails/mcp@1.0.0-beta.20
78
+ - @ontrails/wayfinder@1.0.0-beta.20
79
+ - @ontrails/commander@1.0.0-beta.20
80
+ - @ontrails/cli@1.0.0-beta.20
81
+ - @ontrails/http@1.0.0-beta.20
82
+ - @ontrails/observe@1.0.0-beta.20
83
+ - @ontrails/permits@1.0.0-beta.20
84
+ - @ontrails/tracing@1.0.0-beta.20
85
+
3
86
  ## 1.0.0-beta.19
4
87
 
5
88
  ### Major Changes
package/README.md CHANGED
@@ -15,6 +15,8 @@ Common workflows:
15
15
  - `trails topo` inspects topo state and manages pins/history.
16
16
  - `trails compile` writes committed topo artifacts.
17
17
  - `trails validate` checks committed topo artifacts for drift.
18
+ - `trails wayfind overview` and adjacent `trails wayfind ...` commands read
19
+ saved topo artifacts through Wayfinder for local graph navigation.
18
20
  - `trails warden` runs Trails governance checks for contract and architecture drift.
19
21
  - `trails guide` shows available trails and examples from a project.
20
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ontrails/trails",
3
- "version": "1.0.0-beta.19",
3
+ "version": "1.0.0-beta.21",
4
4
  "bin": {
5
5
  "trails": "./bin/trails.ts"
6
6
  },
@@ -14,6 +14,10 @@
14
14
  "CHANGELOG.md"
15
15
  ],
16
16
  "type": "module",
17
+ "exports": {
18
+ "./release": "./src/release/index.ts",
19
+ "./package.json": "./package.json"
20
+ },
17
21
  "scripts": {
18
22
  "build": "tsc -b",
19
23
  "test": "bun test",
@@ -23,21 +27,23 @@
23
27
  },
24
28
  "dependencies": {
25
29
  "@clack/prompts": "^1.1.0",
26
- "@ontrails/adapter-kit": "^1.0.0-beta.19",
27
- "@ontrails/cli": "^1.0.0-beta.19",
28
- "@ontrails/commander": "^1.0.0-beta.19",
29
- "@ontrails/core": "^1.0.0-beta.19",
30
- "@ontrails/http": "^1.0.0-beta.19",
31
- "@ontrails/mcp": "^1.0.0-beta.19",
32
- "@ontrails/observe": "^1.0.0-beta.19",
33
- "@ontrails/permits": "^1.0.0-beta.19",
34
- "@ontrails/topographer": "^1.0.0-beta.19",
35
- "@ontrails/tracing": "^1.0.0-beta.19",
36
- "@ontrails/warden": "^1.0.0-beta.19",
30
+ "@ontrails/adapter-kit": "^1.0.0-beta.21",
31
+ "@ontrails/cli": "^1.0.0-beta.21",
32
+ "@ontrails/commander": "^1.0.0-beta.21",
33
+ "@ontrails/core": "^1.0.0-beta.21",
34
+ "@ontrails/http": "^1.0.0-beta.21",
35
+ "@ontrails/mcp": "^1.0.0-beta.21",
36
+ "@ontrails/observe": "^1.0.0-beta.21",
37
+ "@ontrails/permits": "^1.0.0-beta.21",
38
+ "@ontrails/topographer": "^1.0.0-beta.21",
39
+ "@ontrails/tracing": "^1.0.0-beta.21",
40
+ "@ontrails/warden": "^1.0.0-beta.21",
41
+ "@ontrails/wayfinder": "^1.0.0-beta.21",
37
42
  "commander": "^14.0.3",
43
+ "typescript": "^5.9.3",
38
44
  "zod": "^4.3.5"
39
45
  },
40
46
  "devDependencies": {
41
- "@ontrails/testing": "^1.0.0-beta.19"
47
+ "@ontrails/testing": "^1.0.0-beta.21"
42
48
  }
43
49
  }
package/src/app.ts CHANGED
@@ -1,4 +1,16 @@
1
1
  import { topo } from '@ontrails/core';
2
+ import {
3
+ wayfindAdaptersTrail,
4
+ wayfindContractTrail,
5
+ wayfindDescribeTrail,
6
+ wayfindErrorsTrail,
7
+ wayfindExamplesTrail,
8
+ wayfindImpactTrail,
9
+ wayfindNearbyTrail,
10
+ wayfindOverviewTrail,
11
+ wayfindSearchTrail,
12
+ wayfindTrailsTrail,
13
+ } from '@ontrails/wayfinder';
2
14
 
3
15
  import * as addSurface from './trails/add-surface.js';
4
16
  import * as addTrail from './trails/add-trail.js';
@@ -10,6 +22,7 @@ import * as completionsComplete from './trails/completions-complete.js';
10
22
  import * as create from './trails/create.js';
11
23
  import * as createAdapter from './trails/create-adapter.js';
12
24
  import * as createScaffold from './trails/create-scaffold.js';
25
+ import * as createVersions from './trails/create-versions.js';
13
26
  import * as deprecate from './trails/deprecate.js';
14
27
  import * as devClean from './trails/dev-clean.js';
15
28
  import * as devReset from './trails/dev-reset.js';
@@ -17,6 +30,8 @@ import * as devStats from './trails/dev-stats.js';
17
30
  import * as doctor from './trails/doctor.js';
18
31
  import * as draftPromote from './trails/draft-promote.js';
19
32
  import * as guide from './trails/guide.js';
33
+ import * as releaseCheck from './trails/release-check.js';
34
+ import * as releaseSmoke from './trails/release-smoke.js';
20
35
  import * as revise from './trails/revise.js';
21
36
  import * as run from './trails/run.js';
22
37
  import * as runExample from './trails/run-example.js';
@@ -30,7 +45,7 @@ import * as validate from './trails/validate.js';
30
45
  import * as warden from './trails/warden.js';
31
46
  import * as wardenGuide from './trails/warden-guide.js';
32
47
 
33
- export const app = topo(
48
+ export const operatorApp = topo(
34
49
  'trails',
35
50
  run,
36
51
  runExamples,
@@ -49,6 +64,8 @@ export const app = topo(
49
64
  devClean,
50
65
  devReset,
51
66
  guide,
67
+ releaseCheck,
68
+ releaseSmoke,
52
69
  draftPromote,
53
70
  adapterCheck,
54
71
  warden,
@@ -56,9 +73,34 @@ export const app = topo(
56
73
  create,
57
74
  createAdapter,
58
75
  createScaffold,
76
+ createVersions,
59
77
  addSurface,
60
78
  addVerify,
61
79
  addTrail,
62
80
  completions,
63
81
  completionsComplete
64
82
  );
83
+
84
+ const operatorTrails = Object.fromEntries(
85
+ operatorApp.list().map((trailItem) => [trailItem.id, trailItem])
86
+ );
87
+
88
+ const cliWayfinderTrails = {
89
+ wayfindAdaptersTrail,
90
+ wayfindContractTrail,
91
+ wayfindDescribeTrail,
92
+ wayfindErrorsTrail,
93
+ wayfindExamplesTrail,
94
+ wayfindImpactTrail,
95
+ wayfindNearbyTrail,
96
+ wayfindOverviewTrail,
97
+ wayfindSearchTrail,
98
+ wayfindTrailsTrail,
99
+ };
100
+
101
+ export const trailsCliIncludedTrails = [
102
+ ...operatorApp.list().map((trailItem) => trailItem.id),
103
+ ...Object.values(cliWayfinderTrails).map((trailItem) => trailItem.id),
104
+ ];
105
+
106
+ export const app = topo('trails', operatorTrails, cliWayfinderTrails);
package/src/cli.ts CHANGED
@@ -19,7 +19,7 @@ import { createProgram } from '@ontrails/commander';
19
19
  import { resolvePermitFromBearerToken } from '@ontrails/permits';
20
20
  import { deriveTopoGraph } from '@ontrails/topographer';
21
21
 
22
- import { app } from './app.js';
22
+ import { app, trailsCliIncludedTrails } from './app.js';
23
23
  import { resolveInputWithClack } from './clack.js';
24
24
  import { getRetiredTopoCommandDiagnostic } from './retired-topo-command.js';
25
25
  import { attachCompletionsInstallCommand } from './run-completions-install.js';
@@ -27,6 +27,10 @@ import {
27
27
  applyAdapterCheckExitCode,
28
28
  tryAdapterCheckOutput,
29
29
  } from './run-adapter-check.js';
30
+ import {
31
+ applyReleaseCheckExitCode,
32
+ tryReleaseCheckOutput,
33
+ } from './run-release-check.js';
30
34
  import { tryRecoverFromRunCollision } from './run-collision.js';
31
35
  import { tryExampleRunOutput } from './run-example.js';
32
36
  import { tryExamplesRunOutput } from './run-examples.js';
@@ -70,6 +74,7 @@ const buildOnResult =
70
74
  // `tracing`. Hand that case off before the regular chain so the
71
75
  // existing handlers do not also write to stdout.
72
76
  applyAdapterCheckExitCode(resolvedCtx);
77
+ applyReleaseCheckExitCode(resolvedCtx);
73
78
  if (session !== undefined && tryTraceJsonOutput(resolvedCtx, session)) {
74
79
  return;
75
80
  }
@@ -89,6 +94,9 @@ const buildOnResult =
89
94
  if (tryAdapterCheckOutput(resolvedCtx)) {
90
95
  return;
91
96
  }
97
+ if (tryReleaseCheckOutput(resolvedCtx)) {
98
+ return;
99
+ }
92
100
  await defaultOnResult(resolvedCtx);
93
101
  };
94
102
 
@@ -287,6 +295,7 @@ const runSurfaceOnce = async (): Promise<void> => {
287
295
  try {
288
296
  const program = createProgram(app, {
289
297
  description: 'Agent-native, contract-first TypeScript framework',
298
+ include: trailsCliIncludedTrails,
290
299
  name: 'trails',
291
300
  onResult: buildOnResult(session),
292
301
  presets: [
@@ -44,6 +44,13 @@ const validateMirrorRoot = (
44
44
  );
45
45
  };
46
46
 
47
+ const isPathInside = (root: string, target: string): boolean => {
48
+ const candidate = relative(root, target);
49
+ return (
50
+ candidate === '' || (!candidate.startsWith('..') && !isAbsolute(candidate))
51
+ );
52
+ };
53
+
47
54
  const resolveAbsoluteSourcePath = (
48
55
  sourcePath: string
49
56
  ): TrailsResult<string, ValidationError> =>
@@ -56,6 +63,41 @@ const resolveAbsoluteSourcePath = (
56
63
  )
57
64
  );
58
65
 
66
+ export const ensureLoadAppMirrorDirectory = (
67
+ directoryPath: string,
68
+ mirrorRoot: string
69
+ ): TrailsResult<void, Error> => {
70
+ const root = validateMirrorRoot(mirrorRoot);
71
+ if (root.isErr()) {
72
+ return root;
73
+ }
74
+
75
+ const target = resolve(directoryPath);
76
+ if (!isPathInside(root.value, target)) {
77
+ return Result.err(
78
+ new PermissionError(
79
+ `Refusing to create load-app mirror directory outside "${root.value}"`,
80
+ { context: { directoryPath: target, mirrorRoot: root.value } }
81
+ )
82
+ );
83
+ }
84
+
85
+ try {
86
+ mkdirSync(target, { recursive: true });
87
+ return Result.ok();
88
+ } catch (error) {
89
+ return Result.err(
90
+ new InternalError(
91
+ `Failed to create load-app mirror directory "${target}"`,
92
+ {
93
+ cause: asError(error),
94
+ context: { directoryPath: target, mirrorRoot: root.value },
95
+ }
96
+ )
97
+ );
98
+ }
99
+ };
100
+
59
101
  /**
60
102
  * Convert an absolute source path to the deterministic location inside a
61
103
  * load-app fresh mirror.
package/src/mcp-app.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { topo } from '@ontrails/core';
2
+ import {
3
+ wayfindAdaptersTrail,
4
+ wayfindContractTrail,
5
+ wayfindErrorsTrail,
6
+ wayfindExamplesTrail,
7
+ wayfindImpactTrail,
8
+ wayfindNearbyTrail,
9
+ wayfindOverviewTrail,
10
+ wayfindSearchTrail,
11
+ wayfindTrailsTrail,
12
+ } from '@ontrails/wayfinder';
13
+
14
+ import { operatorApp } from './app.js';
15
+
16
+ const operatorTrails = Object.fromEntries(
17
+ operatorApp.list().map((trailItem) => [trailItem.id, trailItem])
18
+ );
19
+
20
+ export const trailsMcpApp = topo('trails', operatorTrails, {
21
+ wayfindAdaptersTrail,
22
+ wayfindContractTrail,
23
+ wayfindErrorsTrail,
24
+ wayfindExamplesTrail,
25
+ wayfindImpactTrail,
26
+ wayfindNearbyTrail,
27
+ wayfindOverviewTrail,
28
+ wayfindSearchTrail,
29
+ wayfindTrailsTrail,
30
+ });
@@ -0,0 +1,77 @@
1
+ import type { CreateServerOptions, McpSurfaceFacetMap } from '@ontrails/mcp';
2
+
3
+ export const trailsMcpIncludedTrails = [
4
+ 'adapter.check',
5
+ 'add.surface',
6
+ 'add.trail',
7
+ 'compile',
8
+ 'create',
9
+ 'create.adapter',
10
+ 'deprecate',
11
+ 'dev.clean',
12
+ 'dev.reset',
13
+ 'dev.stats',
14
+ 'diff',
15
+ 'doctor',
16
+ 'draft.promote',
17
+ 'guide',
18
+ 'release.check',
19
+ 'release.smoke',
20
+ 'revise',
21
+ 'run',
22
+ 'run.example',
23
+ 'run.examples',
24
+ 'survey',
25
+ 'survey.brief',
26
+ 'survey.diff',
27
+ 'survey.resource',
28
+ 'survey.signal',
29
+ 'survey.surfaces',
30
+ 'survey.trail',
31
+ 'topo',
32
+ 'topo.history',
33
+ 'topo.pin',
34
+ 'topo.unpin',
35
+ 'validate',
36
+ 'warden',
37
+ 'warden.guide',
38
+ 'wayfind.adapters',
39
+ 'wayfind.contract',
40
+ 'wayfind.errors',
41
+ 'wayfind.examples',
42
+ 'wayfind.impact',
43
+ 'wayfind.nearby',
44
+ 'wayfind.overview',
45
+ 'wayfind.search',
46
+ 'wayfind.trails',
47
+ ] as const;
48
+
49
+ export const trailsMcpFacets = {
50
+ inspect: {
51
+ description:
52
+ 'Inspect saved topo structure, resources, signals, surfaces, and diffs.',
53
+ mcp: { loading: 'deferred' },
54
+ trails: [
55
+ 'survey',
56
+ 'diff',
57
+ 'topo',
58
+ 'guide',
59
+ 'survey.brief',
60
+ 'survey.diff',
61
+ 'survey.resource',
62
+ 'survey.signal',
63
+ 'survey.surfaces',
64
+ 'survey.trail',
65
+ 'topo.history',
66
+ ],
67
+ },
68
+ } satisfies McpSurfaceFacetMap;
69
+
70
+ export const trailsMcpSurfaceOptions = {
71
+ description:
72
+ 'Trails framework operator surface. Use MCP resources for cold context, direct tools for high-signal work, and the inspect facet for saved topo reads.',
73
+ facets: trailsMcpFacets,
74
+ include: trailsMcpIncludedTrails,
75
+ mcpResources: { examples: true, surfaceMap: true },
76
+ name: 'trails',
77
+ } satisfies CreateServerOptions;
package/src/mcp.ts ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bun
2
+ /* oxlint-disable eslint-plugin-jest/require-hook -- MCP stdio entrypoints execute at module scope */
3
+ import { surface } from '@ontrails/mcp';
4
+
5
+ import { trailsMcpApp } from './mcp-app.js';
6
+ import { trailsMcpSurfaceOptions } from './mcp-options.js';
7
+
8
+ await surface(trailsMcpApp, trailsMcpSurfaceOptions);
@@ -0,0 +1,39 @@
1
+ export const releaseBindingKindValues = ['native', 'adapter'] as const;
2
+ export type ReleaseBindingKind = (typeof releaseBindingKindValues)[number];
3
+
4
+ export const releaseBindingPlacementValues = [
5
+ 'same-package',
6
+ 'subpath',
7
+ 'extracted',
8
+ ] as const;
9
+ export type ReleaseBindingPlacement =
10
+ (typeof releaseBindingPlacementValues)[number];
11
+
12
+ export const releaseBindingCapabilityValues = [
13
+ 'pack-check',
14
+ 'publish',
15
+ 'registry-preflight',
16
+ ] as const;
17
+ export type ReleaseBindingCapability =
18
+ (typeof releaseBindingCapabilityValues)[number];
19
+
20
+ export interface ReleaseBindingDescriptor {
21
+ readonly boundary: 'foreign' | 'trails-owned';
22
+ readonly capabilities: readonly ReleaseBindingCapability[];
23
+ readonly description: string;
24
+ readonly id: string;
25
+ readonly kind: ReleaseBindingKind;
26
+ readonly placement: ReleaseBindingPlacement;
27
+ readonly runtime: string;
28
+ }
29
+
30
+ export const nativeBunReleaseBinding = {
31
+ boundary: 'trails-owned',
32
+ capabilities: ['pack-check', 'publish', 'registry-preflight'],
33
+ description:
34
+ 'Built-in Bun release binding for Trails-owned package pack checks, npm registry preflight, and lockstep package publication.',
35
+ id: 'release.binding.native-bun',
36
+ kind: 'native',
37
+ placement: 'same-package',
38
+ runtime: 'bun',
39
+ } satisfies ReleaseBindingDescriptor;