@contractspec/bundle.workspace 4.4.0 → 4.5.1
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.
- package/dist/bundles/WorkspaceBundle.d.ts +34 -0
- package/dist/contracts/operations/init.operation.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +935 -519
- package/dist/node/index.js +935 -519
- package/dist/services/adoption/catalog-core.d.ts +2 -0
- package/dist/services/adoption/catalog-entry.d.ts +2 -0
- package/dist/services/adoption/catalog-runtime.d.ts +2 -0
- package/dist/services/adoption/catalog-shared.d.ts +2 -0
- package/dist/services/adoption/catalog-solutions.d.ts +2 -0
- package/dist/services/adoption/catalog-ui.d.ts +2 -0
- package/dist/services/adoption/catalog.d.ts +3 -0
- package/dist/services/adoption/index.d.ts +6 -0
- package/dist/services/adoption/resolve.d.ts +6 -0
- package/dist/services/adoption/resolve.test.d.ts +1 -0
- package/dist/services/adoption/tokens.d.ts +6 -0
- package/dist/services/adoption/types.d.ts +99 -0
- package/dist/services/adoption/workspace-scan.d.ts +8 -0
- package/dist/services/adoption/workspace.d.ts +3 -0
- package/dist/services/connect/adoption.d.ts +10 -0
- package/dist/services/connect/types.d.ts +1 -1
- package/dist/services/deps.d.ts +1 -1
- package/dist/services/doctor/checks/config.test.d.ts +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/integrity.d.ts +1 -1
- package/dist/services/onboarding/catalog.d.ts +4 -0
- package/dist/services/onboarding/index.d.ts +4 -0
- package/dist/services/onboarding/journey.d.ts +11 -0
- package/dist/services/onboarding/render.d.ts +5 -0
- package/dist/services/onboarding/service.d.ts +5 -0
- package/dist/services/onboarding/service.test.d.ts +1 -0
- package/dist/services/onboarding/types.d.ts +71 -0
- package/dist/services/package-declarations/helpers.d.ts +13 -0
- package/dist/services/package-declarations/index.d.ts +5 -0
- package/dist/services/package-declarations/inventory.d.ts +4 -0
- package/dist/services/package-declarations/render.d.ts +41 -0
- package/dist/services/package-declarations/sync.d.ts +8 -0
- package/dist/services/package-declarations/sync.test.d.ts +1 -0
- package/dist/services/package-declarations/types.d.ts +48 -0
- package/dist/services/setup/config-generators.d.ts +4 -0
- package/dist/services/setup/index.d.ts +3 -0
- package/dist/services/setup/managed-markdown.d.ts +8 -0
- package/dist/services/setup/setup-service.d.ts +17 -2
- package/dist/services/setup/targets/agents-md.d.ts +2 -0
- package/dist/services/setup/targets/index.d.ts +1 -0
- package/dist/services/setup/targets/usage-md.d.ts +5 -0
- package/dist/services/setup/targets/usage-md.test.d.ts +1 -0
- package/dist/services/setup/types.d.ts +2 -2
- package/dist/services/test/test-generator-service.d.ts +5 -1
- package/dist/services/validate/spec-validator.d.ts +1 -1
- package/dist/services/validate/spec-validator.test.d.ts +1 -0
- package/dist/services/versioning/index.d.ts +1 -0
- package/dist/services/versioning/release-authoring.d.ts +14 -0
- package/dist/services/versioning/release-authoring.test.d.ts +1 -0
- package/dist/services/versioning/release-files.d.ts +7 -0
- package/dist/services/versioning/release-service.types.d.ts +53 -1
- package/dist/services/workspace-info.d.ts +4 -1
- package/dist/templates/additional-contracts.template.d.ts +40 -0
- package/dist/templates/advanced-contracts.template.d.ts +39 -0
- package/dist/templates/index.d.ts +3 -0
- package/dist/templates/theme.template.d.ts +12 -0
- package/dist/templates/theme.template.test.d.ts +1 -0
- package/dist/types.d.ts +16 -11
- package/package.json +14 -13
|
@@ -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,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,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;
|
package/dist/services/deps.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -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,7 +33,9 @@ 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';
|
|
38
|
+
export * as packageDeclarations from './package-declarations/index';
|
|
36
39
|
export * from './package-scaffold';
|
|
37
40
|
export * from './quickstart/index';
|
|
38
41
|
export * from './regenerator';
|
|
@@ -47,6 +50,7 @@ export * from './validate/index';
|
|
|
47
50
|
export * from './verification-cache/index';
|
|
48
51
|
export * from './verify/index';
|
|
49
52
|
export * as versioning from './versioning/index';
|
|
53
|
+
export type { ReleaseAuthoringDraft, ReleaseAuthoringResult, ReleaseCapsuleReadIssue, SaveReleaseDraftOptions, SaveReleaseDraftResult, } from './versioning/release-service.types';
|
|
50
54
|
export type { SpecVersionAnalysis } from './versioning/types';
|
|
51
55
|
export * as vibe from './vibe/index';
|
|
52
56
|
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,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 { 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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PackageDeclarationTarget } from '@contractspec/lib.contracts-spec/workspace-config';
|
|
2
|
+
import type { WorkspacePackageKind } from './types';
|
|
3
|
+
export declare function inferWorkspacePackageKind(relativePackageRoot: string): WorkspacePackageKind | null;
|
|
4
|
+
export declare function getCanonicalDeclarationRelativePath(kind: WorkspacePackageKind, packageDirName: string): string;
|
|
5
|
+
export declare function getIndexExportPath(kind: WorkspacePackageKind, packageDirName: string): string;
|
|
6
|
+
export declare function buildPackageDeclarationKey(relativePackageRoot: string): string;
|
|
7
|
+
export declare function buildPackageTitle(packageDirName: string): string;
|
|
8
|
+
export declare function buildDomain(packageDirName: string): string;
|
|
9
|
+
export declare function buildDeclarationTags(packageDirName: string, kind: WorkspacePackageKind, defaultTags: string[]): string[];
|
|
10
|
+
export declare function matchesAllowMissing(allowMissing: string[], relativePackageRoot: string, packageName: string): boolean;
|
|
11
|
+
export declare function normalizePath(value: string): string;
|
|
12
|
+
export declare function toPascalCase(value: string): string;
|
|
13
|
+
export declare function buildExportName(target: PackageDeclarationTarget, packageDirName: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
2
|
+
import { type PackageDeclarationAuditOptions, type PackageDeclarationAuditResult, type WorkspacePackageInfo } from './types';
|
|
3
|
+
export declare function discoverWorkspacePackages(fs: FsAdapter, options?: PackageDeclarationAuditOptions): Promise<WorkspacePackageInfo[]>;
|
|
4
|
+
export declare function auditPackageDeclarations(fs: FsAdapter, options?: PackageDeclarationAuditOptions): Promise<PackageDeclarationAuditResult[]>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { WorkspacePackageInfo } from './types';
|
|
2
|
+
export interface PackageSpecRefs {
|
|
3
|
+
operations: Array<{
|
|
4
|
+
key: string;
|
|
5
|
+
version: string;
|
|
6
|
+
}>;
|
|
7
|
+
events: Array<{
|
|
8
|
+
key: string;
|
|
9
|
+
version: string;
|
|
10
|
+
}>;
|
|
11
|
+
presentations: Array<{
|
|
12
|
+
key: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}>;
|
|
15
|
+
experiments: Array<{
|
|
16
|
+
key: string;
|
|
17
|
+
version: string;
|
|
18
|
+
}>;
|
|
19
|
+
workflows: Array<{
|
|
20
|
+
key: string;
|
|
21
|
+
version: string;
|
|
22
|
+
}>;
|
|
23
|
+
dataViews: Array<{
|
|
24
|
+
key: string;
|
|
25
|
+
version: string;
|
|
26
|
+
}>;
|
|
27
|
+
capabilities: Array<{
|
|
28
|
+
key: string;
|
|
29
|
+
version: string;
|
|
30
|
+
}>;
|
|
31
|
+
features: Array<{
|
|
32
|
+
key: string;
|
|
33
|
+
version: string;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export declare function renderPackageDeclaration(input: {
|
|
37
|
+
pkg: WorkspacePackageInfo;
|
|
38
|
+
refs: PackageSpecRefs;
|
|
39
|
+
owners: string[];
|
|
40
|
+
defaultTags: string[];
|
|
41
|
+
}): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
2
|
+
import { auditPackageDeclarations } from './inventory';
|
|
3
|
+
import { type PackageDeclarationSyncEntry, type PackageDeclarationSyncOptions, type PackageDeclarationSyncResult } from './types';
|
|
4
|
+
export declare function syncPackageDeclarations(fs: FsAdapter, options?: PackageDeclarationSyncOptions): Promise<PackageDeclarationSyncResult>;
|
|
5
|
+
export declare function createPackageDeclarationIssue(entry: PackageDeclarationSyncEntry | Awaited<ReturnType<typeof auditPackageDeclarations>>[number], allowMissing: string[]): {
|
|
6
|
+
allowlisted: boolean;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PackageDeclarationConfig, PackageDeclarationRequiredByKind, PackageDeclarationTarget, ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec/workspace-config';
|
|
2
|
+
export type WorkspacePackageKind = 'libs' | 'modules' | 'integrations' | 'bundles' | 'apps' | 'appsRegistry' | 'examples';
|
|
3
|
+
export interface WorkspacePackageDeclarationRequirement {
|
|
4
|
+
kind: WorkspacePackageKind;
|
|
5
|
+
target: PackageDeclarationTarget;
|
|
6
|
+
}
|
|
7
|
+
export interface WorkspacePackageInfo {
|
|
8
|
+
workspaceRoot: string;
|
|
9
|
+
relativePackageRoot: string;
|
|
10
|
+
packageRoot: string;
|
|
11
|
+
packageName: string;
|
|
12
|
+
packageDirName: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
kind: WorkspacePackageKind;
|
|
15
|
+
target: PackageDeclarationTarget;
|
|
16
|
+
canonicalDeclarationRelativePath: string;
|
|
17
|
+
canonicalDeclarationPath: string;
|
|
18
|
+
indexPath: string;
|
|
19
|
+
indexExportPath: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PackageDeclarationAuditResult extends WorkspacePackageInfo {
|
|
22
|
+
exists: boolean;
|
|
23
|
+
matchesExpectedTarget: boolean;
|
|
24
|
+
detectedSpecType?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PackageDeclarationSyncEntry extends PackageDeclarationAuditResult {
|
|
27
|
+
action: 'created' | 'updated' | 'skipped';
|
|
28
|
+
declarationCreated: boolean;
|
|
29
|
+
indexUpdated: boolean;
|
|
30
|
+
packageJsonUpdated: boolean;
|
|
31
|
+
dependenciesUpdated: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface PackageDeclarationAuditOptions {
|
|
34
|
+
config?: ResolvedContractsrcConfig;
|
|
35
|
+
workspaceRoot?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface PackageDeclarationSyncOptions extends PackageDeclarationAuditOptions {
|
|
38
|
+
dryRun?: boolean;
|
|
39
|
+
force?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PackageDeclarationSyncResult {
|
|
42
|
+
packages: PackageDeclarationSyncEntry[];
|
|
43
|
+
createdFiles: string[];
|
|
44
|
+
updatedFiles: string[];
|
|
45
|
+
}
|
|
46
|
+
export declare const DEFAULT_PACKAGE_DECLARATION_REQUIRED_BY_KIND: Required<PackageDeclarationRequiredByKind>;
|
|
47
|
+
export declare const WORKSPACE_PACKAGE_KIND_BY_PREFIX: Readonly<Record<string, WorkspacePackageKind>>;
|
|
48
|
+
export declare function resolvePackageDeclarationConfig(config?: ResolvedContractsrcConfig): PackageDeclarationConfig;
|
|
@@ -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;
|
|
@@ -4,9 +4,24 @@
|
|
|
4
4
|
* Orchestrates the full ContractSpec setup flow.
|
|
5
5
|
* Supports both single projects and monorepos.
|
|
6
6
|
*/
|
|
7
|
+
import { findPackageRoot, findWorkspaceRoot, getPackageName, isMonorepo } from '../../adapters/workspace';
|
|
7
8
|
import type { FsAdapter } from '../../ports/fs';
|
|
8
|
-
import
|
|
9
|
+
import { setupGitignore } from './gitignore';
|
|
10
|
+
import type { SetupFileResult, SetupOptions, SetupPromptCallbacks, SetupResult, SetupTarget } from './types';
|
|
11
|
+
type SetupTargetHandler = (fs: FsAdapter, options: SetupOptions, prompts: SetupPromptCallbacks) => Promise<SetupFileResult>;
|
|
12
|
+
interface SetupWorkspaceAdapters {
|
|
13
|
+
findWorkspaceRoot: typeof findWorkspaceRoot;
|
|
14
|
+
findPackageRoot: typeof findPackageRoot;
|
|
15
|
+
isMonorepo: typeof isMonorepo;
|
|
16
|
+
getPackageName: typeof getPackageName;
|
|
17
|
+
}
|
|
18
|
+
export interface SetupServiceDeps {
|
|
19
|
+
targets?: Partial<Record<SetupTarget, SetupTargetHandler>>;
|
|
20
|
+
workspace?: Partial<SetupWorkspaceAdapters>;
|
|
21
|
+
setupGitignore?: typeof setupGitignore;
|
|
22
|
+
}
|
|
9
23
|
/**
|
|
10
24
|
* Run the ContractSpec setup.
|
|
11
25
|
*/
|
|
12
|
-
export declare function runSetup(fs: FsAdapter, options: SetupOptions, prompts?: SetupPromptCallbacks): Promise<SetupResult>;
|
|
26
|
+
export declare function runSetup(fs: FsAdapter, options: SetupOptions, prompts?: SetupPromptCallbacks, deps?: SetupServiceDeps): Promise<SetupResult>;
|
|
27
|
+
export {};
|
|
@@ -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
|
|
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;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import type { OperationSpec } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
import { type TestSpec } from '@contractspec/lib.contracts-spec/tests';
|
|
3
3
|
import type { LanguageModel } from 'ai';
|
|
4
|
+
import { generateText } from 'ai';
|
|
4
5
|
import type { LoggerAdapter } from '../../ports/logger';
|
|
5
6
|
export interface TestGeneratorOptions {
|
|
6
7
|
model?: LanguageModel;
|
|
7
8
|
maxScenarios?: number;
|
|
8
9
|
}
|
|
10
|
+
type GenerateText = typeof generateText;
|
|
9
11
|
export declare class TestGeneratorService {
|
|
10
12
|
private readonly logger;
|
|
11
13
|
private readonly defaultModel?;
|
|
12
|
-
|
|
14
|
+
private readonly generateTextImpl;
|
|
15
|
+
constructor(logger: LoggerAdapter, defaultModel?: LanguageModel | undefined, generateTextImpl?: GenerateText);
|
|
13
16
|
generateTests(spec: OperationSpec<any, any>, // Use any to satisfy generics for now
|
|
14
17
|
options?: TestGeneratorOptions): Promise<TestSpec>;
|
|
15
18
|
private parseResponse;
|
|
16
19
|
private enrichSpec;
|
|
17
20
|
private logUsage;
|
|
18
21
|
}
|
|
22
|
+
export {};
|
|
@@ -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.
|