File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export function getContainerPackager(): RuntimePackager {
6767 * Automatically selects the appropriate packager based on build type and runtime version.
6868 */
6969export async function packRuntime ( spec : AgentEnvSpec , options ?: PackageOptions ) : Promise < ArtifactResult > {
70- const packager = spec . build === 'Container' ? getContainerPackager ( ) : getRuntimePackager ( spec . runtimeVersion ) ;
70+ const packager = spec . build === 'Container' ? getContainerPackager ( ) : getRuntimePackager ( spec . runtimeVersion ! ) ;
7171 return packager . pack ( spec , options ) ;
7272}
7373
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export class NodeCodeZipPackager implements RuntimePackager {
5454 throw new PackagingError ( 'Node packager only supports CodeZip build type.' ) ;
5555 }
5656
57- if ( ! isNodeRuntimeVersion ( spec . runtimeVersion ) ) {
57+ if ( ! isNodeRuntimeVersion ( spec . runtimeVersion ! ) ) {
5858 throw new PackagingError ( `Node packager only supports Node runtimes. Received: ${ spec . runtimeVersion } ` ) ;
5959 }
6060
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export class PythonCodeZipPackager implements RuntimePackager {
6060 throw new PackagingError ( 'Python packager only supports CodeZip build type.' ) ;
6161 }
6262
63- if ( ! isPythonRuntimeVersion ( spec . runtimeVersion ) ) {
63+ if ( ! isPythonRuntimeVersion ( spec . runtimeVersion ! ) ) {
6464 throw new PackagingError ( `Python packager only supports Python runtimes. Received: ${ spec . runtimeVersion } ` ) ;
6565 }
6666
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ interface AgentEnvSpec {
4646 build : BuildType ;
4747 entrypoint : string ; // @regex ^[a-zA-Z0-9_][a-zA-Z0-9_/.-]*\.(py|ts|js)(:[a-zA-Z_][a-zA-Z0-9_]*)?$ e.g. "main.py:handler" or "index.ts"
4848 codeLocation : string ; // Directory path
49- runtimeVersion : RuntimeVersion ;
49+ runtimeVersion ? : RuntimeVersion ;
5050 envVars ?: EnvVar [ ] ;
5151 networkMode ?: NetworkMode ; // default 'PUBLIC'
5252 networkConfig ?: NetworkConfig ; // Required when networkMode is 'VPC'
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ export const AgentEnvSpecSchema = z
181181 build : BuildTypeSchema ,
182182 entrypoint : EntrypointSchema ,
183183 codeLocation : DirectoryPathSchema ,
184- runtimeVersion : RuntimeVersionSchemaFromConstants ,
184+ runtimeVersion : RuntimeVersionSchemaFromConstants . optional ( ) ,
185185 /** Environment variables to set on the runtime */
186186 envVars : z . array ( EnvVarSchema ) . optional ( ) ,
187187 /** Network mode for the runtime. Defaults to PUBLIC. */
You can’t perform that action at this time.
0 commit comments