@contractspec/app.cli-contractspec 2.1.0 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 57e2819: chore: align Studio messaging with live product positioning
8
+ - Updated dependencies [57e2819]
9
+ - @contractspec/lib.contracts-spec@2.1.1
10
+ - @contractspec/bundle.workspace@2.1.1
11
+ - @contractspec/lib.ai-agent@2.1.1
12
+ - @contractspec/lib.contracts-integrations@2.1.1
13
+ - @contractspec/lib.contracts-transformers@2.1.1
14
+ - @contractspec/lib.plugins@2.1.1
15
+ - @contractspec/lib.testing@2.1.1
16
+ - @contractspec/module.ai-chat@2.1.1
17
+ - @contractspec/module.examples@2.1.1
18
+ - @contractspec/module.workspace@2.1.1
19
+
3
20
  ## 2.1.0
4
21
 
5
22
  ### Minor Changes
package/README.md CHANGED
@@ -682,6 +682,19 @@ Contributions welcome! Please:
682
682
 
683
683
  For more details, see [AGENT_MODES.md](./AGENT_MODES.md).
684
684
 
685
+ ## ContractSpec Studio
686
+
687
+ [ContractSpec Studio](https://app.contractspec.studio) is the AI-powered product decision engine built on top of ContractSpec. It turns product signals into spec-first deliverables through a deterministic loop:
688
+
689
+ ```text
690
+ Evidence -> Correlation -> Decision -> Change -> Export -> Check -> Notify -> Autopilot
691
+ ```
692
+
693
+ The CLI helps you define and validate specs locally; Studio runs the full product-truth loop in a collaborative SaaS workflow.
694
+
695
+ - Try Studio: https://app.contractspec.studio
696
+ - Learn more: https://contractspec.io
697
+
685
698
  ## Roadmap
686
699
 
687
700
  - [x] AI-powered code generation
package/dist/bun/cli.js CHANGED
@@ -45659,7 +45659,7 @@ The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If
45659
45659
  | Event | Description | Properties |
45660
45660
  |-------|-------------|------------|
45661
45661
  | \`cta_install_click\` | Clicked Install OSS CTA | \`surface\` |
45662
- | \`cta_studio_click\` | Clicked Studio waitlist CTA | \`surface\`, \`variant\` |
45662
+ | \`cta_studio_click\` | Clicked Studio CTA | \`surface\`, \`variant\` |
45663
45663
  | \`docs_quickstart_view\` | Entered quickstart docs path | \`surface\`, \`destination\` |
45664
45664
  | \`copy_command_click\` | Copied a command block | \`surface\`, \`language\`, \`filename\`, \`packageManager\` |
45665
45665
  | \`example_repo_open\` | Selected a template/example | \`surface\`, \`templateId\`, \`source\` |
@@ -50219,7 +50219,7 @@ Next steps:`)),console.log(K$.gray(` 1. Review drafts in ${Q}`)),console.log(K$
50219
50219
  \u26A0\uFE0F No OpenAPI sources configured.`)),!$.fix){if(await _Y({message:"Would you like to configure an OpenAPI source now?"})){let t0=await b9({message:"Enter a friendly name for this source:",default:"api"}),T$=await b9({message:"Enter OpenAPI spec URL or file path:"});if(T$.trim()){let _$={name:t0,syncMode:"sync",schemaFormat:"contractspec"};if(T$.startsWith("http://")||T$.startsWith("https://"))_$.url=T$;else _$.file=T$;await Hb0(_$),console.log(K$.green(`
50220
50220
  \u2705 Saved OpenAPI source '${t0}' to .contractsrc.json`)),console.log(K$.gray(` Run ${K$.cyan("contractspec openapi sync")} to import specs`))}}}else console.log(K$.gray(' Run ${chalk.cyan("contractspec init")} to configure OpenAPI sources'));else{console.log(K$.green(`
50221
50221
  \u2713 ${c0.length} OpenAPI source(s) configured`));for(let i0 of c0){let t0=i0.url??i0.file??"unknown";console.log(K$.gray(` \u2022 ${i0.name}: ${t0}`))}}if(!l.healthy)process.exit(1)}catch(x){C.fail("Doctor check failed"),console.error(K$.red(`
50222
- \u274C Error:`),x instanceof Error?x.message:String(x)),process.exit(1)}});tY();eP();dv();SQ();import{writeFile as jy1}from"fs/promises";function f14($){let Y=new Set(LN1),W=[];for(let Q of $.split(",")){let U=Q.trim();if(Y.has(U))W.push(U);else if(U)console.warn(K$.yellow(`Warning: Unknown check category '${U}'`))}return W}function h14(){let $=process.env.GITHUB_SERVER_URL,Y=process.env.GITHUB_REPOSITORY;return $&&Y?`${$}/${Y}`:void 0}var g14=new Q7("ci").description("Run all CI/CD validation checks with machine-readable output").option("-p, --pattern <glob>","Glob pattern for spec discovery").option("-f, --format <format>","Output format: text, json, sarif (default: text)","text").option("-o, --output <file>","Write results to file (stdout if not specified)").option("--fail-on-warnings","Exit with code 2 on warnings (default: errors only)",!1).option("--skip <checks>","Skip specific checks (comma-separated: structure,integrity,deps,doctor,handlers,tests)").option("--checks <checks>","Only run specific checks (comma-separated)").option("--check-handlers","Include handler implementation checks",!1).option("--check-tests","Include test coverage checks",!1).option("--check-drift","Include drift detection checks",!1).option("-v, --verbose","Verbose output",!1).action(V09);async function V09($){let Y=$.format==="text"||!$.format,W=Y?J3("Running CI checks...").start():null;try{let Q=wH({silent:!0});if(!Y)Q.logger={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},createProgress:()=>({start:()=>{},update:()=>{},succeed:()=>{},fail:()=>{},warn:()=>{},stop:()=>{}})};let U=await LV(),q={pattern:$.pattern,checkHandlers:$.checkHandlers,checkTests:$.checkTests,checkDrift:$.checkDrift,failOnWarnings:$.failOnWarnings,workspaceRoot:process.cwd(),config:U};if($.checks)q.checks=f14($.checks);if($.skip)q.skip=f14($.skip);let D=await zP1(Q,q);W?.stop();let w;switch($.format){case"json":w=Os.formatAsJson(D,{pretty:!0});break;case"sarif":{let R=Os.formatAsSarif(D,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:h14()});w=Os.sarifToJson(R);break}case"text":default:w=D09(D,$.verbose??!1);break}if($.output){if(await jy1($.output,w,"utf-8"),Y)console.log(K$.green(`\u2713 Results written to ${$.output}`))}else console.log(w);if(!D.success)process.exit(1);else if($.failOnWarnings&&D.totalWarnings>0)process.exit(2);if(D.success&&Y)console.log(),console.log(K$.bold("Looking for managed CI gates?")),console.log(" Studio adds policy approvals, drift dashboards, and audit trails."),console.log(" Join the waitlist: https://contractspec.io/contact#waitlist")}catch(Q){W?.fail("CI checks failed");let U=Q instanceof Error?Q.message:String(Q);if($.format==="json"||$.format==="sarif"){let q={success:!1,totalErrors:1,totalWarnings:0,totalNotes:0,issues:[{ruleId:"ci-internal-error",severity:"error",message:`CI check execution failed: ${U}`,category:"doctor",file:void 0,line:void 0,context:void 0}],categories:[],durationMs:0,timestamp:new Date().toISOString(),commitSha:void 0,branch:void 0};if($.format==="json"){let D=Os.formatAsJson(q,{pretty:!0});if($.output)await jy1($.output,D,"utf-8");else console.log(D)}else{let D=Os.formatAsSarif(q,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:h14()}),w=Os.sarifToJson(D);if($.output)await jy1($.output,w,"utf-8");else console.log(w)}}else console.error(K$.red(`
50222
+ \u274C Error:`),x instanceof Error?x.message:String(x)),process.exit(1)}});tY();eP();dv();SQ();import{writeFile as jy1}from"fs/promises";function f14($){let Y=new Set(LN1),W=[];for(let Q of $.split(",")){let U=Q.trim();if(Y.has(U))W.push(U);else if(U)console.warn(K$.yellow(`Warning: Unknown check category '${U}'`))}return W}function h14(){let $=process.env.GITHUB_SERVER_URL,Y=process.env.GITHUB_REPOSITORY;return $&&Y?`${$}/${Y}`:void 0}var g14=new Q7("ci").description("Run all CI/CD validation checks with machine-readable output").option("-p, --pattern <glob>","Glob pattern for spec discovery").option("-f, --format <format>","Output format: text, json, sarif (default: text)","text").option("-o, --output <file>","Write results to file (stdout if not specified)").option("--fail-on-warnings","Exit with code 2 on warnings (default: errors only)",!1).option("--skip <checks>","Skip specific checks (comma-separated: structure,integrity,deps,doctor,handlers,tests)").option("--checks <checks>","Only run specific checks (comma-separated)").option("--check-handlers","Include handler implementation checks",!1).option("--check-tests","Include test coverage checks",!1).option("--check-drift","Include drift detection checks",!1).option("-v, --verbose","Verbose output",!1).action(V09);async function V09($){let Y=$.format==="text"||!$.format,W=Y?J3("Running CI checks...").start():null;try{let Q=wH({silent:!0});if(!Y)Q.logger={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},createProgress:()=>({start:()=>{},update:()=>{},succeed:()=>{},fail:()=>{},warn:()=>{},stop:()=>{}})};let U=await LV(),q={pattern:$.pattern,checkHandlers:$.checkHandlers,checkTests:$.checkTests,checkDrift:$.checkDrift,failOnWarnings:$.failOnWarnings,workspaceRoot:process.cwd(),config:U};if($.checks)q.checks=f14($.checks);if($.skip)q.skip=f14($.skip);let D=await zP1(Q,q);W?.stop();let w;switch($.format){case"json":w=Os.formatAsJson(D,{pretty:!0});break;case"sarif":{let R=Os.formatAsSarif(D,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:h14()});w=Os.sarifToJson(R);break}case"text":default:w=D09(D,$.verbose??!1);break}if($.output){if(await jy1($.output,w,"utf-8"),Y)console.log(K$.green(`\u2713 Results written to ${$.output}`))}else console.log(w);if(!D.success)process.exit(1);else if($.failOnWarnings&&D.totalWarnings>0)process.exit(2);if(D.success&&Y)console.log(),console.log(K$.bold("Want evidence-backed decisions for your specs?")),console.log(" Studio correlates product signals and compiles decisions into spec diffs and task packs."),console.log(" Try Studio: https://app.contractspec.studio")}catch(Q){W?.fail("CI checks failed");let U=Q instanceof Error?Q.message:String(Q);if($.format==="json"||$.format==="sarif"){let q={success:!1,totalErrors:1,totalWarnings:0,totalNotes:0,issues:[{ruleId:"ci-internal-error",severity:"error",message:`CI check execution failed: ${U}`,category:"doctor",file:void 0,line:void 0,context:void 0}],categories:[],durationMs:0,timestamp:new Date().toISOString(),commitSha:void 0,branch:void 0};if($.format==="json"){let D=Os.formatAsJson(q,{pretty:!0});if($.output)await jy1($.output,D,"utf-8");else console.log(D)}else{let D=Os.formatAsSarif(q,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:h14()}),w=Os.sarifToJson(D);if($.output)await jy1($.output,w,"utf-8");else console.log(w)}}else console.error(K$.red(`
50223
50223
  \u274C Error:`),U);process.exit(1)}}function D09($,Y){return Os.formatAsTextLines($,{verbose:Y,showTiming:!0}).map((Q)=>{let U=" ".repeat(Q.indent??0),q=Q.text;switch(Q.style){case"bold":q=K$.bold(q);break;case"error":q=K$.red(q);break;case"warning":q=K$.yellow(q);break;case"success":q=K$.green(q);break;case"muted":q=K$.gray(q);break}return U+q}).join(`
50224
50224
  `)}tY();nR();SQ();import{resolve as m14}from"path";import{existsSync as F09,writeFileSync as O09}from"fs";var u14=new Q7("export").description("Export a spec to markdown for LLM consumption").argument("<spec-file>","Path to the spec file").option("-f, --format <format>","Export format: context, full, prompt","full").option("-o, --output <file>","Output file (default: stdout)").action(async($,Y)=>{try{console.log(K$.blue(`
50225
50225
  \uD83D\uDCC4 Exporting ${$}...
@@ -50329,7 +50329,7 @@ Error:`),U instanceof Error?U.message:String(U))}}async function $$9(){let $=LV$
50329
50329
  \uD83D\uDCCA Summary:
50330
50330
  `)),console.log(` ${C.summary}`),C.success&&!$.dryRun)console.log(K$.bold(`
50331
50331
  \uD83D\uDE80 Next steps:
50332
- `)),console.log(" 1. Create your first spec:"),console.log(` ${K$.cyan("contractspec create command order.create")}`),console.log(" 2. Validate your specs:"),console.log(` ${K$.cyan("contractspec validate")}`),console.log(" 3. Check your setup:"),console.log(` ${K$.cyan("contractspec doctor")}`),console.log(),console.log(K$.bold("Ready for Studio-scale workflows?")),console.log(" Studio adds managed policy gates, shared registries, and audit trails."),console.log(" Join the waitlist: https://contractspec.io/contact#waitlist"),console.log();if(!C.success)process.exit(1)}catch(R){w.fail("Quickstart failed"),console.error(K$.red(`
50332
+ `)),console.log(" 1. Create your first spec:"),console.log(` ${K$.cyan("contractspec create command order.create")}`),console.log(" 2. Validate your specs:"),console.log(` ${K$.cyan("contractspec validate")}`),console.log(" 3. Check your setup:"),console.log(` ${K$.cyan("contractspec doctor")}`),console.log(),console.log(K$.bold("Want to turn product signals into spec-first deliverables?")),console.log(" ContractSpec Studio is the AI-powered product decision engine built on ContractSpec."),console.log(" Try Studio: https://app.contractspec.studio"),console.log();if(!C.success)process.exit(1)}catch(R){w.fail("Quickstart failed"),console.error(K$.red(`
50333
50333
  \u274C Error:`),R instanceof Error?R.message:String(R)),process.exit(1)}});SQ();function Z64(){return new Q7("impact").description("Detect breaking and non-breaking contract changes").option("-b, --baseline <ref>","Git ref to compare against (branch, tag, commit)").option("-f, --format <format>","Output format (text, json, markdown, check-run)","text").option("--fail-on-breaking","Exit with error code if breaking changes detected").option("-p, --pattern <glob>","Glob pattern for spec discovery").option("-q, --quiet","Minimal output").action(X$9)}async function X$9($){let Y=VV(),W=Lm(),U=$.format==="text"||!$.format?Gw():TY$();try{let q=await AQ0.detectImpact({fs:Y,git:W,logger:U},{baseline:$.baseline,pattern:$.pattern}),D=$.format??"text",w;switch(D){case"json":w=AQ0.formatJson(q);break;case"markdown":w=AQ0.formatPrComment(q,{template:"detailed"});break;case"check-run":w=JSON.stringify(AQ0.formatCheckRun(q,"HEAD",{failOnBreaking:$.failOnBreaking}),null,2);break;case"text":default:w=Y$9(q);break}if(console.log(w),$.failOnBreaking&&q.hasBreaking)process.exit(1)}catch(q){U.error("Impact detection failed",{error:q}),process.exit(1)}}function Y$9($){let Y=[];if($.hasBreaking)Y.push("\u274C Breaking changes detected");else if($.hasNonBreaking)Y.push("\u26A0\uFE0F Contract changed (non-breaking)");else Y.push("\u2705 No contract impact");if(Y.push(""),$.summary.breaking>0)Y.push(` Breaking: ${$.summary.breaking}`);if($.summary.nonBreaking>0)Y.push(` Non-breaking: ${$.summary.nonBreaking}`);if($.summary.added>0)Y.push(` Added: ${$.summary.added}`);if($.summary.removed>0)Y.push(` Removed: ${$.summary.removed}`);if($.deltas.length>0){Y.push(""),Y.push("Changes:");for(let W of $.deltas.slice(0,20)){let Q=W.severity==="breaking"?"\uD83D\uDD34":W.severity==="non_breaking"?"\uD83D\uDFE1":"\uD83D\uDD35";Y.push(` ${Q} ${W.specKey}: ${W.description}`)}if($.deltas.length>20)Y.push(` ... and ${$.deltas.length-20} more`)}return Y.join(`
50334
50334
  `)}tY();eP();import{existsSync as G64,mkdirSync as Z$9,writeFileSync as Q$9}from"fs";import{dirname as G$9,resolve as U$9}from"path";var J$9={name:"ContractSpec CI",mode:"validate",checks:["all"],failOnWarnings:!1,failOnBreaking:!0,prComment:!0,uploadSarif:!0,workingDirectory:".",nodeVersion:"20",bunVersion:"latest"};function W$9($){return`
50335
50335
  validate:
@@ -50503,5 +50503,5 @@ ${_}`}).join(`
50503
50503
  \u274C Error:`),Y instanceof Error?Y.message:String(Y)),process.exit(1)}});var x$9=zU.command("regenerator").description("Operate the Regenerator daemon").argument("<blueprint-file>","Path to AppBlueprintSpec file").argument("<tenant-file>","Path to TenantAppConfig file").argument("<rules-file>","Path to module exporting regenerator rules").argument("<sink-file>",'Path to module exporting a proposal sink (use "auto" with --executor)').option("-p, --poll-interval <ms>","Polling interval in ms (default 60000)",($)=>Number.parseInt($,10)).option("-b, --batch-duration <ms>","Lookback duration in ms (default 300000)",($)=>Number.parseInt($,10)).option("--once","Run a single evaluation cycle then exit").option("--contexts <path>","Optional file exporting an array of RegenerationContext overrides").option("--executor <path>",'Module exporting a ProposalExecutor instance, factory, or deps (required when sink is "auto")').option("--dry-run","Execute proposals in dry-run mode when using executor sink").action(async($,Y,W,Q,U)=>{try{let q=await LV(),D=qu(q,U);await NT6($,Y,W,Q,U,D)}catch(q){console.error(K$.red(`
50504
50504
  \u274C Error:`),q instanceof Error?q.message:String(q)),process.exit(1)}});lU(x$9,ke);zU.addCommand(lU(j64,Tu));function h64(){zU.parse()}h64();
