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

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 (45) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/README.md +7 -10
  3. package/package.json +13 -12
  4. package/src/app.ts +14 -4
  5. package/src/cli.ts +16 -0
  6. package/src/lifecycle-source-io.ts +33 -0
  7. package/src/project-writes.ts +62 -5
  8. package/src/retired-topo-command.ts +36 -0
  9. package/src/run-adapter-check.ts +76 -0
  10. package/src/run-collision.ts +1 -0
  11. package/src/trails/adapter-check.ts +244 -0
  12. package/src/trails/add-surface.ts +18 -18
  13. package/src/trails/add-trail.ts +3 -2
  14. package/src/trails/add-verify.ts +30 -6
  15. package/src/trails/{topo-compile.ts → compile.ts} +16 -8
  16. package/src/trails/completions-complete.ts +1 -1
  17. package/src/trails/create-adapter.ts +1084 -0
  18. package/src/trails/create-scaffold.ts +243 -29
  19. package/src/trails/create.ts +118 -17
  20. package/src/trails/deprecate.ts +59 -0
  21. package/src/trails/dev-clean.ts +2 -2
  22. package/src/trails/dev-reset.ts +2 -2
  23. package/src/trails/dev-stats.ts +1 -1
  24. package/src/trails/doctor.ts +56 -0
  25. package/src/trails/draft-promote.ts +1 -0
  26. package/src/trails/guide.ts +2 -2
  27. package/src/trails/revise.ts +53 -0
  28. package/src/trails/run-example.ts +12 -7
  29. package/src/trails/run-examples.ts +3 -3
  30. package/src/trails/run.ts +7 -4
  31. package/src/trails/survey.ts +332 -25
  32. package/src/trails/topo-history.ts +1 -1
  33. package/src/trails/topo-output-schemas.ts +30 -1
  34. package/src/trails/topo-pin.ts +3 -2
  35. package/src/trails/topo-read-support.ts +49 -8
  36. package/src/trails/topo-reports.ts +39 -22
  37. package/src/trails/topo-store-support.ts +62 -16
  38. package/src/trails/topo-support.ts +1 -1
  39. package/src/trails/topo-unpin.ts +2 -2
  40. package/src/trails/topo.ts +2 -2
  41. package/src/trails/{topo-verify.ts → validate.ts} +7 -7
  42. package/src/trails/version-lifecycle-support.ts +945 -0
  43. package/src/trails/warden-guide.ts +8 -0
  44. package/src/trails/warden.ts +18 -2
  45. package/src/versions.ts +4 -1
@@ -4,6 +4,8 @@ import {
4
4
  buildWardenGuideManifest,
5
5
  formatWardenGuide,
6
6
  wardenDepthValues,
7
+ wardenFixClasses,
8
+ wardenFixSafeties,
7
9
  wardenGuideFormatValues,
8
10
  wardenRuleConcerns,
9
11
  wardenRuleLifecycleStates,
@@ -31,6 +33,12 @@ const wardenRuleGuideEntrySchema = z.object({
31
33
  depth: z.enum(wardenDepthValues),
32
34
  description: z.string(),
33
35
  docs: z.array(wardenGuidanceLinkSchema).readonly(),
36
+ fix: z
37
+ .object({
38
+ class: z.enum(wardenFixClasses),
39
+ safety: z.enum(wardenFixSafeties),
40
+ })
41
+ .optional(),
34
42
  guidance: wardenGuidanceSchema.optional(),
35
43
  id: z.string(),
36
44
  invariant: z.string(),
@@ -23,6 +23,10 @@ import { resolveTrailRootDir } from './root-dir.js';
23
23
  // ---------------------------------------------------------------------------
24
24
 
25
25
  const wardenInputSchema = z.object({
26
+ adapterCheck: z
27
+ .boolean()
28
+ .default(false)
29
+ .describe('Run shared adapter authoring checks'),
26
30
  apps: z
27
31
  .array(z.string())
28
32
  .optional()
@@ -40,6 +44,7 @@ const wardenInputSchema = z.object({
40
44
  .default(false)
41
45
  .describe('Alias for --drafts exclude'),
42
46
  failOn: z.enum(wardenFailOnValues).optional().describe('Failure threshold'),
47
+ fix: z.boolean().default(false).describe('Apply safe source fixes'),
43
48
  format: z.enum(wardenFormatValues).optional().describe('Output format'),
44
49
  github: z.boolean().default(false).describe('Alias for --format github'),
45
50
  includeDrafts: z
@@ -129,6 +134,8 @@ export const buildWardenCommandArgs = (
129
134
  pushValue(args, '--drafts', input.drafts);
130
135
  }
131
136
  pushFlag(args, input.noLockMutation, '--no-lock-mutation');
137
+ pushFlag(args, input.fix, '--fix');
138
+ pushFlag(args, input.adapterCheck, '--adapter-check');
132
139
  pushValue(args, '--config-path', input.configPath);
133
140
  pushApps(args, input.apps);
134
141
 
@@ -139,7 +146,7 @@ export const wardenTrail = trail('warden', {
139
146
  blaze: async (input, ctx) => {
140
147
  const rootDirResult = resolveTrailRootDir(input.rootDir, ctx.cwd);
141
148
  if (rootDirResult.isErr()) {
142
- return Result.err(rootDirResult.error);
149
+ return rootDirResult;
143
150
  }
144
151
  const rootDir = rootDirResult.value;
145
152
  const result = await runWardenCommand({
@@ -153,6 +160,7 @@ export const wardenTrail = trail('warden', {
153
160
  diagnostics: [...report.diagnostics],
154
161
  drift: report.drift,
155
162
  errorCount: report.errorCount,
163
+ fixes: report.fixes,
156
164
  formatted: result.output,
157
165
  passed: report.passed,
158
166
  warnCount: report.warnCount,
@@ -174,7 +182,7 @@ export const wardenTrail = trail('warden', {
174
182
  },
175
183
  ],
176
184
  input: wardenInputSchema,
177
- intent: 'read',
185
+ intent: 'write',
178
186
  output: z.object({
179
187
  diagnostics: z.array(
180
188
  diagnosticSchema.extend({ topoName: z.string().optional() })
@@ -188,8 +196,16 @@ export const wardenTrail = trail('warden', {
188
196
  })
189
197
  .nullable(),
190
198
  errorCount: z.number(),
199
+ fixes: z
200
+ .object({
201
+ applied: z.number(),
202
+ filesChanged: z.number(),
203
+ skipped: z.number(),
204
+ })
205
+ .optional(),
191
206
  formatted: z.string(),
192
207
  passed: z.boolean(),
193
208
  warnCount: z.number(),
194
209
  }),
210
+ permit: 'public',
195
211
  });
package/src/versions.ts CHANGED
@@ -23,6 +23,9 @@ export const trailsPackageVersion = requireVersion(
23
23
  '@ontrails/trails'
24
24
  );
25
25
 
26
- export const ontrailsPackageRange = `^${trailsPackageVersion}`;
26
+ export const ontrailsPackageRange = requireVersion(
27
+ trailsPackageVersion,
28
+ '@ontrails/* scaffold package range'
29
+ );
27
30
 
28
31
  export { scaffoldDependencyVersions };