@contractspec/bundle.workspace 4.4.0 → 4.5.0

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 (51) hide show
  1. package/dist/index.js +873 -552
  2. package/dist/node/index.js +873 -552
  3. package/dist/services/adoption/catalog-core.d.ts +2 -0
  4. package/dist/services/adoption/catalog-entry.d.ts +2 -0
  5. package/dist/services/adoption/catalog-runtime.d.ts +2 -0
  6. package/dist/services/adoption/catalog-shared.d.ts +2 -0
  7. package/dist/services/adoption/catalog-solutions.d.ts +2 -0
  8. package/dist/services/adoption/catalog-ui.d.ts +2 -0
  9. package/dist/services/adoption/catalog.d.ts +3 -0
  10. package/dist/services/adoption/index.d.ts +6 -0
  11. package/dist/services/adoption/resolve.d.ts +6 -0
  12. package/dist/services/adoption/resolve.test.d.ts +1 -0
  13. package/dist/services/adoption/tokens.d.ts +6 -0
  14. package/dist/services/adoption/types.d.ts +99 -0
  15. package/dist/services/adoption/workspace-scan.d.ts +8 -0
  16. package/dist/services/adoption/workspace.d.ts +3 -0
  17. package/dist/services/connect/adoption.d.ts +10 -0
  18. package/dist/services/connect/types.d.ts +1 -1
  19. package/dist/services/deps.d.ts +1 -1
  20. package/dist/services/doctor/checks/config.test.d.ts +1 -0
  21. package/dist/services/index.d.ts +3 -0
  22. package/dist/services/integrity.d.ts +1 -1
  23. package/dist/services/onboarding/catalog.d.ts +4 -0
  24. package/dist/services/onboarding/index.d.ts +4 -0
  25. package/dist/services/onboarding/journey.d.ts +11 -0
  26. package/dist/services/onboarding/render.d.ts +5 -0
  27. package/dist/services/onboarding/service.d.ts +5 -0
  28. package/dist/services/onboarding/service.test.d.ts +1 -0
  29. package/dist/services/onboarding/types.d.ts +71 -0
  30. package/dist/services/setup/config-generators.d.ts +4 -0
  31. package/dist/services/setup/index.d.ts +3 -0
  32. package/dist/services/setup/managed-markdown.d.ts +8 -0
  33. package/dist/services/setup/targets/agents-md.d.ts +2 -0
  34. package/dist/services/setup/targets/index.d.ts +1 -0
  35. package/dist/services/setup/targets/usage-md.d.ts +5 -0
  36. package/dist/services/setup/targets/usage-md.test.d.ts +1 -0
  37. package/dist/services/setup/types.d.ts +2 -2
  38. package/dist/services/validate/spec-validator.d.ts +1 -1
  39. package/dist/services/validate/spec-validator.test.d.ts +1 -0
  40. package/dist/services/versioning/index.d.ts +1 -0
  41. package/dist/services/versioning/release-authoring.d.ts +14 -0
  42. package/dist/services/versioning/release-authoring.test.d.ts +1 -0
  43. package/dist/services/versioning/release-files.d.ts +7 -0
  44. package/dist/services/versioning/release-service.types.d.ts +53 -1
  45. package/dist/templates/additional-contracts.template.d.ts +40 -0
  46. package/dist/templates/advanced-contracts.template.d.ts +39 -0
  47. package/dist/templates/index.d.ts +3 -0
  48. package/dist/templates/theme.template.d.ts +12 -0
  49. package/dist/templates/theme.template.test.d.ts +1 -0
  50. package/dist/types.d.ts +16 -11
  51. package/package.json +10 -9