50505
50505
 
50506
- //# debugId=1F215EE4A471FD4064756E2164756E21
50506
+ //# debugId=BE9D00852F8DE78164756E2164756E21
50507
50507
  //# sourceMappingURL=cli.js.map
package/dist/node/cli.js CHANGED
@@ -45848,7 +45848,7 @@ The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If
45848
45848
  | Event | Description | Properties |
45849
45849
  |-------|-------------|------------|
45850
45850
  | \`cta_install_click\` | Clicked Install OSS CTA | \`surface\` |
45851
- | \`cta_studio_click\` | Clicked Studio waitlist CTA | \`surface\`, \`variant\` |
45851
+ | \`cta_studio_click\` | Clicked Studio CTA | \`surface\`, \`variant\` |
45852
45852
  | \`docs_quickstart_view\` | Entered quickstart docs path | \`surface\`, \`destination\` |
45853
45853
  | \`copy_command_click\` | Copied a command block | \`surface\`, \`language\`, \`filename\`, \`packageManager\` |
45854
45854
  | \`example_repo_open\` | Selected a template/example | \`surface\`, \`templateId\`, \`source\` |
@@ -50408,7 +50408,7 @@ Next steps:`)),console.log(O0.gray(` 1. Review drafts in ${Z}`)),console.log(O0
50408
50408
  ⚠️ No OpenAPI sources configured.`)),!$.fix){if(await iY({message:"Would you like to configure an OpenAPI source now?"})){let n$=await iX({message:"Enter a friendly name for this source:",default:"api"}),R0=await iX({message:"Enter OpenAPI spec URL or file path:"});if(R0.trim()){let j0={name:n$,syncMode:"sync",schemaFormat:"contractspec"};if(R0.startsWith("http://")||R0.startsWith("https://"))j0.url=R0;else j0.file=R0;await mh$(j0),console.log(O0.green(`
50409
50409
  ✅ Saved OpenAPI source '${n$}' to .contractsrc.json`)),console.log(O0.gray(` Run ${O0.cyan("contractspec openapi sync")} to import specs`))}}}else console.log(O0.gray(' Run ${chalk.cyan("contractspec init")} to configure OpenAPI sources'));else{console.log(O0.green(`
50410
50410
  ✓ ${x$.length} OpenAPI source(s) configured`));for(let c$ of x$){let n$=c$.url??c$.file??"unknown";console.log(O0.gray(` • ${c$.name}: ${n$}`))}}if(!u.healthy)process.exit(1)}catch(C){N.fail("Doctor check failed"),console.error(O0.red(`
50411
- ❌ Error:`),C instanceof Error?C.message:String(C)),process.exit(1)}});V5();CE();Gy();zG();import{writeFile as Gn1}from"fs/promises";function kV4($){let J=new Set(rb1),Q=[];for(let Z of $.split(",")){let G=Z.trim();if(J.has(G))Q.push(G);else if(G)console.warn(O0.yellow(`Warning: Unknown check category '${G}'`))}return Q}function bV4(){let $=process.env.GITHUB_SERVER_URL,J=process.env.GITHUB_REPOSITORY;return $&&J?`${$}/${J}`:void 0}var xV4=new VJ("ci").description("Run all CI/CD validation checks with machine-readable output").option("-p, --pattern <glob>","Glob pattern for spec discovery").option("-f, --format <format>","Output format: text, json, sarif (default: text)","text").option("-o, --output <file>","Write results to file (stdout if not specified)").option("--fail-on-warnings","Exit with code 2 on warnings (default: errors only)",!1).option("--skip <checks>","Skip specific checks (comma-separated: structure,integrity,deps,doctor,handlers,tests)").option("--checks <checks>","Only run specific checks (comma-separated)").option("--check-handlers","Include handler implementation checks",!1).option("--check-tests","Include test coverage checks",!1).option("--check-drift","Include drift detection checks",!1).option("-v, --verbose","Verbose output",!1).action(wlX);async function wlX($){let J=$.format==="text"||!$.format,Q=J?mH("Running CI checks...").start():null;try{let Z=e2({silent:!0});if(!J)Z.logger={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},createProgress:()=>({start:()=>{},update:()=>{},succeed:()=>{},fail:()=>{},warn:()=>{},stop:()=>{}})};let G=await LD(),H={pattern:$.pattern,checkHandlers:$.checkHandlers,checkTests:$.checkTests,checkDrift:$.checkDrift,failOnWarnings:$.failOnWarnings,workspaceRoot:process.cwd(),config:G};if($.checks)H.checks=kV4($.checks);if($.skip)H.skip=kV4($.skip);let O=await kx1(Z,H);Q?.stop();let F;switch($.format){case"json":F=R$$.formatAsJson(O,{pretty:!0});break;case"sarif":{let L=R$$.formatAsSarif(O,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:bV4()});F=R$$.sarifToJson(L);break}case"text":default:F=AlX(O,$.verbose??!1);break}if($.output){if(await Gn1($.output,F,"utf-8"),J)console.log(O0.green(`✓ Results written to ${$.output}`))}else console.log(F);if(!O.success)process.exit(1);else if($.failOnWarnings&&O.totalWarnings>0)process.exit(2);if(O.success&&J)console.log(),console.log(O0.bold("Looking for managed CI gates?")),console.log(" Studio adds policy approvals, drift dashboards, and audit trails."),console.log(" Join the waitlist: https://contractspec.io/contact#waitlist")}catch(Z){Q?.fail("CI checks failed");let G=Z instanceof Error?Z.message:String(Z);if($.format==="json"||$.format==="sarif"){let H={success:!1,totalErrors:1,totalWarnings:0,totalNotes:0,issues:[{ruleId:"ci-internal-error",severity:"error",message:`CI check execution failed: ${G}`,category:"doctor",file:void 0,line:void 0,context:void 0}],categories:[],durationMs:0,timestamp:new Date().toISOString(),commitSha:void 0,branch:void 0};if($.format==="json"){let O=R$$.formatAsJson(H,{pretty:!0});if($.output)await Gn1($.output,O,"utf-8");else console.log(O)}else{let O=R$$.formatAsSarif(H,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:bV4()}),F=R$$.sarifToJson(O);if($.output)await Gn1($.output,F,"utf-8");else console.log(F)}}else console.error(O0.red(`
50411
+ ❌ Error:`),C instanceof Error?C.message:String(C)),process.exit(1)}});V5();CE();Gy();zG();import{writeFile as Gn1}from"fs/promises";function kV4($){let J=new Set(rb1),Q=[];for(let Z of $.split(",")){let G=Z.trim();if(J.has(G))Q.push(G);else if(G)console.warn(O0.yellow(`Warning: Unknown check category '${G}'`))}return Q}function bV4(){let $=process.env.GITHUB_SERVER_URL,J=process.env.GITHUB_REPOSITORY;return $&&J?`${$}/${J}`:void 0}var xV4=new VJ("ci").description("Run all CI/CD validation checks with machine-readable output").option("-p, --pattern <glob>","Glob pattern for spec discovery").option("-f, --format <format>","Output format: text, json, sarif (default: text)","text").option("-o, --output <file>","Write results to file (stdout if not specified)").option("--fail-on-warnings","Exit with code 2 on warnings (default: errors only)",!1).option("--skip <checks>","Skip specific checks (comma-separated: structure,integrity,deps,doctor,handlers,tests)").option("--checks <checks>","Only run specific checks (comma-separated)").option("--check-handlers","Include handler implementation checks",!1).option("--check-tests","Include test coverage checks",!1).option("--check-drift","Include drift detection checks",!1).option("-v, --verbose","Verbose output",!1).action(wlX);async function wlX($){let J=$.format==="text"||!$.format,Q=J?mH("Running CI checks...").start():null;try{let Z=e2({silent:!0});if(!J)Z.logger={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},createProgress:()=>({start:()=>{},update:()=>{},succeed:()=>{},fail:()=>{},warn:()=>{},stop:()=>{}})};let G=await LD(),H={pattern:$.pattern,checkHandlers:$.checkHandlers,checkTests:$.checkTests,checkDrift:$.checkDrift,failOnWarnings:$.failOnWarnings,workspaceRoot:process.cwd(),config:G};if($.checks)H.checks=kV4($.checks);if($.skip)H.skip=kV4($.skip);let O=await kx1(Z,H);Q?.stop();let F;switch($.format){case"json":F=R$$.formatAsJson(O,{pretty:!0});break;case"sarif":{let L=R$$.formatAsSarif(O,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:bV4()});F=R$$.sarifToJson(L);break}case"text":default:F=AlX(O,$.verbose??!1);break}if($.output){if(await Gn1($.output,F,"utf-8"),J)console.log(O0.green(`✓ Results written to ${$.output}`))}else console.log(F);if(!O.success)process.exit(1);else if($.failOnWarnings&&O.totalWarnings>0)process.exit(2);if(O.success&&J)console.log(),console.log(O0.bold("Want evidence-backed decisions for your specs?")),console.log(" Studio correlates product signals and compiles decisions into spec diffs and task packs."),console.log(" Try Studio: https://app.contractspec.studio")}catch(Z){Q?.fail("CI checks failed");let G=Z instanceof Error?Z.message:String(Z);if($.format==="json"||$.format==="sarif"){let H={success:!1,totalErrors:1,totalWarnings:0,totalNotes:0,issues:[{ruleId:"ci-internal-error",severity:"error",message:`CI check execution failed: ${G}`,category:"doctor",file:void 0,line:void 0,context:void 0}],categories:[],durationMs:0,timestamp:new Date().toISOString(),commitSha:void 0,branch:void 0};if($.format==="json"){let O=R$$.formatAsJson(H,{pretty:!0});if($.output)await Gn1($.output,O,"utf-8");else console.log(O)}else{let O=R$$.formatAsSarif(H,{toolName:"ContractSpec",toolVersion:"1.0.0",workingDirectory:process.cwd(),repositoryUri:bV4()}),F=R$$.sarifToJson(O);if($.output)await Gn1($.output,F,"utf-8");else console.log(F)}}else console.error(O0.red(`
50412
50412
  ❌ Error:`),G);process.exit(1)}}function AlX($,J){return R$$.formatAsTextLines($,{verbose:J,showTiming:!0}).map((Z)=>{let G=" ".repeat(Z.indent??0),H=Z.text;switch(Z.style){case"bold":H=O0.bold(H);break;case"error":H=O0.red(H);break;case"warning":H=O0.yellow(H);break;case"success":H=O0.green(H);break;case"muted":H=O0.gray(H);break}return G+H}).join(`
50413
50413
  `)}V5();GR();zG();import{resolve as fV4}from"path";import{existsSync as MlX,writeFileSync as LlX}from"fs";var yV4=new VJ("export").description("Export a spec to markdown for LLM consumption").argument("<spec-file>","Path to the spec file").option("-f, --format <format>","Export format: context, full, prompt","full").option("-o, --output <file>","Output file (default: stdout)").action(async($,J)=>{try{console.log(O0.blue(`
50414
50414
  \uD83D\uDCC4 Exporting ${$}...
@@ -50518,7 +50518,7 @@ Error:`),G instanceof Error?G.message:String(G))}}async function QpX(){let $=DL0
50518
50518
  \uD83D\uDCCA Summary:
50519
50519
  `)),console.log(` ${N.summary}`),N.success&&!$.dryRun)console.log(O0.bold(`
50520
50520
  \uD83D\uDE80 Next steps:
50521
- `)),console.log(" 1. Create your first spec:"),console.log(` ${O0.cyan("contractspec create command order.create")}`),console.log(" 2. Validate your specs:"),console.log(` ${O0.cyan("contractspec validate")}`),console.log(" 3. Check your setup:"),console.log(` ${O0.cyan("contractspec doctor")}`),console.log(),console.log(O0.bold("Ready for Studio-scale workflows?")),console.log(" Studio adds managed policy gates, shared registries, and audit trails."),console.log(" Join the waitlist: https://contractspec.io/contact#waitlist"),console.log();if(!N.success)process.exit(1)}catch(L){F.fail("Quickstart failed"),console.error(O0.red(`
50521
+ `)),console.log(" 1. Create your first spec:"),console.log(` ${O0.cyan("contractspec create command order.create")}`),console.log(" 2. Validate your specs:"),console.log(` ${O0.cyan("contractspec validate")}`),console.log(" 3. Check your setup:"),console.log(` ${O0.cyan("contractspec doctor")}`),console.log(),console.log(O0.bold("Want to turn product signals into spec-first deliverables?")),console.log(" ContractSpec Studio is the AI-powered product decision engine built on ContractSpec."),console.log(" Try Studio: https://app.contractspec.studio"),console.log();if(!N.success)process.exit(1)}catch(L){F.fail("Quickstart failed"),console.error(O0.red(`
50522
50522
  ❌ Error:`),L instanceof Error?L.message:String(L)),process.exit(1)}});zG();function JF4(){return new VJ("impact").description("Detect breaking and non-breaking contract changes").option("-b, --baseline <ref>","Git ref to compare against (branch, tag, commit)").option("-f, --format <format>","Output format (text, json, markdown, check-run)","text").option("--fail-on-breaking","Exit with error code if breaking changes detected").option("-p, --pattern <glob>","Glob pattern for spec discovery").option("-q, --quiet","Minimal output").action(zpX)}async function zpX($){let J=OD(),Q=ud(),G=$.format==="text"||!$.format?qA():KZ0();try{let H=await VK$.detectImpact({fs:J,git:Q,logger:G},{baseline:$.baseline,pattern:$.pattern}),O=$.format??"text",F;switch(O){case"json":F=VK$.formatJson(H);break;case"markdown":F=VK$.formatPrComment(H,{template:"detailed"});break;case"check-run":F=JSON.stringify(VK$.formatCheckRun(H,"HEAD",{failOnBreaking:$.failOnBreaking}),null,2);break;case"text":default:F=WpX(H);break}if(console.log(F),$.failOnBreaking&&H.hasBreaking)process.exit(1)}catch(H){G.error("Impact detection failed",{error:H}),process.exit(1)}}function WpX($){let J=[];if($.hasBreaking)J.push("❌ Breaking changes detected");else if($.hasNonBreaking)J.push("⚠️ Contract changed (non-breaking)");else J.push("✅ No contract impact");if(J.push(""),$.summary.breaking>0)J.push(` Breaking: ${$.summary.breaking}`);if($.summary.nonBreaking>0)J.push(` Non-breaking: ${$.summary.nonBreaking}`);if($.summary.added>0)J.push(` Added: ${$.summary.added}`);if($.summary.removed>0)J.push(` Removed: ${$.summary.removed}`);if($.deltas.length>0){J.push(""),J.push("Changes:");for(let Q of $.deltas.slice(0,20)){let Z=Q.severity==="breaking"?"\uD83D\uDD34":Q.severity==="non_breaking"?"\uD83D\uDFE1":"\uD83D\uDD35";J.push(` ${Z} ${Q.specKey}: ${Q.description}`)}if($.deltas.length>20)J.push(` ... and ${$.deltas.length-20} more`)}return J.join(`
50523
50523
  `)}V5();CE();import{existsSync as QF4,mkdirSync as HpX,writeFileSync as KpX}from"node:fs";import{dirname as qpX,resolve as BpX}from"node:path";var ZpX={name:"ContractSpec CI",mode:"validate",checks:["all"],failOnWarnings:!1,failOnBreaking:!0,prComment:!0,uploadSarif:!0,workingDirectory:".",nodeVersion:"20",bunVersion:"latest"};function GpX($){return`
50524
50524
  validate:
@@ -50692,5 +50692,5 @@ ${_}`}).join(`
50692
50692
  ❌ Error:`),J instanceof Error?J.message:String(J)),process.exit(1)}});var ypX=fU.command("regenerator").description("Operate the Regenerator daemon").argument("<blueprint-file>","Path to AppBlueprintSpec file").argument("<tenant-file>","Path to TenantAppConfig file").argument("<rules-file>","Path to module exporting regenerator rules").argument("<sink-file>",'Path to module exporting a proposal sink (use "auto" with --executor)').option("-p, --poll-interval <ms>","Polling interval in ms (default 60000)",($)=>Number.parseInt($,10)).option("-b, --batch-duration <ms>","Lookback duration in ms (default 300000)",($)=>Number.parseInt($,10)).option("--once","Run a single evaluation cycle then exit").option("--contexts <path>","Optional file exporting an array of RegenerationContext overrides").option("--executor <path>",'Module exporting a ProposalExecutor instance, factory, or deps (required when sink is "auto")').option("--dry-run","Execute proposals in dry-run mode when using executor sink").action(async($,J,Q,Z,G)=>{try{let H=await LD(),O=vc(H,G);await ys6($,J,Q,Z,G,O)}catch(H){console.error(O0.red(`
50693
50693
  ❌ Error:`),H instanceof Error?H.message:String(H)),process.exit(1)}});L2(ypX,Q4$);fU.addCommand(L2(RF4,sc));function bF4(){fU.parse()}bF4();
