@cleocode/contracts 2026.5.62 → 2026.5.64

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 (36) hide show
  1. package/dist/__tests__/llm-config-schema.test.d.ts +20 -0
  2. package/dist/__tests__/llm-config-schema.test.d.ts.map +1 -0
  3. package/dist/__tests__/llm-config-schema.test.js +121 -0
  4. package/dist/__tests__/llm-config-schema.test.js.map +1 -0
  5. package/dist/config.d.ts +95 -5
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/index.d.ts +6 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/operations/llm.d.ts +380 -0
  11. package/dist/operations/llm.d.ts.map +1 -1
  12. package/dist/project-context.d.ts +69 -0
  13. package/dist/project-context.d.ts.map +1 -0
  14. package/dist/project-context.js +14 -0
  15. package/dist/project-context.js.map +1 -0
  16. package/dist/release/channel.d.ts +20 -0
  17. package/dist/release/channel.d.ts.map +1 -0
  18. package/dist/release/channel.js +12 -0
  19. package/dist/release/channel.js.map +1 -0
  20. package/dist/release/github-pr.d.ts +79 -0
  21. package/dist/release/github-pr.d.ts.map +1 -0
  22. package/dist/release/github-pr.js +12 -0
  23. package/dist/release/github-pr.js.map +1 -0
  24. package/dist/release/version-bump.d.ts +73 -0
  25. package/dist/release/version-bump.d.ts.map +1 -0
  26. package/dist/release/version-bump.js +12 -0
  27. package/dist/release/version-bump.js.map +1 -0
  28. package/package.json +2 -2
  29. package/src/__tests__/llm-config-schema.test.ts +135 -0
  30. package/src/config.ts +100 -5
  31. package/src/index.ts +67 -0
  32. package/src/operations/llm.ts +437 -0
  33. package/src/project-context.ts +106 -0
  34. package/src/release/channel.ts +21 -0
  35. package/src/release/github-pr.ts +89 -0
  36. package/src/release/version-bump.ts +79 -0
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Version-bump contracts — types describing how `cleo release ship` finds
3
+ * and updates version-bearing files across a project's ecosystem(s).
4
+ *
5
+ * The implementation lives in `@cleocode/core/release/version-bump.ts`. The
6
+ * types live here so contracts consumers (CLI, studio, downstream tools)
7
+ * can describe / validate the same shapes without depending on core.
8
+ *
9
+ * @adr ADR-063
10
+ */
11
+
12
+ /** Supported version-bump strategies. */
13
+ export type VersionBumpStrategy = 'plain' | 'json' | 'toml' | 'sed';
14
+
15
+ /**
16
+ * Version bump target — a single file the release pipeline knows how to
17
+ * bump. Discovery returns these, an explicit config in
18
+ * `.cleo/config.json` (`release.versionBump.files`) populates them.
19
+ */
20
+ export interface VersionBumpTarget {
21
+ /** Path relative to the project root. */
22
+ file: string;
23
+ /** Update strategy. */
24
+ strategy: VersionBumpStrategy;
25
+ /** JSON field path for `strategy='json'` (e.g. `version`, `package.version`). */
26
+ field?: string;
27
+ /** TOML key for `strategy='toml'` (default: `version`). */
28
+ key?: string;
29
+ /** TOML section for `strategy='toml'` (e.g. `package`, `workspace.package`). */
30
+ section?: string;
31
+ /** Sed pattern with `{{VERSION}}` placeholder for `strategy='sed'`. */
32
+ pattern?: string;
33
+ }
34
+
35
+ /** Bump type used by `calculateNewVersion`. */
36
+ export type BumpType = 'patch' | 'minor' | 'major';
37
+
38
+ /** Result for a single file's bump attempt. */
39
+ export interface BumpResult {
40
+ /** Path relative to the project root. */
41
+ file: string;
42
+ /** Strategy used. */
43
+ strategy: VersionBumpStrategy | string;
44
+ /** Whether the bump succeeded. */
45
+ success: boolean;
46
+ /** Version found in the file before the bump, if it could be extracted. */
47
+ previousVersion?: string;
48
+ /** Version written to the file. */
49
+ newVersion?: string;
50
+ /** Human-readable error when `success === false`. */
51
+ error?: string;
52
+ }
53
+
54
+ /**
55
+ * Where the version-bump targets came from. Lets callers log / diagnose why
56
+ * a release commit included or omitted version files.
57
+ */
58
+ export type VersionBumpTargetSource = 'config' | 'workspace' | 'none';
59
+
60
+ /** Envelope returned by `resolveVersionBumpTargets`. */
61
+ export interface ResolveVersionBumpTargetsResult {
62
+ /** Targets to bump. Empty when `source === 'none'`. */
63
+ targets: VersionBumpTarget[];
64
+ /**
65
+ * How the targets were resolved:
66
+ * - `'config'` — explicit `release.versionBump.files` entry
67
+ * - `'workspace'` — auto-discovered from filesystem markers
68
+ * - `'none'` — neither config nor a recognised workspace
69
+ */
70
+ source: VersionBumpTargetSource;
71
+ }
72
+
73
+ /** Bulk-bump result envelope. */
74
+ export interface BumpVersionFromConfigResult {
75
+ /** Per-file results. */
76
+ results: BumpResult[];
77
+ /** `true` iff every result succeeded. */
78
+ allSuccess: boolean;
79
+ }