@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
@@ -5,12 +5,12 @@ import {
5
5
  wayfinderResolverSchema,
6
6
  wayfinderSourceModeSchema,
7
7
  wayfinderViewSchema,
8
- } from '@ontrails/wayfinder';
8
+ } from '@ontrails/topography';
9
9
  import type {
10
10
  WayfinderInclude,
11
11
  WayfinderResolver,
12
12
  WayfinderView,
13
- } from '@ontrails/wayfinder';
13
+ } from '@ontrails/topography';
14
14
  import { z } from 'zod';
15
15
 
16
16
  const wayfindInputSchema = z
@@ -19,7 +19,6 @@ const wayfindInputSchema = z
19
19
  .string()
20
20
  .optional()
21
21
  .describe('Filter graph facts delivered through an adapter package'),
22
- contours: z.boolean().default(false).describe('Resolve contour facts'),
23
22
  contract: z
24
23
  .boolean()
25
24
  .default(false)
@@ -39,6 +38,7 @@ const wayfindInputSchema = z
39
38
  .boolean()
40
39
  .default(false)
41
40
  .describe('Render the describe view for the selected target'),
41
+ entities: z.boolean().default(false).describe('Resolve entity facts'),
42
42
  errors: z.boolean().default(false).describe('Resolve trail error facts'),
43
43
  impact: z
44
44
  .boolean()
@@ -141,7 +141,7 @@ const wayfindInputSchema = z
141
141
  input.deps ||
142
142
  input.impact ||
