diff --git a/packages/cli/package.json b/packages/cli/package.json index 7a5cda8..dbec0b2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -43,7 +43,6 @@ "@stackbilt/adf": "workspace:^", "@stackbilt/blast": "workspace:^", "@stackbilt/classify": "workspace:^", - "@stackbilt/contracts": "file:../../../contracts", "@stackbilt/core": "workspace:^", "@stackbilt/drift": "workspace:^", "@stackbilt/git": "workspace:^", diff --git a/packages/cli/src/http-client.ts b/packages/cli/src/http-client.ts index f918c3d..9cee885 100644 --- a/packages/cli/src/http-client.ts +++ b/packages/cli/src/http-client.ts @@ -8,7 +8,7 @@ import type { ScaffoldFileType, GovernanceDocsType, PromptContextType, -} from '@stackbilt/contracts/dist/scaffold-response'; +} from './types/scaffold-contract-types'; const DEFAULT_BASE_URL = process.env.STACKBILT_ENGINE_URL ?? 'https://api.stackbilt.dev/engine'; const GATEWAY_BASE_URL = 'https://mcp.stackbilt.dev'; diff --git a/packages/cli/src/types/scaffold-contract-types.ts b/packages/cli/src/types/scaffold-contract-types.ts new file mode 100644 index 0000000..634ea8b --- /dev/null +++ b/packages/cli/src/types/scaffold-contract-types.ts @@ -0,0 +1,100 @@ +/** + * Vendored type definitions for the Stackbilt scaffold-response contract. + * + * These types are structurally copied from @stackbilt/contracts to avoid + * a file: workspace dependency on an unpublished sibling repo. They are + * type-only (erased at compile time, zero runtime cost) and are used + * internally by http-client.ts — they are NOT re-exported from the public + * CLI surface in src/index.ts. + * + * When @stackbilt/contracts is properly published to npm, this file can be + * deleted and http-client.ts can re-import from the real package. + * + * Upstream source (as of @stackbilt/contracts@0.1.0): + * contracts/dist/scaffold-response/scaffold-response.contract.d.ts + * + * Type aliases follow the upstream naming convention with the `Type` suffix + * (e.g. `ScaffoldFile` → `ScaffoldFileType`), matching the re-exports in + * contracts/dist/scaffold-response/index.d.ts. + */ + +export type FileRoleType = 'config' | 'scaffold' | 'governance' | 'test' | 'doc'; + +export interface ScaffoldFileType { + path: string; + content: string; + role: FileRoleType; +} + +export interface GovernanceDocsType { + threat_model: string; + adr: string; + test_plan: string; +} + +export interface PromptContextMetaType { + project_type: string; + complexity: string; + confidence: string; + seed: number; +} + +export interface PromptContextRequirementType { + name: string; + priority: string; + effort: string; + acceptance: string; +} + +export interface PromptContextInterfaceType { + name: string; + layout: string; + components: string; +} + +export interface PromptContextThreatType { + name: string; + owasp: string; + likelihood: string; + impact: string; + mitigation: string; + detection: string; + response_time: string; +} + +export interface PromptContextRuntimeType { + name: string; + tier: string; + traits: string; +} + +export interface PromptContextTestPlanType { + name: string; + framework: string; + ci_stage: string; + coverage: string; + setup: string; + assertion_style: string; +} + +export interface PromptContextFirstTaskType { + name: string; + estimate: string; + complexity: string; + deliverable: string; + adr: string; +} + +export interface PromptContextType { + intention: string; + pattern: string; + meta: PromptContextMetaType; + requirement: PromptContextRequirementType; + interface: PromptContextInterfaceType; + threat: PromptContextThreatType; + runtime: PromptContextRuntimeType; + test_plan: PromptContextTestPlanType; + first_task: PromptContextFirstTaskType; + governance: GovernanceDocsType; + files: ScaffoldFileType[]; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b0aec15..2024b46 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,9 +57,6 @@ importers: '@stackbilt/classify': specifier: workspace:^ version: link:../classify - '@stackbilt/contracts': - specifier: file:../../../contracts - version: file:../contracts '@stackbilt/core': specifier: workspace:^ version: link:../core @@ -409,10 +406,6 @@ packages: cpu: [x64] os: [win32] - '@stackbilt/contracts@file:../contracts': - resolution: {directory: ../contracts, type: directory} - hasBin: true - '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} @@ -1186,10 +1179,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.57.1': optional: true - '@stackbilt/contracts@file:../contracts': - dependencies: - zod: 4.3.6 - '@standard-schema/spec@1.1.0': {} '@types/chai@5.2.3':