@contractspec/bundle.workspace 4.3.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 +771 -526
- package/dist/node/index.js +771 -526
- package/dist/services/build.d.ts +36 -1
- package/dist/services/connect/init.d.ts +2 -6
- package/dist/services/connect/types.d.ts +10 -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/generate-artifacts.d.ts +4 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/integrity.d.ts +2 -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 +1 -1
- 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/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/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/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 +8 -8
- package/dist/utils/module-loader.d.ts +0 -1
package/dist/services/build.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { LoggerAdapter } from '../ports/logger';
|
|
|
11
11
|
/**
|
|
12
12
|
* Build target types.
|
|
13
13
|
*/
|
|
14
|
-
export type BuildTarget = 'handler' | 'component' | 'test';
|
|
14
|
+
export type BuildTarget = 'handler' | 'component' | 'test' | 'form' | 'workflow-runner' | 'data-view-renderer' | 'package-scaffold';
|
|
15
15
|
/**
|
|
16
16
|
* Options for building from a spec.
|
|
17
17
|
*/
|
|
@@ -32,6 +32,33 @@ export interface BuildSpecOptions {
|
|
|
32
32
|
* Skip writing files (dry run).
|
|
33
33
|
*/
|
|
34
34
|
dryRun?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Include target-specific test artifacts in the default build plan.
|
|
37
|
+
*/
|
|
38
|
+
includeTests?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Optional runtime generation strategy supplied by higher-level callers.
|
|
41
|
+
*/
|
|
42
|
+
runtimeGeneration?: RuntimeGenerationStrategy;
|
|
43
|
+
}
|
|
44
|
+
export type RuntimeArtifactKind = 'handler' | 'component' | 'form';
|
|
45
|
+
export type RuntimeTestKind = 'handler' | 'component';
|
|
46
|
+
export interface RuntimeArtifactGenerationInput {
|
|
47
|
+
kind: RuntimeArtifactKind;
|
|
48
|
+
specCode: string;
|
|
49
|
+
outputPath: string;
|
|
50
|
+
fallbackCode: string;
|
|
51
|
+
}
|
|
52
|
+
export interface RuntimeTestGenerationInput {
|
|
53
|
+
kind: RuntimeTestKind;
|
|
54
|
+
specCode: string;
|
|
55
|
+
outputPath: string;
|
|
56
|
+
existingCode: string;
|
|
57
|
+
fallbackCode: string;
|
|
58
|
+
}
|
|
59
|
+
export interface RuntimeGenerationStrategy {
|
|
60
|
+
generateArtifact?: (input: RuntimeArtifactGenerationInput) => Promise<string | null | undefined>;
|
|
61
|
+
generateTest?: (input: RuntimeTestGenerationInput) => Promise<string | null | undefined>;
|
|
35
62
|
}
|
|
36
63
|
/**
|
|
37
64
|
* Result of a single build target.
|
|
@@ -42,6 +69,7 @@ export interface BuildTargetResult {
|
|
|
42
69
|
success: boolean;
|
|
43
70
|
skipped?: boolean;
|
|
44
71
|
error?: string;
|
|
72
|
+
generatedCode?: string;
|
|
45
73
|
}
|
|
46
74
|
/**
|
|
47
75
|
* Result of building from a spec.
|
|
@@ -49,6 +77,7 @@ export interface BuildTargetResult {
|
|
|
49
77
|
export interface BuildSpecResult {
|
|
50
78
|
specPath: string;
|
|
51
79
|
specInfo: SpecScanResult;
|
|
80
|
+
targetId: string;
|
|
52
81
|
results: BuildTargetResult[];
|
|
53
82
|
}
|
|
54
83
|
/**
|
|
@@ -59,3 +88,9 @@ export declare function buildSpec(specPath: string, adapters: {
|
|
|
59
88
|
logger: LoggerAdapter;
|
|
60
89
|
workspace?: typeof import('@contractspec/module.workspace');
|
|
61
90
|
}, config: ResolvedContractsrcConfig, options?: BuildSpecOptions): Promise<BuildSpecResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Detect default targets based on spec type.
|
|
93
|
+
*/
|
|
94
|
+
export declare function resolveDefaultBuildTargets(targetId: string, options: {
|
|
95
|
+
includeTests: boolean;
|
|
96
|
+
}): BuildTarget[];
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FsAdapter } from '../../ports/fs';
|
|
2
|
-
import type { ConnectInitInput } from './types';
|
|
3
|
-
export declare function initConnectWorkspace(fs: FsAdapter, input?: ConnectInitInput): Promise<
|
|
4
|
-
configPath: string;
|
|
5
|
-
targetRoot: string;
|
|
6
|
-
action: 'created' | 'merged';
|
|
7
|
-
}>;
|
|
2
|
+
import type { ConnectInitInput, ConnectInitResult } from './types';
|
|
3
|
+
export declare function initConnectWorkspace(fs: FsAdapter, input?: ConnectInitInput): Promise<ConnectInitResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ConnectVerdict, ResolvedContractsrcConfig } from '@contractspec/lib.contracts-spec/workspace-config';
|
|
2
|
+
import type { SetupFileResult, SetupGitignoreBehavior, SetupPromptCallbacks } from '../setup/types';
|
|
2
3
|
export type { ConnectVerdict };
|
|
3
4
|
export type ConnectActorType = 'human' | 'agent' | 'service' | 'tool';
|
|
4
5
|
export type ConnectApprovalStatus = 'not_required' | 'pending' | 'approved' | 'rejected' | 'expired';
|
|
@@ -33,6 +34,15 @@ export interface ConnectWorkspaceInput {
|
|
|
33
34
|
}
|
|
34
35
|
export interface ConnectInitInput extends ConnectWorkspaceInput {
|
|
35
36
|
scope?: 'workspace' | 'package';
|
|
37
|
+
interactive?: boolean;
|
|
38
|
+
gitignoreBehavior?: SetupGitignoreBehavior;
|
|
39
|
+
prompts?: Pick<SetupPromptCallbacks, 'confirm'>;
|
|
40
|
+
}
|
|
41
|
+
export interface ConnectInitResult {
|
|
42
|
+
configPath: string;
|
|
43
|
+
targetRoot: string;
|
|
44
|
+
action: 'created' | 'merged';
|
|
45
|
+
gitignore: SetupFileResult;
|
|
36
46
|
}
|
|
37
47
|
export interface ConnectTaskInput extends ConnectWorkspaceInput {
|
|
38
48
|
taskId: string;
|
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 {};
|
|
@@ -1,11 +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
8
|
export interface GenerateArtifactsOptions {
|
|
7
9
|
scanAllSpecs?: boolean;
|
|
8
10
|
specPattern?: string;
|
|
9
11
|
specSearchRoot?: string;
|
|
12
|
+
config?: ResolvedContractsrcConfig;
|
|
13
|
+
includeRuntimeTests?: boolean;
|
|
10
14
|
}
|
|
11
15
|
export declare function generateArtifacts(adapters: WorkspaceAdapters, contractsDir: string, generatedDir: string, rootPath?: string, options?: GenerateArtifactsOptions): Promise<GenerateArtifactsResult>;
|
package/dist/services/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './create/index';
|
|
|
13
13
|
export * from './delete';
|
|
14
14
|
export * from './deps';
|
|
15
15
|
export * from './diff';
|
|
16
|
+
export * from './discover';
|
|
16
17
|
export * from './docs/index';
|
|
17
18
|
export * from './doctor/index';
|
|
18
19
|
export * from './extract';
|
|
@@ -30,7 +31,9 @@ export * from './integrity-diagram';
|
|
|
30
31
|
export * from './layer-discovery';
|
|
31
32
|
export * from './list';
|
|
32
33
|
export * from './llm/index';
|
|
34
|
+
export * from './module-loader';
|
|
33
35
|
export * from './openapi/index';
|
|
36
|
+
export * from './package-scaffold';
|
|
34
37
|
export * from './quickstart/index';
|
|
35
38
|
export * from './regenerator';
|
|
36
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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -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[];
|
|
@@ -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 {};
|
|
@@ -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
|
*/
|
|
@@ -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",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"@ai-sdk/anthropic": "3.0.68",
|
|
35
35
|
"@ai-sdk/openai": "3.0.52",
|
|
36
36
|
"@contractspec/biome-config": "3.8.7",
|
|
37
|
-
"@contractspec/integration.runtime": "3.9.
|
|
38
|
-
"@contractspec/lib.ai-agent": "8.0.
|
|
37
|
+
"@contractspec/integration.runtime": "3.9.1",
|
|
38
|
+
"@contractspec/lib.ai-agent": "8.0.7",
|
|
39
39
|
"@contractspec/lib.ai-providers": "3.7.13",
|
|
40
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
41
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
42
|
-
"@contractspec/lib.contracts-transformers": "3.7.
|
|
43
|
-
"@contractspec/lib.source-extractors": "2.7.
|
|
44
|
-
"@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",
|
|
45
45
|
"@contractspec/lib.utils-typescript": "3.7.13",
|
|
46
46
|
"ai": "6.0.156",
|
|
47
47
|
"chalk": "^5.6.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadTypeScriptModule(filePath: string): Promise<any>;
|