@@ -2,7 +2,11 @@ import fs from "node:fs";
22import os from "node:os" ;
33import path from "node:path" ;
44import { build } from "tsdown" ;
5- import { buildPluginSdkEntrySources , pluginSdkEntrypoints } from "./lib/plugin-sdk-entries.mjs" ;
5+ import {
6+ buildPluginSdkEntrySources ,
7+ pluginSdkEntrypoints ,
8+ publicPluginSdkEntrypoints ,
9+ } from "./lib/plugin-sdk-entries.mjs" ;
610
711const RUNTIME_SHIMS : Partial < Record < string , string > > = {
812 "webhook-path" : [
@@ -67,14 +71,19 @@ function copyFlatDeclarations(fromDir: string, toDir: string): void {
6771
6872const distPluginSdkDir = path . join ( process . cwd ( ) , "dist/plugin-sdk" ) ;
6973const flatDeclarationTempDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "openclaw-plugin-sdk-dts-" ) ) ;
74+ const shouldBuildPrivateQaEntries = process . env . OPENCLAW_BUILD_PRIVATE_QA === "1" ;
75+ const flatDeclarationEntrypoints = shouldBuildPrivateQaEntries
76+ ? pluginSdkEntrypoints
77+ : publicPluginSdkEntrypoints ;
78+ const flatDeclarationEntrypointSet = new Set ( flatDeclarationEntrypoints ) ;
7079
7180try {
7281 await build ( {
7382 clean : true ,
7483 config : false ,
7584 deps : { neverBundle : ( id ) => isBareImportSpecifier ( id ) } ,
7685 dts : true ,
77- entry : buildPluginSdkEntrySources ( ) ,
86+ entry : buildPluginSdkEntrySources ( flatDeclarationEntrypoints ) ,
7887 failOnWarn : false ,
7988 fixedExtension : false ,
8089 format : "esm" ,
@@ -96,6 +105,10 @@ try {
96105// The private workspace package keeps source-shaped declaration paths for local
97106// package-boundary projects, so bridge them back to the packaged flat entries.
98107for ( const entry of pluginSdkEntrypoints ) {
108+ if ( ! flatDeclarationEntrypointSet . has ( entry ) ) {
109+ continue ;
110+ }
111+
99112 const packageTypeOut = path . join (
100113 process . cwd ( ) ,
101114 `packages/plugin-sdk/dist/src/plugin-sdk/${ entry } .d.ts` ,
0 commit comments