50694
50694
 
50695
- //# debugId=B3FDE182138BD92F64756E2164756E21
50695
+ //# debugId=90E2D9634FFB599A64756E2164756E21
50696
50696
  //# sourceMappingURL=cli.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/app.cli-contractspec",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "CLI tool for creating, building, and validating contract specifications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,17 +30,17 @@
30
30
  "dependencies": {
31
31
  "@ai-sdk/anthropic": "3.0.44",
32
32
  "@ai-sdk/openai": "3.0.29",
33
- "@contractspec/bundle.workspace": "2.1.0",
34
- "@contractspec/lib.ai-agent": "2.1.0",
33
+ "@contractspec/bundle.workspace": "2.1.1",
34
+ "@contractspec/lib.ai-agent": "2.1.1",
35
35
  "@contractspec/lib.ai-providers": "2.1.0",
36
- "@contractspec/lib.contracts-spec": "2.1.0",
37
- "@contractspec/lib.contracts-transformers": "2.1.0",
38
- "@contractspec/lib.plugins": "2.1.0",
36
+ "@contractspec/lib.contracts-spec": "2.1.1",
37
+ "@contractspec/lib.contracts-transformers": "2.1.1",
38
+ "@contractspec/lib.plugins": "2.1.1",
39
39
  "@contractspec/lib.schema": "2.1.0",
40
- "@contractspec/lib.testing": "2.1.0",
41
- "@contractspec/module.ai-chat": "2.1.0",
42
- "@contractspec/module.examples": "2.1.0",
43
- "@contractspec/module.workspace": "2.1.0",
40
+ "@contractspec/lib.testing": "2.1.1",
41
+ "@contractspec/module.ai-chat": "2.1.1",
42
+ "@contractspec/module.examples": "2.1.1",
43
+ "@contractspec/module.workspace": "2.1.1",
44
44
  "@inquirer/prompts": "^8.2.1",
45
45
  "ai": "6.0.86",
46
46
  "chalk": "^5.6.2",
@@ -51,7 +51,7 @@
51
51
  "ora": "^9.3.0",
52
52
  "typescript": "^5.9.3",
53
53
  "zod": "^4.3.5",
54
- "@contractspec/lib.contracts-integrations": "2.1.0"
54
+ "@contractspec/lib.contracts-integrations": "2.1.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@contractspec/tool.tsdown": "2.1.0",