@ontrails/trails 1.0.0-beta.39 → 1.0.0-beta.41

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 (58) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +1 -1
  3. package/package.json +17 -17
  4. package/src/app.ts +4 -4
  5. package/src/cli.ts +1 -1
  6. package/src/completions.ts +1 -1
  7. package/src/mcp-app.ts +2 -2
  8. package/src/regrade/history.ts +148 -38
  9. package/src/regrade/plan-artifact.ts +31 -11
  10. package/src/release/native-bun-registry.ts +12 -1
  11. package/src/release/policy.ts +4 -1
  12. package/src/retired-topo-command.ts +1 -1
  13. package/src/run-watch.ts +1 -1
  14. package/src/run-wayfind-outline.ts +6 -2
  15. package/src/trails/adapter-check.ts +8 -8
  16. package/src/trails/add-surface.ts +2 -2
  17. package/src/trails/add-trail.ts +3 -3
  18. package/src/trails/add-verify.ts +2 -2
  19. package/src/trails/compile.ts +9 -9
  20. package/src/trails/completions-complete.ts +10 -10
  21. package/src/trails/completions.ts +2 -2
  22. package/src/trails/create-adapter.ts +185 -424
  23. package/src/trails/create-scaffold.ts +12 -12
  24. package/src/trails/create-versions.ts +8 -8
  25. package/src/trails/create.ts +35 -35
  26. package/src/trails/deprecate.ts +2 -2
  27. package/src/trails/dev-clean.ts +11 -11
  28. package/src/trails/dev-reset.ts +11 -11
  29. package/src/trails/dev-stats.ts +8 -8
  30. package/src/trails/dev-support.ts +1 -1
  31. package/src/trails/doctor.ts +4 -4
  32. package/src/trails/draft-promote.ts +3 -3
  33. package/src/trails/guide.ts +9 -9
  34. package/src/trails/load-app.ts +3 -3
  35. package/src/trails/regrade.ts +56 -27
  36. package/src/trails/release-check.ts +8 -8
  37. package/src/trails/release-smoke.ts +2 -2
  38. package/src/trails/revise.ts +2 -2
  39. package/src/trails/run-example.ts +9 -9
  40. package/src/trails/run-examples.ts +9 -9
  41. package/src/trails/run.ts +26 -26
  42. package/src/trails/survey.ts +45 -45
  43. package/src/trails/topo-activation.ts +2 -2
  44. package/src/trails/topo-history.ts +8 -8
  45. package/src/trails/topo-output-schemas.ts +5 -5
  46. package/src/trails/topo-pin.ts +6 -6
  47. package/src/trails/topo-read-support.ts +4 -3
  48. package/src/trails/topo-reports.ts +16 -16
  49. package/src/trails/topo-store-support.ts +18 -9
  50. package/src/trails/topo-support.ts +2 -2
  51. package/src/trails/topo-unpin.ts +12 -12
  52. package/src/trails/topo.ts +4 -4
  53. package/src/trails/validate.ts +2 -2
  54. package/src/trails/version-lifecycle-support.ts +17 -16
  55. package/src/trails/warden-guide.ts +8 -8
  56. package/src/trails/warden.ts +21 -21
  57. package/src/trails/wayfind-outline.ts +876 -0
  58. package/src/trails/wayfind.ts +74 -74
@@ -208,7 +208,14 @@ export const formatAdapterCheckReport = (
208
208
  };
209
209
 
