@contractspec/bundle.workspace 4.2.0 → 4.4.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.
- package/dist/contracts/operations/init.operation.d.ts +1 -1
- package/dist/index.js +1562 -18352
- package/dist/node/index.js +1562 -18353
- package/dist/ports/git.d.ts +4 -0
- package/dist/services/build.d.ts +36 -1
- package/dist/services/connect/assessment.d.ts +31 -0
- package/dist/services/connect/audit-record.d.ts +11 -0
- package/dist/services/connect/command-policy.d.ts +6 -0
- package/dist/services/connect/config.d.ts +8 -0
- package/dist/services/connect/context-plan.test.d.ts +1 -0
- package/dist/services/connect/context.d.ts +3 -0
- package/dist/services/connect/contract-refs.d.ts +10 -0
- package/dist/services/connect/drift-outputdir.test.d.ts +1 -0
- package/dist/services/connect/eval.d.ts +13 -0
- package/dist/services/connect/impact-analysis.d.ts +25 -0
- package/dist/services/connect/index.d.ts +16 -0
- package/dist/services/connect/init.d.ts +3 -0
- package/dist/services/connect/init.test.d.ts +1 -0
- package/dist/services/connect/plan-policy.test.d.ts +1 -0
- package/dist/services/connect/plan.d.ts +6 -0
- package/dist/services/connect/replay-eval.test.d.ts +1 -0
- package/dist/services/connect/replay.d.ts +6 -0
- package/dist/services/connect/review.d.ts +3 -0
- package/dist/services/connect/runtime-link.d.ts +7 -0
- package/dist/services/connect/runtime-link.test.d.ts +1 -0
- package/dist/services/connect/runtime-types.d.ts +48 -0
- package/dist/services/connect/shared.d.ts +14 -0
- package/dist/services/connect/storage.d.ts +50 -0
- package/dist/services/connect/types.d.ts +250 -0
- package/dist/services/connect/verdict-mapping.test.d.ts +1 -0
- package/dist/services/connect/verify-boundaries.test.d.ts +1 -0
- package/dist/services/connect/verify-helpers.d.ts +30 -0
- package/dist/services/connect/verify-impact.test.d.ts +1 -0
- package/dist/services/connect/verify.d.ts +15 -0
- package/dist/services/contractsrc-schema-ref.d.ts +4 -0
- package/dist/services/deps.d.ts +2 -0
- package/dist/services/discover.d.ts +15 -0
- package/dist/services/discover.test.d.ts +1 -0
- package/dist/services/drift.d.ts +5 -1
- package/dist/services/generate-artifacts.d.ts +10 -1
- package/dist/services/index.d.ts +4 -0
- package/dist/services/integrity.d.ts +2 -0
- package/dist/services/list.d.ts +4 -0
- package/dist/services/module-loader.d.ts +25 -0
- package/dist/services/module-loader.test.d.ts +1 -0
- package/dist/services/package-scaffold.d.ts +22 -0
- package/dist/services/setup/config-generators.d.ts +2 -4
- package/dist/services/setup/gitignore.d.ts +10 -0
- package/dist/services/setup/gitignore.test.d.ts +1 -0
- package/dist/services/setup/index.d.ts +2 -0
- package/dist/services/setup/presets.d.ts +16 -0
- package/dist/services/setup/targets/agents-md.d.ts +0 -2
- package/dist/services/setup/targets/agents-md.test.d.ts +1 -0
- package/dist/services/setup/targets/cli-config.test.d.ts +1 -0
- package/dist/services/setup/types.d.ts +36 -2
- package/dist/services/update.test.d.ts +1 -0
- package/dist/services/upgrade/guided-upgrade.d.ts +1 -1
- package/dist/services/upgrade/index.d.ts +1 -1
- package/dist/services/validate/index.d.ts +1 -0
- package/dist/services/validate/module-loader-usage.test.d.ts +1 -0
- package/dist/services/validate/package-scaffold-validator.d.ts +8 -0
- package/dist/services/validate/package-scaffold-validator.test.d.ts +1 -0
- package/dist/services/validate/spec-validator.d.ts +6 -1
- package/dist/services/versioning/index.d.ts +1 -1
- package/dist/services/vibe/definitions.test.d.ts +1 -0
- package/dist/templates/data-view-renderer.template.d.ts +6 -0
- package/dist/templates/feature.template.d.ts +7 -6
- package/dist/templates/form.template.d.ts +16 -0
- package/dist/templates/form.template.test.d.ts +1 -0
- package/dist/templates/index.d.ts +3 -0
- package/dist/templates/workflow-devkit.template.d.ts +11 -0
- package/dist/utils/index.d.ts +0 -1
- package/package.json +15 -14
- package/dist/utils/module-loader.d.ts +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ConnectCommandState } from './command-policy';
|
|
2
|
+
import { buildConnectContextPack } from './context';
|
|
3
|
+
import { compileConnectPlanPacket } from './plan';
|
|
4
|
+
import { resolveWorkspace } from './shared';
|
|
5
|
+
import type { ConnectPatchVerdict, ConnectReviewPacket, ConnectRuntimeLink, ConnectVerdict, ConnectVerifyInput } from './types';
|
|
6
|
+
export declare function checkForPathBoundary(immutable?: string, protectedPath?: string, generatedPath?: string): {
|
|
7
|
+
readonly id: "path-boundary";
|
|
8
|
+
readonly status: "warn" | "pass" | "fail";
|
|
9
|
+
readonly detail: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function checkForCommandPolicy(commandState: ConnectCommandState, commandMatch?: string): {
|
|
12
|
+
readonly id: "command-policy";
|
|
13
|
+
readonly status: "warn" | "pass" | "fail";
|
|
14
|
+
readonly detail: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function checkForImpact(breakingChange: boolean, contractDrift: boolean, unknownImpact: boolean): {
|
|
17
|
+
readonly id: "impact-analysis";
|
|
18
|
+
readonly status: "warn" | "pass" | "fail";
|
|
19
|
+
readonly detail: "Breaking change detected." | "Generated-path drift detected." | "Impact could not be resolved." | "Impact resolved.";
|
|
20
|
+
};
|
|
21
|
+
export declare function buildReviewPacket(workspace: ReturnType<typeof resolveWorkspace>, decisionId: string, contextPack: Awaited<ReturnType<typeof buildConnectContextPack>>, planPacket: Awaited<ReturnType<typeof compileConnectPlanPacket>>['planPacket'], touchedPaths: string[], input: {
|
|
22
|
+
artifactRefs: {
|
|
23
|
+
contextPack: string;
|
|
24
|
+
planPacket: string;
|
|
25
|
+
patchVerdict: string;
|
|
26
|
+
};
|
|
27
|
+
reason: string;
|
|
28
|
+
runtimeLink?: ConnectRuntimeLink | null;
|
|
29
|
+
}): ConnectReviewPacket;
|
|
30
|
+
export declare function buildPatchVerdict(decisionId: string, input: ConnectVerifyInput, contextPack: Awaited<ReturnType<typeof buildConnectContextPack>>, planPacket: Awaited<ReturnType<typeof compileConnectPlanPacket>>['planPacket'], impactedFiles: ConnectPatchVerdict['impacted'], checks: ConnectPatchVerdict['checks'], verdict: ConnectVerdict, reviewPacketRef?: string, runtimeLink?: ConnectRuntimeLink | null): ConnectPatchVerdict;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkspaceAdapters } from '../../ports/logger';
|
|
2
|
+
import { buildConnectContextPack } from './context';
|
|
3
|
+
import { compileConnectPlanPacket } from './plan';
|
|
4
|
+
import type { ConnectControlPlaneRuntime } from './runtime-types';
|
|
5
|
+
import type { ConnectPatchVerdict, ConnectReviewPacket, ConnectVerifyInput, ConnectVerifyRuntime } from './types';
|
|
6
|
+
export declare function verifyConnectMutation(adapters: Pick<WorkspaceAdapters, 'fs' | 'git' | 'logger'>, input: ConnectVerifyInput, runtime?: ConnectVerifyRuntime & {
|
|
7
|
+
controlPlane?: ConnectControlPlaneRuntime;
|
|
8
|
+
now?: () => Date;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
contextPack: Awaited<ReturnType<typeof buildConnectContextPack>>;
|
|
11
|
+
planPacket: Awaited<ReturnType<typeof compileConnectPlanPacket>>['planPacket'];
|
|
12
|
+
patchVerdict: ConnectPatchVerdict;
|
|
13
|
+
reviewPacket?: ConnectReviewPacket;
|
|
14
|
+
historyDir: string;
|
|
15
|
+
}>;
|
package/dist/services/deps.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Dependency analysis service.
|
|
3
3
|
*/
|
|
4
4
|
import { type ContractGraph, type ContractNode } from '@contractspec/module.workspace';
|
|
5
|
+
import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec';
|
|
5
6
|
import type { FsAdapter } from '../ports/fs';
|
|
6
7
|
/**
|
|
7
8
|
* Options for dependency analysis.
|
|
@@ -11,6 +12,7 @@ export interface AnalyzeDepsOptions {
|
|
|
11
12
|
* File pattern to search.
|
|
12
13
|
*/
|
|
13
14
|
pattern?: string;
|
|
15
|
+
config?: ResolvedContractsrcConfig;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* Result of dependency analysis.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
import type { MaybeArray } from '@contractspec/lib.utils-typescript';
|
|
3
|
+
import { type SpecScanResult } from '@contractspec/module.workspace';
|
|
4
|
+
import type { FsAdapter } from '../ports/fs';
|
|
5
|
+
export interface DiscoverSpecsOptions {
|
|
6
|
+
pattern?: string;
|
|
7
|
+
paths?: string[];
|
|
8
|
+
cwd?: string;
|
|
9
|
+
type?: MaybeArray<string>;
|
|
10
|
+
config?: ResolvedContractsrcConfig;
|
|
11
|
+
}
|
|
12
|
+
export declare function discoverSpecFiles(fs: FsAdapter, options?: DiscoverSpecsOptions): Promise<string[]>;
|
|
13
|
+
export declare function discoverSpecs(adapters: {
|
|
14
|
+
fs: FsAdapter;
|
|
15
|
+
}, options?: DiscoverSpecsOptions): Promise<SpecScanResult[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/services/drift.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Detects when generated artifacts are out of sync with their source specs.
|
|
5
5
|
*/
|
|
6
6
|
import type { WorkspaceAdapters } from '../ports/logger';
|
|
7
|
+
import { type GenerateArtifactsOptions } from './generate-artifacts';
|
|
7
8
|
/**
|
|
8
9
|
* Result of drift detection.
|
|
9
10
|
*/
|
|
@@ -24,4 +25,7 @@ export interface DriftResult {
|
|
|
24
25
|
* @param generatedDir - Directory containing generated artifacts
|
|
25
26
|
* @returns Result indicating if drift exists and which files are affected
|
|
26
27
|
*/
|
|
27
|
-
export declare function detectDrift(adapters: WorkspaceAdapters, contractsDir: string, generatedDir: string
|
|
28
|
+
export declare function detectDrift(adapters: WorkspaceAdapters, contractsDir: string, generatedDir: string, options?: {
|
|
29
|
+
generation?: GenerateArtifactsOptions;
|
|
30
|
+
rootPath?: string;
|
|
31
|
+
}): Promise<DriftResult>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { type ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec';
|
|
1
2
|
import type { WorkspaceAdapters } from '../ports/logger';
|
|
2
3
|
export interface GenerateArtifactsResult {
|
|
3
4
|
specsCount: number;
|
|
4
5
|
docsCount: number;
|
|
6
|
+
materializedCount: number;
|
|
5
7
|
}
|
|
6
|
-
export
|
|
8
|
+
export interface GenerateArtifactsOptions {
|
|
9
|
+
scanAllSpecs?: boolean;
|
|
10
|
+
specPattern?: string;
|
|
11
|
+
specSearchRoot?: string;
|
|
12
|
+
config?: ResolvedContractsrcConfig;
|
|
13
|
+
includeRuntimeTests?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function generateArtifacts(adapters: WorkspaceAdapters, contractsDir: string, generatedDir: string, rootPath?: string, options?: GenerateArtifactsOptions): Promise<GenerateArtifactsResult>;
|
package/dist/services/index.d.ts
CHANGED
|
@@ -8,10 +8,12 @@ export * from './build';
|
|
|
8
8
|
export * from './ci-check/index';
|
|
9
9
|
export * from './clean';
|
|
10
10
|
export * from './config';
|
|
11
|
+
export * as connect from './connect/index';
|
|
11
12
|
export * from './create/index';
|
|
12
13
|
export * from './delete';
|
|
13
14
|
export * from './deps';
|
|
14
15
|
export * from './diff';
|
|
16
|
+
export * from './discover';
|
|
15
17
|
export * from './docs/index';
|
|
16
18
|
export * from './doctor/index';
|
|
17
19
|
export * from './extract';
|
|
@@ -29,7 +31,9 @@ export * from './integrity-diagram';
|
|
|
29
31
|
export * from './layer-discovery';
|
|
30
32
|
export * from './list';
|
|
31
33
|
export * from './llm/index';
|
|
34
|
+
export * from './module-loader';
|
|
32
35
|
export * from './openapi/index';
|
|
36
|
+
export * from './package-scaffold';
|
|
33
37
|
export * from './quickstart/index';
|
|
34
38
|
export * from './regenerator';
|
|
35
39
|
export * from './registry';
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - Feature coverage metrics
|
|
8
8
|
*/
|
|
9
9
|
import { type AnalyzedSpecType, type FeatureScanResult, type RefInfo } from '@contractspec/module.workspace';
|
|
10
|
+
import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec';
|
|
10
11
|
import type { FsAdapter } from '../ports/fs';
|
|
11
12
|
import type { LoggerAdapter } from '../ports/logger';
|
|
12
13
|
import { type ExtractedTestTarget } from './test-link';
|
|
@@ -34,6 +35,7 @@ export interface IntegrityAnalysisOptions {
|
|
|
34
35
|
* Filter by spec type.
|
|
35
36
|
*/
|
|
36
37
|
specType?: AnalyzedSpecType;
|
|
38
|
+
config?: ResolvedContractsrcConfig;
|
|
37
39
|
/**
|
|
38
40
|
* Require tests for specific spec types.
|
|
39
41
|
*/
|
package/dist/services/list.d.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FsAdapter } from '../ports/fs';
|
|
2
|
+
export interface LoadedAuthoredModule {
|
|
3
|
+
modulePath: string;
|
|
4
|
+
exports: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export interface LoadAuthoredModuleValueOptions<T> {
|
|
7
|
+
description: string;
|
|
8
|
+
isValue: (value: unknown) => value is T;
|
|
9
|
+
instanceKeys?: string[];
|
|
10
|
+
factoryKeys?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function loadAuthoredModule(modulePath: string, options?: {
|
|
13
|
+
runtime?: 'bun' | 'node';
|
|
14
|
+
}): Promise<LoadedAuthoredModule>;
|
|
15
|
+
export declare function loadAuthoredModuleIfExists(modulePath: string, fs: FsAdapter): Promise<LoadedAuthoredModule | null>;
|
|
16
|
+
export declare function loadAuthoredModuleExports(modulePath: string, options?: {
|
|
17
|
+
runtime?: 'bun' | 'node';
|
|
18
|
+
}): Promise<Record<string, unknown>>;
|
|
19
|
+
export declare function loadAuthoredModuleValue<T>(modulePath: string, options: LoadAuthoredModuleValueOptions<T>): Promise<T>;
|
|
20
|
+
export declare function formatModuleLoadError(modulePath: string, error: unknown): string;
|
|
21
|
+
export declare function resolveAuthoredModuleValue<T>(exports: Record<string, unknown>, modulePath: string, options: LoadAuthoredModuleValueOptions<T>): Promise<T>;
|
|
22
|
+
export declare const __moduleLoaderInternals: {
|
|
23
|
+
formatModuleLoadError: typeof formatModuleLoadError;
|
|
24
|
+
resolveAuthoredModuleValue: typeof resolveAuthoredModuleValue;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AuthoringTargetId } from '@contractspec/module.workspace';
|
|
2
|
+
import type { FsAdapter } from '../ports/fs';
|
|
3
|
+
export interface PackageScaffoldOptions {
|
|
4
|
+
target: Extract<AuthoringTargetId, 'module-bundle' | 'builder-spec' | 'provider-spec'>;
|
|
5
|
+
specPath: string;
|
|
6
|
+
specCode: string;
|
|
7
|
+
overwrite?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PackageScaffoldResult {
|
|
10
|
+
packageRoot: string;
|
|
11
|
+
files: string[];
|
|
12
|
+
created: string[];
|
|
13
|
+
skipped: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function ensurePackageScaffold(fs: FsAdapter, options: PackageScaffoldOptions): Promise<PackageScaffoldResult>;
|
|
16
|
+
export declare function createPackageTargetSpecSource(input: {
|
|
17
|
+
target: PackageScaffoldOptions['target'];
|
|
18
|
+
key: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
exportName: string;
|
|
22
|
+
}): string;
|
|
@@ -13,7 +13,7 @@ export declare function generateContractsrcConfig(options: SetupOptions): object
|
|
|
13
13
|
/**
|
|
14
14
|
* Generate .vscode/settings.json ContractSpec settings.
|
|
15
15
|
*/
|
|
16
|
-
export declare function generateVscodeSettings(): object;
|
|
16
|
+
export declare function generateVscodeSettings(options: SetupOptions): object;
|
|
17
17
|
/**
|
|
18
18
|
* Generate .cursor/mcp.json content.
|
|
19
19
|
*/
|
|
@@ -31,10 +31,8 @@ export declare function generateClaudeMcpConfig(): object;
|
|
|
31
31
|
export declare function generateCursorRules(options: SetupOptions): string;
|
|
32
32
|
/**
|
|
33
33
|
* Generate AGENTS.md content.
|
|
34
|
-
*
|
|
35
|
-
* Adapts paths and instructions based on monorepo scope.
|
|
36
34
|
*/
|
|
37
|
-
export declare function
|
|
35
|
+
export declare function generateAgentsGuide(options: SetupOptions): string;
|
|
38
36
|
/**
|
|
39
37
|
* Get the file path for Claude Desktop config based on platform.
|
|
40
38
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
2
|
+
import type { SetupFileResult, SetupGitignoreBehavior, SetupPromptCallbacks } from './types';
|
|
3
|
+
export declare function setupGitignore(fs: FsAdapter, input: {
|
|
4
|
+
interactive: boolean;
|
|
5
|
+
patterns: string[];
|
|
6
|
+
root: string;
|
|
7
|
+
behavior?: SetupGitignoreBehavior;
|
|
8
|
+
prompts?: Pick<SetupPromptCallbacks, 'confirm'>;
|
|
9
|
+
}): Promise<SetupFileResult>;
|
|
10
|
+
export declare function mergeGitignoreContent(existingContent: string, patterns: string[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec/workspace-config';
|
|
2
|
+
import { type SetupOptions, type SetupPreset, type SetupTarget } from './types';
|
|
3
|
+
export declare const SETUP_GITIGNORE_PATTERNS: {
|
|
4
|
+
readonly connect: "**/.contractspec/connect/";
|
|
5
|
+
readonly verificationCache: "**/.contractspec/verification-cache.json";
|
|
6
|
+
};
|
|
7
|
+
export declare function inferSetupPresetFromConfig(config: Partial<ResolvedContractsrcConfig> | null | undefined): SetupPreset;
|
|
8
|
+
export declare function resolveSetupPreset(options: Pick<SetupOptions, 'preset'>): SetupPreset;
|
|
9
|
+
export declare function resolveSetupTargets(preset: SetupPreset, explicitTargets: SetupTarget[]): SetupTarget[];
|
|
10
|
+
export declare function getBuilderRuntimeModeForPreset(preset: SetupPreset): 'managed' | 'local' | 'hybrid' | undefined;
|
|
11
|
+
export declare function getBuilderBootstrapPresetForSetupPreset(preset: SetupPreset): 'managed_mvp' | 'local_daemon_mvp' | 'hybrid_mvp' | undefined;
|
|
12
|
+
export declare function isBuilderPreset(preset: SetupPreset): boolean;
|
|
13
|
+
export declare function isConnectPreset(preset: SetupPreset): boolean;
|
|
14
|
+
export declare function createSetupNextSteps(options: Pick<SetupOptions, 'builderLocalGrantedTo' | 'builderLocalRuntimeId' | 'preset' | 'projectName'>): string[];
|
|
15
|
+
export declare function createBuilderWorkspaceId(projectName?: string): string;
|
|
16
|
+
export declare function createSetupGitignorePatterns(options: Pick<SetupOptions, 'preset'>): string[];
|
|
@@ -5,7 +5,5 @@ import type { FsAdapter } from '../../../ports/fs';
|
|
|
5
5
|
import type { SetupFileResult, SetupOptions, SetupPromptCallbacks } from '../types';
|
|
6
6
|
/**
|
|
7
7
|
* Setup AGENTS.md
|
|
8
|
-
*
|
|
9
|
-
* In monorepo with package scope, creates AGENTS.md at package root.
|
|
10
8
|
*/
|
|
11
9
|
export declare function setupAgentsMd(fs: FsAdapter, options: SetupOptions, prompts: SetupPromptCallbacks): Promise<SetupFileResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,6 +13,11 @@ export declare const ALL_SETUP_TARGETS: SetupTarget[];
|
|
|
13
13
|
* Human-readable labels for setup targets.
|
|
14
14
|
*/
|
|
15
15
|
export declare const SETUP_TARGET_LABELS: Record<SetupTarget, string>;
|
|
16
|
+
export type SetupPreset = 'core' | 'connect' | 'builder-managed' | 'builder-local' | 'builder-hybrid';
|
|
17
|
+
export declare const ALL_SETUP_PRESETS: SetupPreset[];
|
|
18
|
+
export declare const SETUP_PRESET_LABELS: Record<SetupPreset, string>;
|
|
19
|
+
export declare const SETUP_PRESET_DESCRIPTIONS: Record<SetupPreset, string>;
|
|
20
|
+
export type SetupGitignoreBehavior = 'auto' | 'force' | 'skip';
|
|
16
21
|
/**
|
|
17
22
|
* Scope of configuration in a monorepo.
|
|
18
23
|
*/
|
|
@@ -33,19 +38,37 @@ export interface SetupOptions {
|
|
|
33
38
|
packageName?: string;
|
|
34
39
|
/** If true, skip prompts and use defaults. */
|
|
35
40
|
interactive: boolean;
|
|
41
|
+
/** High-level onboarding preset. */
|
|
42
|
+
preset?: SetupPreset;
|
|
36
43
|
/** Specific targets to configure (defaults to all). */
|
|
37
44
|
targets: SetupTarget[];
|
|
38
45
|
/** Project name (defaults to directory name). */
|
|
39
46
|
projectName?: string;
|
|
40
47
|
/** Default code owners. */
|
|
41
48
|
defaultOwners?: string[];
|
|
49
|
+
/** Builder API base URL for managed or hybrid presets. */
|
|
50
|
+
builderApiBaseUrl?: string;
|
|
51
|
+
/** Builder control-plane token environment variable name. */
|
|
52
|
+
builderControlPlaneTokenEnvVar?: string;
|
|
53
|
+
/** Builder local runtime target id for local or hybrid presets. */
|
|
54
|
+
builderLocalRuntimeId?: string;
|
|
55
|
+
/** Builder local runtime lease/grant target for local or hybrid presets. */
|
|
56
|
+
builderLocalGrantedTo?: string;
|
|
57
|
+
/** Builder local-capable providers for local or hybrid presets. */
|
|
58
|
+
builderLocalProviderIds?: string[];
|
|
59
|
+
/** Optional Connect Studio bridge endpoint. */
|
|
60
|
+
connectStudioEndpoint?: string;
|
|
61
|
+
/** Optional Connect Studio bridge queue. */
|
|
62
|
+
connectStudioQueue?: string;
|
|
63
|
+
/** How init should handle recommended ContractSpec .gitignore entries. */
|
|
64
|
+
gitignoreBehavior?: SetupGitignoreBehavior;
|
|
42
65
|
}
|
|
43
66
|
/**
|
|
44
67
|
* Result of a single file setup operation.
|
|
45
68
|
*/
|
|
46
69
|
export interface SetupFileResult {
|
|
47
70
|
/** Target that was configured. */
|
|
48
|
-
target: SetupTarget;
|
|
71
|
+
target: SetupTarget | 'gitignore';
|
|
49
72
|
/** File path that was created or modified. */
|
|
50
73
|
filePath: string;
|
|
51
74
|
/** Action taken. */
|
|
@@ -59,17 +82,28 @@ export interface SetupFileResult {
|
|
|
59
82
|
export interface SetupResult {
|
|
60
83
|
/** Whether all operations succeeded. */
|
|
61
84
|
success: boolean;
|
|
85
|
+
/** Final resolved setup preset. */
|
|
86
|
+
preset: SetupPreset;
|
|
62
87
|
/** Results for each file. */
|
|
63
88
|
files: SetupFileResult[];
|
|
64
89
|
/** Summary message. */
|
|
65
90
|
summary: string;
|
|
91
|
+
/** Tailored follow-up commands for the selected preset. */
|
|
92
|
+
nextSteps: string[];
|
|
66
93
|
}
|
|
67
94
|
/**
|
|
68
95
|
* Callback for interactive prompts during setup.
|
|
69
96
|
*/
|
|
70
97
|
export interface SetupPromptCallbacks {
|
|
71
98
|
/** Confirm an action. */
|
|
72
|
-
confirm: (message: string) => Promise<boolean>;
|
|
99
|
+
confirm: (message: string, defaultValue?: boolean) => Promise<boolean>;
|
|
100
|
+
/** Select a single option. */
|
|
101
|
+
select: <T extends string>(message: string, options: {
|
|
102
|
+
value: T;
|
|
103
|
+
label: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
selected?: boolean;
|
|
106
|
+
}[]) => Promise<T>;
|
|
73
107
|
/** Select multiple options. */
|
|
74
108
|
multiSelect: <T extends string>(message: string, options: {
|
|
75
109
|
value: T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GuidedUpgradeAnalysisResult, GuidedUpgradeApplyResult, UpgradeOptions } from './types';
|
|
2
1
|
import type { FsAdapter } from '../../ports/fs';
|
|
3
2
|
import type { LoggerAdapter } from '../../ports/logger';
|
|
3
|
+
import type { GuidedUpgradeAnalysisResult, GuidedUpgradeApplyResult, UpgradeOptions } from './types';
|
|
4
4
|
interface ServiceAdapters {
|
|
5
5
|
fs: FsAdapter;
|
|
6
6
|
logger: LoggerAdapter;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides upgrade analysis and application for ContractSpec SDK and config.
|
|
5
5
|
*/
|
|
6
|
+
export { analyzeGuidedUpgrade, applyGuidedUpgrade, } from './guided-upgrade';
|
|
6
7
|
export * from './types';
|
|
7
8
|
export { analyzeUpgrades, applyConfigUpgrades, getDefaultHooksConfig, getDefaultVersioningConfig, getPackageUpgradeCommand, } from './upgrade-service';
|
|
8
|
-
export { analyzeGuidedUpgrade, applyGuidedUpgrade, } from './guided-upgrade';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SpecScanResult } from '@contractspec/module.workspace';
|
|
2
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
3
|
+
export interface PackageScaffoldValidationResult {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
errors: string[];
|
|
6
|
+
warnings: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function validatePackageScaffold(spec: SpecScanResult, fs: FsAdapter): Promise<PackageScaffoldValidationResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Validation service.
|
|
3
3
|
*/
|
|
4
|
-
import { type ValidationResult } from '@contractspec/module.workspace';
|
|
4
|
+
import { type SpecScanResult, type ValidationResult } from '@contractspec/module.workspace';
|
|
5
5
|
import type { FsAdapter } from '../../ports/fs';
|
|
6
6
|
import type { LoggerAdapter } from '../../ports/logger';
|
|
7
7
|
/**
|
|
@@ -23,6 +23,11 @@ export interface ValidateSpecResult {
|
|
|
23
23
|
warnings: string[];
|
|
24
24
|
code?: string;
|
|
25
25
|
}
|
|
26
|
+
export interface DiscoveredSpecValidationResult extends ValidateSpecResult {
|
|
27
|
+
spec: SpecScanResult;
|
|
28
|
+
}
|
|
29
|
+
export declare function validateScannedSpec(spec: SpecScanResult, options?: ValidateSpecOptions): ValidateSpecResult;
|
|
30
|
+
export declare function validateDiscoveredSpecs(specs: SpecScanResult[], options?: ValidateSpecOptions): Promise<DiscoveredSpecValidationResult[]>;
|
|
26
31
|
/**
|
|
27
32
|
* Validate a spec file.
|
|
28
33
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export { formatChangelogJson, formatConventionalChangelog, formatKeepAChangelog, } from './changelog-formatter';
|
|
7
7
|
export * from './conventional-commits';
|
|
8
8
|
export * from './release-formatters';
|
|
9
|
+
export { buildReleaseArtifacts, checkReleaseArtifacts, initReleaseArtifacts, } from './release-service';
|
|
9
10
|
export * from './release-service.types';
|
|
10
11
|
export * from './types';
|
|
11
12
|
export { analyzeVersions, analyzeVersionsFromCommits, applyVersionBump, generateChangelogs, } from './versioning-service';
|
|
12
|
-
export { buildReleaseArtifacts, checkReleaseArtifacts, initReleaseArtifacts, } from './release-service';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,26 +3,27 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface FeatureSpecParams {
|
|
5
5
|
key: string;
|
|
6
|
+
version: string;
|
|
6
7
|
title: string;
|
|
8
|
+
domain: string;
|
|
7
9
|
description?: string;
|
|
8
|
-
stability?: 'experimental' | '
|
|
10
|
+
stability?: 'experimental' | 'beta' | 'stable' | 'deprecated';
|
|
9
11
|
owners: string[];
|
|
10
12
|
tags: string[];
|
|
11
|
-
display?: string;
|
|
12
13
|
operations: {
|
|
13
|
-
|
|
14
|
+
key: string;
|
|
14
15
|
version: string;
|
|
15
16
|
}[];
|
|
16
17
|
events: {
|
|
17
|
-
|
|
18
|
+
key: string;
|
|
18
19
|
version: string;
|
|
19
20
|
}[];
|
|
20
21
|
presentations: {
|
|
21
|
-
|
|
22
|
+
key: string;
|
|
22
23
|
version: string;
|
|
23
24
|
}[];
|
|
24
25
|
experiments: {
|
|
25
|
-
|
|
26
|
+
key: string;
|
|
26
27
|
version: string;
|
|
27
28
|
}[];
|
|
28
29
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface FormSpecParams {
|
|
2
|
+
key: string;
|
|
3
|
+
version: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
domain: string;
|
|
7
|
+
owners: string[];
|
|
8
|
+
tags: string[];
|
|
9
|
+
stability?: 'experimental' | 'beta' | 'stable' | 'deprecated';
|
|
10
|
+
primaryFieldKey: string;
|
|
11
|
+
primaryFieldLabel: string;
|
|
12
|
+
primaryFieldPlaceholder?: string;
|
|
13
|
+
actionKey: string;
|
|
14
|
+
actionLabel: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function generateFormSpec(params: FormSpecParams): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './app-config.template';
|
|
5
5
|
export * from './data-view.template';
|
|
6
|
+
export * from './data-view-renderer.template';
|
|
6
7
|
export * from './event.template';
|
|
7
8
|
export * from './experiment.template';
|
|
8
9
|
export * from './feature.template';
|
|
10
|
+
export * from './form.template';
|
|
9
11
|
export * from './handler.template';
|
|
10
12
|
export * from './integration.template';
|
|
11
13
|
export * from './knowledge.template';
|
|
@@ -14,4 +16,5 @@ export * from './operation.template';
|
|
|
14
16
|
export * from './presentation.template';
|
|
15
17
|
export * from './telemetry.template';
|
|
16
18
|
export * from './workflow.template';
|
|
19
|
+
export * from './workflow-devkit.template';
|
|
17
20
|
export * from './workflow-runner.template';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface WorkflowDevkitTemplateOptions {
|
|
2
|
+
exportName: string;
|
|
3
|
+
specImportPath: string;
|
|
4
|
+
workflowFunctionName: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateWorkflowDevkitWorkflowTemplate({ exportName, specImportPath, workflowFunctionName, }: WorkflowDevkitTemplateOptions): string;
|
|
7
|
+
export declare function generateWorkflowDevkitStartRouteTemplate(workflowImportPath: string, workflowFunctionName: string): string;
|
|
8
|
+
export declare function generateWorkflowDevkitFollowUpRouteTemplate(): string;
|
|
9
|
+
export declare function generateWorkflowDevkitStreamRouteTemplate(): string;
|
|
10
|
+
export declare function generateWorkflowDevkitGenericTemplate(workflowImportPath: string, workflowFunctionName: string): string;
|
|
11
|
+
export {};
|
package/dist/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.workspace",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Workspace utilities for monorepo development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -24,25 +24,26 @@
|
|
|
24
24
|
"dev": "contractspec-bun-build dev",
|
|
25
25
|
"clean": "rimraf dist .turbo",
|
|
26
26
|
"lint": "bun lint:fix",
|
|
27
|
-
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
28
|
-
"lint:check": "biome check .",
|
|
27
|
+
"lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
|
|
28
|
+
"lint:check": "node ../../../scripts/biome.cjs check .",
|
|
29
29
|
"test": "bun test",
|
|
30
30
|
"prebuild": "contractspec-bun-build prebuild",
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ai-sdk/anthropic": "3.0.
|
|
35
|
-
"@ai-sdk/openai": "3.0.
|
|
34
|
+
"@ai-sdk/anthropic": "3.0.68",
|
|
35
|
+
"@ai-sdk/openai": "3.0.52",
|
|
36
36
|
"@contractspec/biome-config": "3.8.7",
|
|
37
|
-
"@contractspec/
|
|
37
|
+
"@contractspec/integration.runtime": "3.9.1",
|
|
38
|
+
"@contractspec/lib.ai-agent": "8.0.7",
|
|
38
39
|
"@contractspec/lib.ai-providers": "3.7.13",
|
|
39
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
40
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
41
|
-
"@contractspec/lib.contracts-transformers": "3.7.
|
|
42
|
-
"@contractspec/lib.source-extractors": "2.7.
|
|
43
|
-
"@contractspec/module.workspace": "4.
|
|
40
|
+
"@contractspec/lib.contracts-spec": "5.3.0",
|
|
41
|
+
"@contractspec/lib.contracts-integrations": "3.8.11",
|
|
42
|
+
"@contractspec/lib.contracts-transformers": "3.7.19",
|
|
43
|
+
"@contractspec/lib.source-extractors": "2.7.19",
|
|
44
|
+
"@contractspec/module.workspace": "4.2.0",
|
|
44
45
|
"@contractspec/lib.utils-typescript": "3.7.13",
|
|
45
|
-
"ai": "6.0.
|
|
46
|
+
"ai": "6.0.156",
|
|
46
47
|
"chalk": "^5.6.2",
|
|
47
48
|
"chokidar": "^5.0.0",
|
|
48
49
|
"glob": "^13.0.6",
|
|
@@ -57,9 +58,9 @@
|
|
|
57
58
|
"@contractspec/tool.typescript": "3.7.13",
|
|
58
59
|
"@types/bun": "^1.3.11",
|
|
59
60
|
"@types/micromatch": "^4.0.10",
|
|
60
|
-
"@types/node": "^25.
|
|
61
|
+
"@types/node": "^25.6.0",
|
|
61
62
|
"typescript": "^5.9.3",
|
|
62
|
-
"@contractspec/tool.bun": "3.7.
|
|
63
|
+
"@contractspec/tool.bun": "3.7.14"
|
|
63
64
|
},
|
|
64
65
|
"exports": {
|
|
65
66
|
".": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadTypeScriptModule(filePath: string): Promise<any>;
|