@@ -0,0 +1,2 @@
1
+ import type { AdoptionCatalogEntry } from './types';
2
+ export declare const CORE_CATALOG_ENTRIES: AdoptionCatalogEntry[];
@@ -0,0 +1,2 @@
1
+ import type { AdoptionCatalogEntry, AdoptionFamily, AdoptionPackageKind } from './types';
2
+ export declare function createCatalogEntry(id: string, packageRef: string, family: AdoptionFamily, packageKind: AdoptionPackageKind, resolutionPriority: number, capabilityTags: string[], preferredUseCases: string[], description: string, options?: Partial<Pick<AdoptionCatalogEntry, 'avoidWhen' | 'platforms' | 'replacementImportHints' | 'runtimes' | 'title'>>): AdoptionCatalogEntry;
@@ -0,0 +1,2 @@
1
+ import type { AdoptionCatalogEntry } from './types';
2
+ export declare const RUNTIME_CATALOG_ENTRIES: AdoptionCatalogEntry[];
@@ -0,0 +1,2 @@
1
+ import type { AdoptionCatalogEntry } from './types';
2
+ export declare const SHARED_CATALOG_ENTRIES: AdoptionCatalogEntry[];
@@ -0,0 +1,2 @@
1
+ import type { AdoptionCatalogEntry } from './types';
2
+ export declare const SOLUTION_CATALOG_ENTRIES: AdoptionCatalogEntry[];
@@ -0,0 +1,2 @@
1
+ import type { AdoptionCatalogEntry } from './types';
2
+ export declare const UI_CATALOG_ENTRIES: AdoptionCatalogEntry[];
@@ -0,0 +1,3 @@
1
+ import type { AdoptionCatalogDocument, AdoptionCatalogEntry } from './types';
2
+ export declare function getContractSpecAdoptionCatalog(): AdoptionCatalogEntry[];
3
+ export declare function createAdoptionCatalogDocument(now?: Date): AdoptionCatalogDocument;
@@ -0,0 +1,6 @@
1
+ export * from './catalog';
2
+ export * from './resolve';
3
+ export * from './tokens';
4
+ export * from './types';
5
+ export * from './workspace';
6
+ export * from './workspace-scan';
@@ -0,0 +1,6 @@
1
+ import type { AdoptionResolution, AdoptionResolveInput, AdoptionResolverRuntime, AdoptionSyncInput } from './types';
2
+ export declare function resolveAdoption(runtime: AdoptionResolverRuntime, input: AdoptionResolveInput): Promise<AdoptionResolution>;
3
+ export declare function syncAdoptionCatalog(runtime: AdoptionResolverRuntime, input?: AdoptionSyncInput): Promise<{
4
+ catalog: import("./types").AdoptionCatalogDocument;
5
+ catalogPath: string;
6
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { AdoptionCandidate } from './types';
2
+ export declare function normalizeText(value: string): string;
3
+ export declare function tokenize(value: string): string[];
4
+ export declare function uniqueTokens(values: string[]): string[];
5
+ export declare function candidateTokens(candidate: AdoptionCandidate): string[];
6
+ export declare function overlap(left: string[], right: string[]): number;
@@ -0,0 +1,99 @@
1
+ import type { ConnectAdoptionConfig, ConnectAdoptionFamily, ConnectVerdict, ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec/workspace-config';
2
+ import type { FsAdapter } from '../../ports/fs';
3
+ export type AdoptionFamily = ConnectAdoptionFamily;
4
+ export type AdoptionVerdict = ConnectVerdict;
5
+ export type AdoptionSource = 'workspace' | 'contractspec' | 'ecosystem';
6
+ export type AdoptionPackageKind = 'primitive' | 'adapter' | 'module' | 'bundle' | 'app' | 'example';
7
+ export interface AdoptionImportHint {
8
+ from: string;
9
+ to: string;
10
+ note?: string;
11
+ }
12
+ export interface AdoptionCatalogEntry {
13
+ id: string;
14
+ source: Exclude<AdoptionSource, 'workspace'>;
15
+ packageRef: string;
16
+ family: AdoptionFamily;
17
+ packageKind: AdoptionPackageKind;
18
+ title: string;
19
+ description: string;
20
+ capabilityTags: string[];
21
+ preferredUseCases: string[];
22
+ avoidWhen?: string[];
23
+ platforms?: string[];
24
+ runtimes?: string[];
25
+ replacementImportHints?: AdoptionImportHint[];
26
+ resolutionPriority: number;
27
+ }
28
+ export interface AdoptionWorkspaceCandidate {
29
+ id: string;
30
+ source: 'workspace';
31
+ family: AdoptionFamily;
32
+ title: string;
33
+ description: string;
34
+ filePath?: string;
35
+ packageRef?: string;
36
+ packageKind?: AdoptionPackageKind;
37
+ capabilityTags: string[];
38
+ preferredUseCases: string[];
39
+ resolutionPriority: number;
40
+ }
41
+ export type AdoptionCandidate = AdoptionCatalogEntry | AdoptionWorkspaceCandidate;
42
+ export interface AdoptionCatalogDocument {
43
+ version: 1;
44
+ generatedAt: string;
45
+ entries: AdoptionCatalogEntry[];
46
+ }
47
+ export interface AdoptionWorkspaceIndex {
48
+ packageCandidates: AdoptionWorkspaceCandidate[];
49
+ fileCandidates: AdoptionWorkspaceCandidate[];
50
+ }
51
+ export interface AdoptionResolveInput {
52
+ family: AdoptionFamily;
53
+ query?: string;
54
+ symbol?: string;
55
+ paths?: string[];
56
+ platform?: string;
57
+ runtime?: string;
58
+ currentTarget?: string;
59
+ config?: ResolvedContractsrcConfig;
60
+ cwd?: string;
61
+ workspaceRoot?: string;
62
+ packageRoot?: string;
63
+ }
64
+ export interface AdoptionResolutionCandidate {
65
+ candidate: AdoptionCandidate;
66
+ score: number;
67
+ matchReasons: string[];
68
+ }
69
+ export interface AdoptionResolution {
70
+ family: AdoptionFamily;
71
+ verdict: AdoptionVerdict;
72
+ selected: AdoptionResolutionCandidate | null;
73
+ candidates: AdoptionResolutionCandidate[];
74
+ ambiguous: boolean;
75
+ exhausted: boolean;
76
+ reason: string;
77
+ currentTarget?: string;
78
+ query: string;
79
+ }
80
+ export interface AdoptionSyncInput {
81
+ config?: ResolvedContractsrcConfig;
82
+ cwd?: string;
83
+ workspaceRoot?: string;
84
+ packageRoot?: string;
85
+ }
86
+ export interface AdoptionSyncResult {
87
+ catalogPath: string;
88
+ catalog: AdoptionCatalogDocument;
89
+ }
90
+ export interface AdoptionResolvedWorkspace {
91
+ cwd: string;
92
+ workspaceRoot: string;
93
+ packageRoot: string;
94
+ config: ResolvedContractsrcConfig;
95
+ adoption: NonNullable<ConnectAdoptionConfig>;
96
+ }
97
+ export interface AdoptionResolverRuntime {
98
+ fs: FsAdapter;
99
+ }
@@ -0,0 +1,8 @@
1
+ import type { FsAdapter } from '../../ports/fs';
2
+ import type { AdoptionFamily, AdoptionResolvedWorkspace, AdoptionWorkspaceCandidate } from './types';
3
+ export declare function scanWorkspaceAdoptionCandidates(fs: FsAdapter, workspace: AdoptionResolvedWorkspace): Promise<{
4
+ fileCandidates: AdoptionWorkspaceCandidate[];
5
+ packageCandidates: AdoptionWorkspaceCandidate[];
6
+ }>;
7
+ export declare function hasLocalShadcnRegistry(fs: FsAdapter, workspace: AdoptionResolvedWorkspace): Promise<boolean>;
8
+ export declare function inferFamilyFromPath(path: string): AdoptionFamily | null;
@@ -0,0 +1,3 @@
1
+ import type { FsAdapter } from '../../ports/fs';
2
+ import type { AdoptionResolvedWorkspace, AdoptionSyncInput } from './types';
3
+ export declare function resolveAdoptionWorkspace(fs: FsAdapter, input?: AdoptionSyncInput): Promise<AdoptionResolvedWorkspace>;
@@ -0,0 +1,10 @@
1
+ import type { WorkspaceAdapters } from '../../ports/logger';
2
+ import * as adoption from '../adoption/index';
3
+ import type { ConnectPatchVerdict, ConnectVerdict, ConnectVerifyInput } from './types';
4
+ export declare function evaluateConnectAdoption(adapters: Pick<WorkspaceAdapters, 'fs'>, input: ConnectVerifyInput): Promise<{
5
+ check?: ConnectPatchVerdict['checks'][number];
6
+ reason?: string;
7
+ remediation?: string[];
8
+ resolution?: Awaited<ReturnType<typeof adoption.resolveAdoption>>;
9
+ verdict?: ConnectVerdict;
10
+ }>;
@@ -3,7 +3,7 @@ import type { SetupFileResult, SetupGitignoreBehavior, SetupPromptCallbacks } fr
3
3
  export type { ConnectVerdict };
4
4
  export type ConnectActorType = 'human' | 'agent' | 'service' | 'tool';
5
5
  export type ConnectApprovalStatus = 'not_required' | 'pending' | 'approved' | 'rejected' | 'expired';
6
- export type ConnectSurface = 'agent' | 'audit' | 'cli' | 'contract' | 'harness' | 'knowledge' | 'mcp' | 'runtime';
6
+ export type ConnectSurface = 'agent' | 'audit' | 'cli' | 'contract' | 'harness' | 'integration' | 'knowledge' | 'library' | 'mcp' | 'runtime' | 'solution' | 'ui';
7
7
  export type ConnectContractKind = 'command' | 'query' | 'event' | 'policy' | 'capability';
8
8
  export interface ConnectActorRef {
9
9
  id: string;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Dependency analysis service.
3
3
  */
4
- import { type ContractGraph, type ContractNode } from '@contractspec/module.workspace';
5
4
  import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec';
5
+ import { type ContractGraph, type ContractNode } from '@contractspec/module.workspace';
6
6
  import type { FsAdapter } from '../ports/fs';
7
7
  /**
8
8
  * Options for dependency analysis.
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export * from './action-drift/index';
5
5
  export * from './action-pr';
6
+ export * as adoption from './adoption/index';
6
7
  export * from './agent-guide/index';
7
8
  export * from './build';
8
9
  export * from './ci-check/index';
@@ -32,6 +33,7 @@ export * from './layer-discovery';
32
33
  export * from './list';
33
34
  export * from './llm/index';
34
35
  export * from './module-loader';
36
+ export * as onboarding from './onboarding/index';
35
37
  export * from './openapi/index';
36
38
  export * from './package-scaffold';
37
39
  export * from './quickstart/index';
@@ -47,6 +49,7 @@ export * from './validate/index';
47
49
  export * from './verification-cache/index';
48
50
  export * from './verify/index';
49
51
  export * as versioning from './versioning/index';
52
+ export type { ReleaseAuthoringDraft, ReleaseAuthoringResult, ReleaseCapsuleReadIssue, SaveReleaseDraftOptions, SaveReleaseDraftResult, } from './versioning/release-service.types';
50
53
  export type { SpecVersionAnalysis } from './versioning/types';
51
54
  export * as vibe from './vibe/index';
52
55
  export * from './view/index';
@@ -6,8 +6,8 @@
6
6
  * - Unresolved references (broken event/op/presentation refs)
7
7
  * - Feature coverage metrics
8
8
  */
9
- import { type AnalyzedSpecType, type FeatureScanResult, type RefInfo } from '@contractspec/module.workspace';
10
9
  import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec';
10
+ import { type AnalyzedSpecType, type FeatureScanResult, type RefInfo } from '@contractspec/module.workspace';
11
11
  import type { FsAdapter } from '../ports/fs';
12
12
  import type { LoggerAdapter } from '../ports/logger';
13
13
  import { type ExtractedTestTarget } from './test-link';
@@ -0,0 +1,4 @@
1
+ import type { OnboardingTrackDefinition } from './types';
2
+ export declare const ONBOARDING_TRACKS: readonly OnboardingTrackDefinition[];
3
+ export declare function listOnboardingTracks(): readonly OnboardingTrackDefinition[];
4
+ export declare function getOnboardingTrack(trackId: string): OnboardingTrackDefinition | undefined;
@@ -0,0 +1,4 @@
1
+ export * from './catalog';
2
+ export * from './render';
3
+ export * from './service';
4
+ export * from './types';
@@ -0,0 +1,11 @@
1
+ import type { ConnectSurface } from '../connect/types';
2
+ import type { BuildOnboardingPlanInput, OnboardingBuilderMode, OnboardingPlan, OnboardingTrackDefinition, OnboardingTrackRecommendation } from './types';
3
+ export declare function createOnboardingJourneyPlan(primaryTrack: OnboardingTrackDefinition, tracks: readonly OnboardingTrackDefinition[], workspaceRoot: string, packageRoot: string): Promise<{
4
+ journeyContext: import("@contractspec/lib.surface-runtime/spec").BundleContext;
5
+ journeyPlan: import("@contractspec/lib.surface-runtime/runtime/resolve-bundle").ResolvedSurfacePlan;
6
+ }>;
7
+ export declare function resolveRequestedTracks(selectedTracks: BuildOnboardingPlanInput['selectedTracks']): OnboardingTrackDefinition[];
8
+ export declare function resolveBuilderMode(config: OnboardingPlan['config']): OnboardingBuilderMode;
9
+ export declare function buildBuilderNextSteps(builderMode: OnboardingBuilderMode): string[];
10
+ export declare function resolveSelectedExample(primaryTrack: OnboardingTrackDefinition, forcedExampleKey: string | undefined): import("./types").OnboardingExampleRef | undefined;
11
+ export declare function enrichConnectSurfaces(current: readonly ConnectSurface[], recommendations: readonly OnboardingTrackRecommendation[]): ConnectSurface[];
@@ -0,0 +1,5 @@
1
+ import type { OnboardingPlan } from './types';
2
+ export declare function renderOnboardingGuides(plan: Omit<OnboardingPlan, 'guides'>): {
3
+ agentGuide: string;
4
+ humanGuide: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import type { WorkspaceAdapters } from '../../ports/logger';
2
+ import { type AdoptionResolverRuntime } from '../adoption';
3
+ import type { BuildOnboardingPlanInput, OnboardingConnectArtifacts, OnboardingPlan } from './types';
4
+ export declare function buildOnboardingPlan(runtime: AdoptionResolverRuntime, input?: BuildOnboardingPlanInput): Promise<OnboardingPlan>;
5
+ export declare function createOnboardingConnectArtifacts(adapters: Pick<WorkspaceAdapters, 'fs' | 'git'>, plan: OnboardingPlan): Promise<OnboardingConnectArtifacts | undefined>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,71 @@
1
+ import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec/workspace-config';
2
+ import type { ResolvedSurfacePlan } from '@contractspec/lib.surface-runtime/runtime/resolve-bundle';
3
+ import type { BundleContext } from '@contractspec/lib.surface-runtime/spec/types';
4
+ import type { AdoptionFamily, AdoptionResolution } from '../adoption/types';
5
+ import type { ConnectContextPack, ConnectPlanPacket, ConnectSurface } from '../connect/types';
6
+ export type OnboardingTrackId = 'contracts' | 'ui-design' | 'knowledge' | 'ai-agents' | 'learning-journey';
7
+ export type OnboardingBuilderMode = 'none' | 'managed' | 'local' | 'hybrid';
8
+ export interface OnboardingExampleRef {
9
+ key: string;
10
+ packageRef: string;
11
+ title: string;
12
+ summary: string;
13
+ }
14
+ export interface OnboardingTrackDefinition {
15
+ id: OnboardingTrackId;
16
+ title: string;
17
+ summary: string;
18
+ description: string;
19
+ reuseFamily: AdoptionFamily;
20
+ adoptionQuery: string;
21
+ adoptionPlatform?: string;
22
+ primaryDocsRoute: string;
23
+ secondaryDocsRoutes: string[];
24
+ packages: string[];
25
+ recommendedCommands: string[];
26
+ starterExample: OnboardingExampleRef;
27
+ advancedExample?: OnboardingExampleRef;
28
+ connectSurfaces: ConnectSurface[];
29
+ }
30
+ export interface OnboardingTrackRecommendation {
31
+ track: OnboardingTrackDefinition;
32
+ selected: boolean;
33
+ score: number;
34
+ reason: string;
35
+ resolution: AdoptionResolution;
36
+ }
37
+ export interface OnboardingGuideRenderResult {
38
+ agentGuide: string;
39
+ humanGuide: string;
40
+ }
41
+ export interface BuildOnboardingPlanInput {
42
+ cwd?: string;
43
+ workspaceRoot?: string;
44
+ packageRoot?: string;
45
+ config?: ResolvedContractsrcConfig;
46
+ selectedTracks?: OnboardingTrackId[];
47
+ forcedExampleKey?: string;
48
+ agentGuidePath?: string;
49
+ humanGuidePath?: string;
50
+ }
51
+ export interface OnboardingPlan {
52
+ cwd: string;
53
+ workspaceRoot: string;
54
+ packageRoot: string;
55
+ config: ResolvedContractsrcConfig;
56
+ builderMode: OnboardingBuilderMode;
57
+ primaryTrack: OnboardingTrackDefinition;
58
+ recommendations: OnboardingTrackRecommendation[];
59
+ journeyContext: BundleContext;
60
+ journeyPlan: ResolvedSurfacePlan;
61
+ guides: OnboardingGuideRenderResult;
62
+ agentGuidePath: string;
63
+ humanGuidePath: string;
64
+ selectedExample: OnboardingExampleRef;
65
+ nextCommands: string[];
66
+ builderNextSteps: string[];
67
+ }
68
+ export interface OnboardingConnectArtifacts {
69
+ contextPack: ConnectContextPack;
70
+ planPacket: ConnectPlanPacket;
71
+ }
@@ -33,6 +33,10 @@ export declare function generateCursorRules(options: SetupOptions): string;
33
33
  * Generate AGENTS.md content.
34
34
  */
35
35
  export declare function generateAgentsGuide(options: SetupOptions): string;
36
+ /**
37
+ * Generate USAGE.md content.
38
+ */
39
+ export declare function generateUsageGuide(options: SetupOptions): string;
36
40
  /**
37
41
  * Get the file path for Claude Desktop config based on platform.
38
42
  */
@@ -6,6 +6,9 @@
6
6
  export * from './config-generators';
7
7
  export * from './file-merger';
8
8
  export * from './gitignore';
9
+ export * from './managed-markdown';
9
10
  export * from './presets';
10
11
  export * from './setup-service';
12
+ export * from './targets/agents-md';
13
+ export * from './targets/usage-md';
11
14
  export * from './types';
@@ -0,0 +1,8 @@
1
+ export interface ManagedMarkdownSectionConfig {
2
+ startMarker: string;
3
+ endMarker: string;
4
+ note: string;
5
+ }
6
+ export declare function mergeManagedMarkdown(existingContent: string, managedContent: string, config: ManagedMarkdownSectionConfig, legacyContent?: string): string;
7
+ export declare function renderManagedMarkdownBlock(managedContent: string, config: ManagedMarkdownSectionConfig): string;
8
+ export declare function normalizeMarkdownContent(content: string): string;
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import type { FsAdapter } from '../../../ports/fs';
5
5
  import type { SetupFileResult, SetupOptions, SetupPromptCallbacks } from '../types';
6
+ export declare const CONTRACTSPEC_AGENTS_BLOCK_START = "<!-- contractspec:init:agents:start -->";
7
+ export declare const CONTRACTSPEC_AGENTS_BLOCK_END = "<!-- contractspec:init:agents:end -->";
6
8
  /**
7
9
  * Setup AGENTS.md
8
10
  */
@@ -7,4 +7,5 @@ export { setupCliConfig } from './cli-config';
7
7
  export { setupCursorRules } from './cursor-rules';
8
8
  export { setupMcpClaude } from './mcp-claude';
9
9
  export { setupMcpCursor } from './mcp-cursor';
10
+ export { setupUsageMd } from './usage-md';
10
11
  export { setupVscodeSettings } from './vscode-settings';
@@ -0,0 +1,5 @@
1
+ import type { FsAdapter } from '../../../ports/fs';
2
+ import type { SetupFileResult, SetupOptions, SetupPromptCallbacks } from '../types';
3
+ export declare const CONTRACTSPEC_USAGE_BLOCK_START = "<!-- contractspec:init:usage:start -->";
4
+ export declare const CONTRACTSPEC_USAGE_BLOCK_END = "<!-- contractspec:init:usage:end -->";
5
+ export declare function setupUsageMd(fs: FsAdapter, options: SetupOptions, prompts: SetupPromptCallbacks): Promise<SetupFileResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Target components that can be configured during setup.
6
6
  */
7
- export type SetupTarget = 'cli-config' | 'biome-config' | 'vscode-settings' | 'mcp-cursor' | 'mcp-claude' | 'cursor-rules' | 'agents-md';
7
+ export type SetupTarget = 'cli-config' | 'biome-config' | 'vscode-settings' | 'mcp-cursor' | 'mcp-claude' | 'cursor-rules' | 'agents-md' | 'usage-md';
8
8
  /**
9
9
  * All available setup targets.
10
10
  */
@@ -46,7 +46,7 @@ export interface SetupOptions {
46
46
  projectName?: string;
47
47
  /** Default code owners. */
48
48
  defaultOwners?: string[];
49
- /** Builder API base URL for managed or hybrid presets. */
49
+ /** Builder API base URL for Builder presets. */
50
50
  builderApiBaseUrl?: string;
51
51
  /** Builder control-plane token environment variable name. */
52
52
  builderControlPlaneTokenEnvVar?: string;
@@ -26,7 +26,7 @@ export interface ValidateSpecResult {
26
26
  export interface DiscoveredSpecValidationResult extends ValidateSpecResult {
27
27
  spec: SpecScanResult;
28
28
  }
29
- export declare function validateScannedSpec(spec: SpecScanResult, options?: ValidateSpecOptions): ValidateSpecResult;
29
+ export declare function validateScannedSpec(spec: SpecScanResult, options?: ValidateSpecOptions): Promise<ValidateSpecResult>;
30
30
  export declare function validateDiscoveredSpecs(specs: SpecScanResult[], options?: ValidateSpecOptions): Promise<DiscoveredSpecValidationResult[]>;
31
31
  /**
32
32
  * Validate a spec file.
@@ -0,0 +1 @@
1
+ export {};
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export { formatChangelogJson, formatConventionalChangelog, formatKeepAChangelog, } from './changelog-formatter';
7
7
  export * from './conventional-commits';
8
+ export { prepareReleaseAuthoring, saveReleaseDraft, } from './release-authoring';
8
9
  export * from './release-formatters';
9
10
  export { buildReleaseArtifacts, checkReleaseArtifacts, initReleaseArtifacts, } from './release-service';
10
11
  export * from './release-service.types';
@@ -0,0 +1,14 @@
1
+ import type { AiAdapter } from '../../ports/ai';
2
+ import type { FsAdapter } from '../../ports/fs';
3
+ import type { GitAdapter } from '../../ports/git';
4
+ import type { LoggerAdapter } from '../../ports/logger';
5
+ import type { ReleaseAuthoringOptions, ReleaseAuthoringResult, SaveReleaseDraftOptions, SaveReleaseDraftResult } from './release-service.types';
6
+ interface ReleaseAuthoringAdapters {
7
+ fs: FsAdapter;
8
+ git: GitAdapter;
9
+ logger: LoggerAdapter;
10
+ ai?: AiAdapter;
11
+ }
12
+ export declare function prepareReleaseAuthoring(adapters: ReleaseAuthoringAdapters, options?: ReleaseAuthoringOptions): Promise<ReleaseAuthoringResult>;
13
+ export declare function saveReleaseDraft(adapters: ReleaseAuthoringAdapters, options: SaveReleaseDraftOptions): Promise<SaveReleaseDraftResult>;
14
+ export {};
@@ -1,5 +1,6 @@
1
1
  import type { ReleaseCapsule, ReleaseCapsulePackage } from '@contractspec/lib.contracts-spec';
2
2
  import type { FsAdapter } from '../../ports/fs';
3
+ import type { ReleaseCapsuleReadIssue } from './release-service.types';
3
4
  export interface WorkspacePackageInfo {
4
5
  name: string;
5
6
  dir: string;
@@ -10,10 +11,16 @@ export interface ParsedChangesetFile {
10
11
  summary: string;
11
12
  packages: ReleaseCapsulePackage[];
12
13
  }
14
+ export interface ReadReleaseCapsulesResult {
15
+ capsules: Map<string, ReleaseCapsule>;
16
+ issues: ReleaseCapsuleReadIssue[];
17
+ }
13
18
  export declare function listChangesetFiles(fs: FsAdapter, workspaceRoot: string): Promise<string[]>;
14
19
  export declare function readChangesets(fs: FsAdapter, workspaceRoot: string): Promise<ParsedChangesetFile[]>;
15
20
  export declare function readReleaseCapsules(fs: FsAdapter, workspaceRoot: string, changesets: ParsedChangesetFile[]): Promise<Map<string, ReleaseCapsule>>;
21
+ export declare function readReleaseCapsulesDetailed(fs: FsAdapter, workspaceRoot: string, changesets: ParsedChangesetFile[]): Promise<ReadReleaseCapsulesResult>;
16
22
  export declare function discoverWorkspacePackages(fs: FsAdapter, workspaceRoot: string): Promise<WorkspacePackageInfo[]>;
17
23
  export declare function matchChangedFilesToPackages(changedFiles: string[], packages: WorkspacePackageInfo[]): string[];
18
24
  export declare function renderChangesetMarkdown(summary: string, packages: ReleaseCapsulePackage[]): string;
19
25
  export declare function renderReleaseCapsuleYaml(capsule: ReleaseCapsule): string;
26
+ export declare function formatReleaseCapsuleReadIssues(issues: ReleaseCapsuleReadIssue[]): string;
@@ -1,4 +1,4 @@
1
- import type { AgentTarget, GeneratedReleaseManifest, ReleaseCapsulePackage, UpgradePlan, VersionBumpType } from '@contractspec/lib.contracts-spec';
1
+ import type { AgentTarget, GeneratedReleaseManifest, MigrationInstruction, ReleaseCapsulePackage, ReleaseCapsuleValidation, ReleaseImpactAudience, UpgradePlan, UpgradePlanStep, VersionBumpType } from '@contractspec/lib.contracts-spec';
2
2
  export interface ReleaseInitOptions {
3
3
  workspaceRoot?: string;
4
4
  baseline?: string;
@@ -36,6 +36,58 @@ export interface ReleaseBuildResult {
36
36
  upgradePlan: UpgradePlan;
37
37
  releasesBuilt: number;
38
38
  }
39
+ export interface ReleaseCapsuleReadIssue {
40
+ slug: string;
41
+ filePath: string;
42
+ message: string;
43
+ line?: number;
44
+ column?: number;
45
+ suggestion?: string;
46
+ }
47
+ export interface ReleaseAuthoringDraft {
48
+ slug: string;
49
+ summary: string;
50
+ releaseType: VersionBumpType;
51
+ isBreaking: boolean;
52
+ packages: ReleaseCapsulePackage[];
53
+ affectedRuntimes: string[];
54
+ affectedFrameworks: string[];
55
+ audiences: ReleaseImpactAudience[];
56
+ deprecations: string[];
57
+ migrationInstructions: MigrationInstruction[];
58
+ upgradeSteps: UpgradePlanStep[];
59
+ validation: ReleaseCapsuleValidation;
60
+ }
61
+ export interface ReleaseAuthoringOptions {
62
+ workspaceRoot?: string;
63
+ baseline?: string;
64
+ slug?: string;
65
+ summary?: string;
66
+ releaseType?: VersionBumpType;
67
+ packages?: string[];
68
+ }
69
+ export interface ReleaseAuthoringResult {
70
+ workspaceRoot: string;
71
+ source: 'created' | 'existing';
72
+ changesetPath: string;
73
+ capsulePath: string;
74
+ draft: ReleaseAuthoringDraft;
75
+ warnings: string[];
76
+ parseIssues: ReleaseCapsuleReadIssue[];
77
+ aiAssisted: boolean;
78
+ }
79
+ export interface SaveReleaseDraftOptions {
80
+ workspaceRoot?: string;
81
+ draft: ReleaseAuthoringDraft;
82
+ force?: boolean;
83
+ }
84
+ export interface SaveReleaseDraftResult {
85
+ source: 'created' | 'updated';
86
+ changesetPath: string;
87
+ capsulePath: string;
88
+ changesetContent: string;
89
+ capsuleContent: string;
90
+ }
39
91
  export interface ReleaseCheckOptions {
40
92
  workspaceRoot?: string;
41
93
  baseline?: string;
@@ -0,0 +1,40 @@
1
+ type Stability = 'experimental' | 'beta' | 'stable' | 'deprecated';
2
+ interface BaseTemplateData {
3
+ key: string;
4
+ version: string;
5
+ description: string;
6
+ owners: string[];
7
+ tags: string[];
8
+ stability: Stability;
9
+ title?: string;
10
+ domain?: string;
11
+ }
12
+ export interface CapabilitySpecTemplateData extends BaseTemplateData {
13
+ kind?: 'api' | 'event' | 'data' | 'ui' | 'integration';
14
+ }
15
+ export interface PolicySpecTemplateData extends BaseTemplateData {
16
+ scope?: 'global' | 'feature' | 'operation';
17
+ }
18
+ export interface TestSpecTemplateData extends BaseTemplateData {
19
+ targetType: 'operation' | 'workflow';
20
+ targetKey: string;
21
+ targetVersion?: string;
22
+ }
23
+ export interface TranslationSpecTemplateData extends BaseTemplateData {
24
+ locale: string;
25
+ fallback?: string;
26
+ }
27
+ export interface JobSpecTemplateData extends BaseTemplateData {
28
+ intervalMs?: number;
29
+ }
30
+ export interface VisualizationSpecTemplateData extends BaseTemplateData {
31
+ sourceOperationKey: string;
32
+ sourceOperationVersion?: string;
33
+ }
34
+ export declare function generateCapabilitySpec(data: CapabilitySpecTemplateData): string;
35
+ export declare function generatePolicySpec(data: PolicySpecTemplateData): string;
36
+ export declare function generateTestSpec(data: TestSpecTemplateData): string;
37
+ export declare function generateTranslationSpec(data: TranslationSpecTemplateData): string;
38
+ export declare function generateJobSpec(data: JobSpecTemplateData): string;
39
+ export declare function generateVisualizationSpec(data: VisualizationSpecTemplateData): string;
40
+ export {};