210
210
  export const adapterCheckTrail = trail('adapter.check', {
211
- blaze: (input, ctx) => {
211
+ description: 'Check adapter authoring readiness',
212
+ examples: [
213
+ {
214
+ input: {},
215
+ name: 'Check adapters in the current workspace',
216
+ },
217
+ ],
218
+ implementation: (input, ctx) => {
212
219
  const rootDirResult = resolveTrailRootDir(input.rootDir, ctx.cwd);
213
220
  if (rootDirResult.isErr()) {
214
221
  return rootDirResult;
@@ -230,13 +237,6 @@ export const adapterCheckTrail = trail('adapter.check', {
230
237
  targets: [...report.targets],
231
238
  });
232
239
  },
233
- description: 'Check adapter authoring readiness',
234
- examples: [
235
- {
236
- input: {},
237
- name: 'Check adapters in the current workspace',
238
- },
239
- ],
240
240
  input: adapterCheckInputSchema,
241
241
  intent: 'read',
242
242
  output: adapterCheckOutputSchema,
@@ -132,7 +132,8 @@ const writeSurfaceEntry = async (
132
132
  };
133
133
 
134
134
  export const addSurface = trail('add.surface', {
135
- blaze: async (input) => {
135
+ description: 'Add a surface to an existing project',
136
+ implementation: async (input) => {
136
137
  const cwd = resolve(input.dir ?? '.');
137
138
  const { surface } = input;
138
139
  const entryFile = getEntryFile(surface);
@@ -160,7 +161,6 @@ export const addSurface = trail('add.surface', {
160
161
  dependency: dependency.value,
161
162
  });
162
163
  },
163
- description: 'Add a surface to an existing project',
164
164
  input: z.object({
165
165
  dir: z.string().optional().describe('Project directory'),
166
166
  surface: z.enum(['cli', 'http', 'mcp']).describe('Surface to add'),
@@ -39,7 +39,7 @@ const generateTrailFile = (
39
39
  import { z } from 'zod';
40
40
 
41
41
  export const ${trailName} = trail(${literal(id)}, {
42
- blaze: async () => {
42
+ implementation: async () => {
43
43
  return Result.ok({ message: ${literal(exampleMessage)} });
44
44
  },
45
45
  description: ${literal(description)},
@@ -79,7 +79,8 @@ testTrail(${trailName}, [
79
79
 
80
80
  export const addTrail = trail('add.trail', {
81
81
  args: ['id'],
82
- blaze: async (input, ctx) => {
82
+ description: 'Scaffold a new trail with tests and examples',
83
+ implementation: async (input, ctx) => {
83
84
  const { id } = input;
84
85
  const validated = validateTrailId(id);
85
86
  if (validated.isErr()) {
@@ -114,7 +115,6 @@ export const addTrail = trail('add.trail', {
114
115
 
115
116
  return Result.ok({ created: [...files.keys()] });
116
117
  },
117
- description: 'Scaffold a new trail with tests and examples',
118
118
  input: z.object({
119
119
  description: z
120
120
  .string()
@@ -92,7 +92,8 @@ const updatePackageJsonForVerify = async (
92
92
  // ---------------------------------------------------------------------------
93
93
 
94
94
  export const addVerify = trail('add.verify', {
95
- blaze: async (input) => {
95
+ description: 'Add testing and warden verification',
96
+ implementation: async (input) => {
96
97
  const projectDirResult = resolveProjectDir(input.dir ?? '.', input.name);
97
98
  if (projectDirResult.isErr()) {
98
99
  return projectDirResult;
@@ -141,7 +142,6 @@ export const addVerify = trail('add.verify', {
141
142
 
142
143
  return Result.ok({ created: files });
143
144
  },
144
- description: 'Add testing and warden verification',
145
145
  input: z.object({
146
146
  dir: z.string().optional().describe('Parent directory'),
147
147
  name: z
@@ -1,6 +1,6 @@
1
1
  import { trail } from '@ontrails/core';
2
2
  import type { Result, Topo } from '@ontrails/core';
3
- import type { TopoGraphOverlayRegistration } from '@ontrails/topographer';
3
+ import type { TopoGraphOverlayRegistration } from '@ontrails/topography';
4
4
  import { z } from 'zod';
5
5
 
6
6
  import { withFreshOperatorApp } from './operator-context.js';
@@ -32,14 +32,6 @@ const compileTrailInputSchema = z.object({
32
32
  type CompileTrailInput = z.output<typeof compileTrailInputSchema>;
33
33
 
34
34
  export const compileTrail = trail('compile', {
35
- blaze: async (input: CompileTrailInput, ctx) =>
36
- withFreshOperatorApp(input, ctx, ({ lease, rootDir }) =>
37
- compileCurrentTopo(lease.app, {
38
- force: input.force,
39
- overlays: lease.overlays,
40
- rootDir,
41
- })
42
- ),
43
35
  description: 'Compile the current topo to trails.lock',
44
36
  examples: [
45
37
  {
@@ -47,6 +39,14 @@ export const compileTrail = trail('compile', {
47
39
  name: 'Compile the current topo to trails.lock',
48
40
  },
49
41
  ],
42
+ implementation: async (input: CompileTrailInput, ctx) =>
43
+ withFreshOperatorApp(input, ctx, ({ lease, rootDir }) =>
44
+ compileCurrentTopo(lease.app, {
45
+ force: input.force,
46
+ overlays: lease.overlays,
47
+ rootDir,
48
+ })
49
+ ),
50
50
  input: compileTrailInputSchema,
51
51
  intent: 'write',
52
52
  output: z.object({
@@ -118,7 +118,16 @@ const SUBCOMMAND_HANDLERS: Readonly<Record<string, CompletionHandler>> = {
118
118
  };
119
119
 
120
120
  export const completionsCompleteTrail = trail('completions.__complete', {
121
- blaze: async (input, ctx) => {
121
+ description:
122
+ 'Internal: emit dynamic completion suggestions for the current partial argv. Invoked by the static shell completion script at tab-press time.',
123
+ examples: [
124
+ {
125
+ description: 'Empty argv yields no suggestions',
126
+ input: { args: [] },
127
+ name: 'Empty args',
128
+ },
129
+ ],
130
+ implementation: async (input, ctx) => {
122
131
  const rootDirResult = resolveTrailRootDir(input.rootDir, ctx.cwd);
123
132
  if (rootDirResult.isErr()) {
124
133
  return rootDirResult;
@@ -138,15 +147,6 @@ export const completionsCompleteTrail = trail('completions.__complete', {
138
147
  const suggestions = await handler({ args: input.args, rootDir });
139
148
  return Result.ok(renderSuggestions(suggestions));
140
149
  },
141
- description:
142
- 'Internal: emit dynamic completion suggestions for the current partial argv. Invoked by the static shell completion script at tab-press time.',
143
- examples: [
144
- {
145
- description: 'Empty argv yields no suggestions',
146
- input: { args: [] },
147
- name: 'Empty args',
148
- },
149
- ],
150
150
  input: z.object({
151
151
  args: z
152
152
  .array(z.string())
@@ -16,8 +16,6 @@ const COMPLETIONS_BIN_NAME = 'trails';
16
16
 
17
17
  export const completionsTrail = trail('completions', {
18
18
  args: ['shell'],
19
- blaze: async (input) =>
20
- renderCompletionScript(input.shell, COMPLETIONS_BIN_NAME),
21
19
  description:
22
20
  'Print a shell completion script for the trails CLI; pipe into your shell rc to register tab-completion',
23
21
  examples: [
@@ -37,6 +35,8 @@ export const completionsTrail = trail('completions', {
37
35
  name: 'Render fish completion',
38
36
  },
39
37
  ],
38
+ implementation: async (input) =>
39
+ renderCompletionScript(input.shell, COMPLETIONS_BIN_NAME),
40
40
  input: z.object({
41
41
  shell: z
42
42
  .enum(['bash', 'zsh', 'fish'])