143
143
  (input.adapter === undefined &&
144
- !input.contours &&
144
+ !input.entities &&
145
145
  !input.errors &&
146
146
  !input.trailheads &&
147
147
  input.intent === undefined &&
@@ -173,7 +173,7 @@ const wayfindInputSchema = z
173
173
  !input.impact &&
174
174
  input.include.length === 0 &&
175
175
  input.adapter === undefined &&
176
- !input.contours &&
176
+ !input.entities &&
177
177
  !input.errors &&
178
178
  !input.trailheads &&
179
179
  input.intent === undefined &&
@@ -234,7 +234,7 @@ const liveModuleInput = (
234
234
 
235
235
  const hasLiveTypedFilter = (input: WayfindInput): boolean =>
236
236
  input.adapter !== undefined ||
237
- input.contours ||
237
+ input.entities ||
238
238
  input.errors ||
239
239
  input.trailheads ||
240
240
  input.intent !== undefined ||
@@ -249,14 +249,14 @@ const populationFilters = (
249
249
  readonly intent?: WayfindInput['intent'];
250
250
  readonly kind?:
251
251
  | readonly (
252
- | 'contour'
252
+ | 'entity'
253
253
  | 'trailhead'
254
254
  | 'resource'
255
255
  | 'signal'
256
256
  | 'surface'
257
257
  | 'trail'
258
258
  )[]
259
- | 'contour'
259
+ | 'entity'
260
260
  | 'trailhead'
261
261
  | 'resource'
262
262
  | 'signal'
@@ -267,7 +267,7 @@ const populationFilters = (
267
267
  readonly surface?: readonly string[] | string | undefined;
268
268
  } => {
269
269
  const kinds = [
270
- ...(input.contours ? ['contour' as const] : []),
270
+ ...(input.entities ? ['entity' as const] : []),
271
271
  ...(input.trailheads ? ['trailhead' as const] : []),
272
272
  ...(input.resources ? ['resource' as const] : []),
273
273
  ...(input.signals ? ['signal' as const] : []),
@@ -719,9 +719,9 @@ const viewPopulation = async (
719
719
  view: 'list' as const,
720
720
  };
721
721
  }
722
- if (input.contours) {
722
+ if (input.entities) {
723
723
  return {
724
- result: ctx.compose('wayfind.contours', {
724
+ result: ctx.compose('wayfind.entities', {
725
725
  filters,
726
726
  limit: input.limit,
727
727
  ...sourceInput(input),
@@ -791,41 +791,6 @@ const viewPopulation = async (
791
791
 
792
792
  export const wayfindTrail = trail('wayfind.navigate', {
793
793
  args: ['target'],
794
- blaze: async (input, ctx) => {
795
- if (input.source === 'live') {
796
- const dispatched = await viewLiveSource(input, ctx);
797
- if (dispatched !== undefined) {
798
- return envelopeFor(
799
- await dispatched.result,
800
- input,
801
- ctx,
802
- dispatched.view
803
- );
804
- }
805
- }
806
- if (input.overlay !== undefined) {
807
- return envelopeFor(
808
- await ctx.compose('wayfind.overlay', {
809
- namespace: input.overlay,
810
- ...sourceInput(input),
811
- }),
812
- input,
813
- ctx,
814
- 'list'
815
- );
816
- }
817
- const dispatched =
818
- (await viewRelation(input, ctx)) ??
819
- (await (input.target === undefined
820
- ? viewPopulation(input, ctx)
821
- : viewTarget(input, ctx)));
822
- if (dispatched === undefined) {
823
- return Result.err(
824
- new ValidationError('Provide a Wayfinder target or population filter.')
825
- );
826
- }
827
- return envelopeFor(await dispatched.result, input, ctx, dispatched.view);
828
- },
829
794
  cli: {
830
795
  path: 'wayfind',
831
796
  },
@@ -834,7 +799,7 @@ export const wayfindTrail = trail('wayfind.navigate', {
834
799
  'survey',
835
800
  'wayfind.adapters',
836
801
  'wayfind.contract',
837
- 'wayfind.contours',
802
+ 'wayfind.entities',
838
803
  'wayfind.describe',
839
804
  'wayfind.errors',
840
805
  'wayfind.examples',
@@ -878,8 +843,8 @@ export const wayfindTrail = trail('wayfind.navigate', {
878
843
  name: 'List resource facts',
879
844
  },
880
845
  {
881
- input: { contours: true },
882
- name: 'List contour facts',
846
+ input: { entities: true },
847
+ name: 'List entity facts',
883
848
  },
884
849
  {
885
850
  input: { signals: true },
@@ -926,6 +891,41 @@ export const wayfindTrail = trail('wayfind.navigate', {
926
891
  name: 'List read trails',
927
892
  },
928
893
  ],
894
+ implementation: async (input, ctx) => {
895
+ if (input.source === 'live') {
896
+ const dispatched = await viewLiveSource(input, ctx);
897
+ if (dispatched !== undefined) {
898
+ return envelopeFor(
899
+ await dispatched.result,
900
+ input,
901
+ ctx,
902
+ dispatched.view
903
+ );
904
+ }
905
+ }
906
+ if (input.overlay !== undefined) {
907
+ return envelopeFor(
908
+ await ctx.compose('wayfind.overlay', {
909
+ namespace: input.overlay,
910
+ ...sourceInput(input),
911
+ }),
912
+ input,
913
+ ctx,
914
+ 'list'
915
+ );
916
+ }
917
+ const dispatched =
918
+ (await viewRelation(input, ctx)) ??
919
+ (await (input.target === undefined
920
+ ? viewPopulation(input, ctx)
921
+ : viewTarget(input, ctx)));
922
+ if (dispatched === undefined) {
923
+ return Result.err(
924
+ new ValidationError('Provide a Wayfinder target or population filter.')
925
+ );
926
+ }
927
+ return envelopeFor(await dispatched.result, input, ctx, dispatched.view);
928
+ },
929
929
  input: wayfindInputSchema,
930
930
  intent: 'read',
931
931
  output: wayfindOutputSchema,
@@ -963,14 +963,6 @@ const selectorSourceInput = (
963
963
 
964
964
  export const wayfindPatternTrail = trail('wayfind.pattern', {
965
965
  args: ['selector'],
966
- blaze: (input, ctx) =>
967
- ctx.compose('wayfind.navigate', {
968
- limit: input.limit,
969
- resolver: 'pattern',
970
- target: input.selector,
971
- view: 'list',
972
- ...selectorSourceInput(input),
973
- }),
974
966
  cli: {
975
967
  path: 'wayfind pattern',
976
968
  },
@@ -982,6 +974,14 @@ export const wayfindPatternTrail = trail('wayfind.pattern', {
982
974
  name: 'Find Wayfinder trails',
983
975
  },
984
976
  ],
977
+ implementation: (input, ctx) =>
978
+ ctx.compose('wayfind.navigate', {
979
+ limit: input.limit,
980
+ resolver: 'pattern',
981
+ target: input.selector,
982
+ view: 'list',
983
+ ...selectorSourceInput(input),
984
+ }),
985
985
  input: wayfindPatternInputSchema,
986
986
  intent: 'read',
987
987
  meta: {
@@ -993,14 +993,6 @@ export const wayfindPatternTrail = trail('wayfind.pattern', {
993
993
 
994
994
  export const wayfindQueryTrail = trail('wayfind.query', {
995
995
  args: ['selector'],
996
- blaze: (input, ctx) =>
997
- ctx.compose('wayfind.navigate', {
998
- limit: input.limit,
999
- resolver: 'query',
1000
- target: input.selector,
1001
- view: 'list',
1002
- ...selectorSourceInput(input),
1003
- }),
1004
996
  cli: {
1005
997
  path: 'wayfind query',
1006
998
  },
@@ -1012,6 +1004,14 @@ export const wayfindQueryTrail = trail('wayfind.query', {
1012
1004
  name: 'Find release drift facts',
1013
1005
  },
1014
1006
  ],
1007
+ implementation: (input, ctx) =>
1008
+ ctx.compose('wayfind.navigate', {
1009
+ limit: input.limit,
1010
+ resolver: 'query',
1011
+ target: input.selector,
1012
+ view: 'list',
1013
+ ...selectorSourceInput(input),
1014
+ }),
1015
1015
  input: wayfindQueryInputSchema,
1016
1016
  intent: 'read',
1017
1017
  meta: {
@@ -1023,15 +1023,6 @@ export const wayfindQueryTrail = trail('wayfind.query', {
1023
1023
 
1024
1024
  export const wayfindFileTrail = trail('wayfind.file', {
1025
1025
  args: ['selector'],
1026
- blaze: (input, ctx) =>
1027
- ctx.compose('wayfind.navigate', {
1028
- limit: input.limit,
1029
- outline: input.outline,
1030
- resolver: 'file',
1031
- target: input.selector,
1032
- view: 'outline',
1033
- ...selectorSourceInput(input),
1034
- }),
1035
1026
  cli: {
1036
1027
  path: 'wayfind file',
1037
1028
  },
@@ -1043,6 +1034,15 @@ export const wayfindFileTrail = trail('wayfind.file', {
1043
1034
  name: 'Outline the Trails app module',
1044
1035
  },
1045
1036
  ],
1037
+ implementation: (input, ctx) =>
1038
+ ctx.compose('wayfind.navigate', {
1039
+ limit: input.limit,
1040
+ outline: input.outline,
1041
+ resolver: 'file',
1042
+ target: input.selector,
1043
+ view: 'outline',
1044
+ ...selectorSourceInput(input),
1045
+ }),
1046
1046
  input: wayfindFileInputSchema,
1047
1047
  intent: 'read',
1048
1048
  meta: {