@dagger.io/dagger 0.8.8 → 0.9.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.
@@ -50,12 +50,6 @@ export type BuildArg = {
50
50
  */
51
51
  value: string;
52
52
  };
53
- /**
54
- * A global cache volume identifier.
55
- */
56
- export type CacheID = string & {
57
- __CacheID: never;
58
- };
59
53
  /**
60
54
  * Sharing mode of the cache volume.
61
55
  */
@@ -74,6 +68,33 @@ export declare enum CacheSharingMode {
74
68
  */
75
69
  Shared = "SHARED"
76
70
  }
71
+ /**
72
+ * A global cache volume identifier.
73
+ */
74
+ export type CacheVolumeID = string & {
75
+ __CacheVolumeID: never;
76
+ };
77
+ export type ContainerAsTarballOpts = {
78
+ /**
79
+ * Identifiers for other platform specific containers.
80
+ * Used for multi-platform image.
81
+ */
82
+ platformVariants?: Container[];
83
+ /**
84
+ * Force each layer of the image to use the specified compression algorithm.
85
+ * If this is unset, then if a layer already has a compressed blob in the engine's
86
+ * cache, that will be used (this can result in a mix of compression algorithms for
87
+ * different layers). If this is unset and a layer has no compressed blob in the
88
+ * engine's cache, then it will be compressed using Gzip.
89
+ */
90
+ forcedCompression?: ImageLayerCompression;
91
+ /**
92
+ * Use the specified media types for the image's layers. Defaults to OCI, which
93
+ * is largely compatible with most recent container runtimes, but Docker may be needed
94
+ * for older runtimes without OCI support.
95
+ */
96
+ mediaTypes?: ImageMediaTypes;
97
+ };
77
98
  export type ContainerBuildOpts = {
78
99
  /**
79
100
  * Path to the Dockerfile to use.
@@ -100,16 +121,6 @@ export type ContainerBuildOpts = {
100
121
  */
101
122
  secrets?: Secret[];
102
123
  };
103
- export type ContainerEndpointOpts = {
104
- /**
105
- * The exposed port number for the endpoint
106
- */
107
- port?: number;
108
- /**
109
- * Return a URL with the given scheme, eg. http for http://
110
- */
111
- scheme?: string;
112
- };
113
124
  export type ContainerExportOpts = {
114
125
  /**
115
126
  * Identifiers for other platform specific containers.
@@ -379,13 +390,6 @@ export type DirectoryAsModuleOpts = {
379
390
  * directory.
380
391
  */
381
392
  sourceSubpath?: string;
382
- /**
383
- * A pre-built runtime container to use instead of building one from the
384
- * source code. This is useful for bootstrapping.
385
- *
386
- * You should ignore this unless you're building a Dagger SDK.
387
- */
388
- runtime?: Container;
389
393
  };
390
394
  export type DirectoryDockerBuildOpts = {
391
395
  /**
@@ -482,9 +486,6 @@ export type FileExportOpts = {
482
486
  export type FileID = string & {
483
487
  __FileID: never;
484
488
  };
485
- export type FunctionCallOpts = {
486
- input?: FunctionCallInput[];
487
- };
488
489
  export type FunctionWithArgOpts = {
489
490
  /**
490
491
  * A doc string for the argument, if any
@@ -495,15 +496,11 @@ export type FunctionWithArgOpts = {
495
496
  */
496
497
  defaultValue?: JSON;
497
498
  };
498
- export type FunctionCallInput = {
499
- /**
500
- * The name of the argument to the function
501
- */
502
- name: string;
503
- /**
504
- * The value of the argument represented as a string of the JSON serialization.
505
- */
506
- value: JSON;
499
+ /**
500
+ * A reference to a FunctionArg.
501
+ */
502
+ export type FunctionArgID = string & {
503
+ __FunctionArgID: never;
507
504
  };
508
505
  /**
509
506
  * A reference to a Function.
@@ -531,6 +528,34 @@ export type HostDirectoryOpts = {
531
528
  */
532
529
  include?: string[];
533
530
  };
531
+ export type HostServiceOpts = {
532
+ /**
533
+ * Upstream host to forward traffic to.
534
+ */
535
+ host?: string;
536
+ };
537
+ export type HostTunnelOpts = {
538
+ /**
539
+ * Map each service port to the same port on the host, as if the service were
540
+ * running natively.
541
+ *
542
+ * Note: enabling may result in port conflicts.
543
+ */
544
+ native?: boolean;
545
+ /**
546
+ * Configure explicit port forwarding rules for the tunnel.
547
+ *
548
+ * If a port's frontend is unspecified or 0, a random port will be chosen by
549
+ * the host.
550
+ *
551
+ * If no ports are given, all of the service's ports are forwarded. If native
552
+ * is true, each port maps to the same port on the host. If native is false,
553
+ * each port maps to a random port chosen by the host.
554
+ *
555
+ * If ports are given and native is true, the ports are additive.
556
+ */
557
+ ports?: PortForward[];
558
+ };
534
559
  /**
535
560
  * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
536
561
  */
@@ -559,13 +584,6 @@ export declare enum ImageMediaTypes {
559
584
  export type JSON = string & {
560
585
  __JSON: never;
561
586
  };
562
- export type ModuleServeOpts = {
563
- environment?: ModuleEnvironmentVariable[];
564
- };
565
- export type ModuleEnvironmentVariable = {
566
- name: string;
567
- value?: string;
568
- };
569
587
  /**
570
588
  * A reference to a Module.
571
589
  */
@@ -603,6 +621,20 @@ export type PipelineLabel = {
603
621
  export type Platform = string & {
604
622
  __Platform: never;
605
623
  };
624
+ export type PortForward = {
625
+ /**
626
+ * Destination port for traffic.
627
+ */
628
+ backend: number;
629
+ /**
630
+ * Port to expose to clients. If unspecified, a default will be chosen.
631
+ */
632
+ frontend?: number;
633
+ /**
634
+ * Protocol to use for traffic.
635
+ */
636
+ protocol?: NetworkProtocol;
637
+ };
606
638
  export type ClientContainerOpts = {
607
639
  id?: ContainerID;
608
640
  platform?: Platform;
@@ -610,27 +642,32 @@ export type ClientContainerOpts = {
610
642
  export type ClientDirectoryOpts = {
611
643
  id?: DirectoryID;
612
644
  };
613
- export type ClientGeneratedCodeOpts = {
614
- id?: GeneratedCodeID;
615
- };
616
645
  export type ClientGitOpts = {
617
646
  /**
618
647
  * Set to true to keep .git directory.
619
648
  */
620
649
  keepGitDir?: boolean;
650
+ /**
651
+ * Set SSH known hosts
652
+ */
653
+ sshKnownHosts?: string;
654
+ /**
655
+ * Set SSH auth socket
656
+ */
657
+ sshAuthSocket?: Socket;
621
658
  /**
622
659
  * A service which must be started before the repo is fetched.
623
660
  */
624
- experimentalServiceHost?: Container;
661
+ experimentalServiceHost?: Service;
625
662
  };
626
663
  export type ClientHttpOpts = {
627
664
  /**
628
665
  * A service which must be started before the URL is fetched.
629
666
  */
630
- experimentalServiceHost?: Container;
667
+ experimentalServiceHost?: Service;
631
668
  };
632
- export type ClientModuleOpts = {
633
- id?: ModuleID;
669
+ export type ClientModuleConfigOpts = {
670
+ subpath?: string;
634
671
  };
635
672
  export type ClientPipelineOpts = {
636
673
  /**
@@ -645,15 +682,28 @@ export type ClientPipelineOpts = {
645
682
  export type ClientSocketOpts = {
646
683
  id?: SocketID;
647
684
  };
648
- export type ClientTypeDefOpts = {
649
- id?: TypeDefID;
650
- };
651
685
  /**
652
686
  * A unique identifier for a secret.
653
687
  */
654
688
  export type SecretID = string & {
655
689
  __SecretID: never;
656
690
  };
691
+ export type ServiceEndpointOpts = {
692
+ /**
693
+ * The exposed port number for the endpoint
694
+ */
695
+ port?: number;
696
+ /**
697
+ * Return a URL with the given scheme, eg. http for http://
698
+ */
699
+ scheme?: string;
700
+ };
701
+ /**
702
+ * A unique service identifier.
703
+ */
704
+ export type ServiceID = string & {
705
+ __ServiceID: never;
706
+ };
657
707
  /**
658
708
  * A content-addressed socket identifier.
659
709
  */
@@ -738,18 +788,16 @@ export declare class CacheVolume extends BaseClient {
738
788
  queryTree?: QueryTree[];
739
789
  host?: string;
740
790
  sessionToken?: string;
741
- }, _id?: CacheID);
742
- id(): Promise<CacheID>;
791
+ }, _id?: CacheVolumeID);
792
+ id(): Promise<CacheVolumeID>;
743
793
  }
744
794
  /**
745
795
  * An OCI-compatible container, also known as a docker container.
746
796
  */
747
797
  export declare class Container extends BaseClient {
748
798
  private readonly _id?;
749
- private readonly _endpoint?;
750
799
  private readonly _envVariable?;
751
800
  private readonly _export?;
752
- private readonly _hostname?;
753
801
  private readonly _imageRef?;
754
802
  private readonly _label?;
755
803
  private readonly _platform?;
@@ -767,11 +815,31 @@ export declare class Container extends BaseClient {
767
815
  queryTree?: QueryTree[];
768
816
  host?: string;
769
817
  sessionToken?: string;
770
- }, _id?: ContainerID, _endpoint?: string, _envVariable?: string, _export?: boolean, _hostname?: string, _imageRef?: string, _label?: string, _platform?: Platform, _publish?: string, _shellEndpoint?: string, _stderr?: string, _stdout?: string, _sync?: ContainerID, _user?: string, _workdir?: string);
818
+ }, _id?: ContainerID, _envVariable?: string, _export?: boolean, _imageRef?: string, _label?: string, _platform?: Platform, _publish?: string, _shellEndpoint?: string, _stderr?: string, _stdout?: string, _sync?: ContainerID, _user?: string, _workdir?: string);
771
819
  /**
772
820
  * A unique identifier for this container.
773
821
  */
774
822
  id(): Promise<ContainerID>;
823
+ /**
824
+ * Turn the container into a Service.
825
+ *
826
+ * Be sure to set any exposed ports before this conversion.
827
+ */
828
+ asService(): Service;
829
+ /**
830
+ * Returns a File representing the container serialized to a tarball.
831
+ * @param opts.platformVariants Identifiers for other platform specific containers.
832
+ * Used for multi-platform image.
833
+ * @param opts.forcedCompression Force each layer of the image to use the specified compression algorithm.
834
+ * If this is unset, then if a layer already has a compressed blob in the engine's
835
+ * cache, that will be used (this can result in a mix of compression algorithms for
836
+ * different layers). If this is unset and a layer has no compressed blob in the
837
+ * engine's cache, then it will be compressed using Gzip.
838
+ * @param opts.mediaTypes Use the specified media types for the image's layers. Defaults to OCI, which
839
+ * is largely compatible with most recent container runtimes, but Docker may be needed
840
+ * for older runtimes without OCI support.
841
+ */
842
+ asTarball(opts?: ContainerAsTarballOpts): File;
775
843
  /**
776
844
  * Initializes this container from a Dockerfile build.
777
845
  * @param context Directory context used by the Dockerfile.
@@ -800,18 +868,6 @@ export declare class Container extends BaseClient {
800
868
  * @param path The path of the directory to retrieve (e.g., "./src").
801
869
  */
802
870
  directory(path: string): Directory;
803
- /**
804
- * Retrieves an endpoint that clients can use to reach this container.
805
- *
806
- * If no port is specified, the first exposed port is used. If none exist an error is returned.
807
- *
808
- * If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
809
- *
810
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
811
- * @param opts.port The exposed port number for the endpoint
812
- * @param opts.scheme Return a URL with the given scheme, eg. http for http://
813
- */
814
- endpoint(opts?: ContainerEndpointOpts): Promise<string>;
815
871
  /**
816
872
  * Retrieves entrypoint to be prepended to the arguments of all commands.
817
873
  */
@@ -849,8 +905,6 @@ export declare class Container extends BaseClient {
849
905
  *
850
906
  * This includes ports already exposed by the image, even if not
851
907
  * explicitly added with dagger.
852
- *
853
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
854
908
  */
855
909
  exposedPorts(): Promise<Port[]>;
856
910
  /**
@@ -867,12 +921,6 @@ export declare class Container extends BaseClient {
867
921
  * Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
868
922
  */
869
923
  from(address: string): Container;
870
- /**
871
- * Retrieves a hostname which can be used by clients to reach this container.
872
- *
873
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
874
- */
875
- hostname(): Promise<string>;
876
924
  /**
877
925
  * The unique image reference which can only be retrieved immediately after the 'Container.From' call.
878
926
  */
@@ -1019,8 +1067,6 @@ export declare class Container extends BaseClient {
1019
1067
  * Exposed ports serve two purposes:
1020
1068
  * - For health checks and introspection, when running services
1021
1069
  * - For setting the EXPOSE OCI field when publishing the container
1022
- *
1023
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
1024
1070
  * @param port Port number to expose
1025
1071
  * @param opts.protocol Transport layer network protocol
1026
1072
  * @param opts.description Optional port description
@@ -1151,12 +1197,10 @@ export declare class Container extends BaseClient {
1151
1197
  * The service will be reachable from the container via the provided hostname alias.
1152
1198
  *
1153
1199
  * The service dependency will also convey to any files or directories produced by the container.
1154
- *
1155
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
1156
1200
  * @param alias A name that can be used to reach the service from the container
1157
1201
  * @param service Identifier of the service container
1158
1202
  */
1159
- withServiceBinding(alias: string, service: Container): Container;
1203
+ withServiceBinding(alias: string, service: Service): Container;
1160
1204
  /**
1161
1205
  * Retrieves this container plus a socket forwarded to the given Unix socket path.
1162
1206
  * @param path Location of the forwarded Unix socket (e.g., "/tmp/socket").
@@ -1185,8 +1229,6 @@ export declare class Container extends BaseClient {
1185
1229
  withoutEnvVariable(name: string): Container;
1186
1230
  /**
1187
1231
  * Unexpose a previously exposed port.
1188
- *
1189
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
1190
1232
  * @param port Port number to unexpose
1191
1233
  * @param opts.protocol Port protocol to unexpose
1192
1234
  */
@@ -1261,10 +1303,6 @@ export declare class Directory extends BaseClient {
1261
1303
  *
1262
1304
  * If not set, the module source code is loaded from the root of the
1263
1305
  * directory.
1264
- * @param opts.runtime A pre-built runtime container to use instead of building one from the
1265
- * source code. This is useful for bootstrapping.
1266
- *
1267
- * You should ignore this unless you're building a Dagger SDK.
1268
1306
  */
1269
1307
  asModule(opts?: DirectoryAsModuleOpts): Module_;
1270
1308
  /**
@@ -1305,6 +1343,11 @@ export declare class Directory extends BaseClient {
1305
1343
  * @param path Location of the file to retrieve (e.g., "README.md").
1306
1344
  */
1307
1345
  file(path: string): File;
1346
+ /**
1347
+ * Returns a list of files and directories that matche the given pattern.
1348
+ * @param pattern Pattern to match (e.g., "*.md").
1349
+ */
1350
+ glob(pattern: string): Promise<string[]>;
1308
1351
  /**
1309
1352
  * Creates a named sub-pipeline
1310
1353
  * @param name Pipeline name.
@@ -1488,7 +1531,6 @@ export declare class File extends BaseClient {
1488
1531
  */
1489
1532
  export declare class Function_ extends BaseClient {
1490
1533
  private readonly _id?;
1491
- private readonly _call?;
1492
1534
  private readonly _description?;
1493
1535
  private readonly _name?;
1494
1536
  /**
@@ -1498,7 +1540,7 @@ export declare class Function_ extends BaseClient {
1498
1540
  queryTree?: QueryTree[];
1499
1541
  host?: string;
1500
1542
  sessionToken?: string;
1501
- }, _id?: FunctionID, _call?: JSON, _description?: string, _name?: string);
1543
+ }, _id?: FunctionID, _description?: string, _name?: string);
1502
1544
  /**
1503
1545
  * The ID of the function
1504
1546
  */
@@ -1507,16 +1549,6 @@ export declare class Function_ extends BaseClient {
1507
1549
  * Arguments accepted by this function, if any
1508
1550
  */
1509
1551
  args(): Promise<FunctionArg[]>;
1510
- /**
1511
- * Execute this function using dynamic input+output types.
1512
- *
1513
- * Typically, it's preferable to invoke a function using a type
1514
- * safe graphql query rather than using this call field. However,
1515
- * call is useful for some advanced use cases where dynamically
1516
- * loading arbitrary modules and invoking functions in them is
1517
- * required.
1518
- */
1519
- call(opts?: FunctionCallOpts): Promise<JSON>;
1520
1552
  /**
1521
1553
  * A doc string for the function, if any
1522
1554
  */
@@ -1555,6 +1587,7 @@ export declare class Function_ extends BaseClient {
1555
1587
  * argument passed at function call time.
1556
1588
  */
1557
1589
  export declare class FunctionArg extends BaseClient {
1590
+ private readonly _id?;
1558
1591
  private readonly _defaultValue?;
1559
1592
  private readonly _description?;
1560
1593
  private readonly _name?;
@@ -1565,7 +1598,11 @@ export declare class FunctionArg extends BaseClient {
1565
1598
  queryTree?: QueryTree[];
1566
1599
  host?: string;
1567
1600
  sessionToken?: string;
1568
- }, _defaultValue?: JSON, _description?: string, _name?: string);
1601
+ }, _id?: FunctionArgID, _defaultValue?: JSON, _description?: string, _name?: string);
1602
+ /**
1603
+ * The ID of the argument
1604
+ */
1605
+ id(): Promise<FunctionArgID>;
1569
1606
  /**
1570
1607
  * A default value to use for this argument when not explicitly set by the caller, if any
1571
1608
  */
@@ -1663,10 +1700,6 @@ export declare class GeneratedCode extends BaseClient {
1663
1700
  * List of paths to ignore in version control (i.e. .gitignore)
1664
1701
  */
1665
1702
  vcsIgnoredPaths(): Promise<string[]>;
1666
- /**
1667
- * Set the directory containing the generated code
1668
- */
1669
- withCode(code: Directory): GeneratedCode;
1670
1703
  /**
1671
1704
  * Set the list of paths to mark generated in version control
1672
1705
  */
@@ -1686,6 +1719,7 @@ export declare class GeneratedCode extends BaseClient {
1686
1719
  * A git ref (tag, branch or commit).
1687
1720
  */
1688
1721
  export declare class GitRef extends BaseClient {
1722
+ private readonly _commit?;
1689
1723
  /**
1690
1724
  * Constructor is used for internal usage only, do not create object from it.
1691
1725
  */
@@ -1693,7 +1727,11 @@ export declare class GitRef extends BaseClient {
1693
1727
  queryTree?: QueryTree[];
1694
1728
  host?: string;
1695
1729
  sessionToken?: string;
1696
- });
1730
+ }, _commit?: string);
1731
+ /**
1732
+ * The resolved commit id at this ref.
1733
+ */
1734
+ commit(): Promise<string>;
1697
1735
  /**
1698
1736
  * The filesystem tree at this ref.
1699
1737
  */
@@ -1751,6 +1789,17 @@ export declare class Host extends BaseClient {
1751
1789
  * @param path Location of the file to retrieve (e.g., "README.md").
1752
1790
  */
1753
1791
  file(path: string): File;
1792
+ /**
1793
+ * Creates a service that forwards traffic to a specified address via the host.
1794
+ * @param ports Ports to expose via the service, forwarding through the host network.
1795
+ *
1796
+ * If a port's frontend is unspecified or 0, it defaults to the same as the
1797
+ * backend port.
1798
+ *
1799
+ * An empty set of ports is not valid; an error will be returned.
1800
+ * @param opts.host Upstream host to forward traffic to.
1801
+ */
1802
+ service(ports: PortForward[], opts?: HostServiceOpts): Service;
1754
1803
  /**
1755
1804
  * Sets a secret given a user-defined name and the file path on the host, and returns the secret.
1756
1805
  * The file is limited to a size of 512000 bytes.
@@ -1758,6 +1807,25 @@ export declare class Host extends BaseClient {
1758
1807
  * @param path Location of the file to set as a secret.
1759
1808
  */
1760
1809
  setSecretFile(name: string, path: string): Secret;
1810
+ /**
1811
+ * Creates a tunnel that forwards traffic from the host to a service.
1812
+ * @param service Service to send traffic from the tunnel.
1813
+ * @param opts.native Map each service port to the same port on the host, as if the service were
1814
+ * running natively.
1815
+ *
1816
+ * Note: enabling may result in port conflicts.
1817
+ * @param opts.ports Configure explicit port forwarding rules for the tunnel.
1818
+ *
1819
+ * If a port's frontend is unspecified or 0, a random port will be chosen by
1820
+ * the host.
1821
+ *
1822
+ * If no ports are given, all of the service's ports are forwarded. If native
1823
+ * is true, each port maps to the same port on the host. If native is false,
1824
+ * each port maps to a random port chosen by the host.
1825
+ *
1826
+ * If ports are given and native is true, the ports are additive.
1827
+ */
1828
+ tunnel(service: Service, opts?: HostTunnelOpts): Service;
1761
1829
  /**
1762
1830
  * Accesses a Unix socket on the host.
1763
1831
  * @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
@@ -1809,7 +1877,6 @@ export declare class Module_ extends BaseClient {
1809
1877
  private readonly _description?;
1810
1878
  private readonly _name?;
1811
1879
  private readonly _sdk?;
1812
- private readonly _sdkRuntime?;
1813
1880
  private readonly _serve?;
1814
1881
  private readonly _sourceDirectorySubPath?;
1815
1882
  /**
@@ -1819,7 +1886,7 @@ export declare class Module_ extends BaseClient {
1819
1886
  queryTree?: QueryTree[];
1820
1887
  host?: string;
1821
1888
  sessionToken?: string;
1822
- }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _sdkRuntime?: string, _serve?: Void, _sourceDirectorySubPath?: string);
1889
+ }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _serve?: Void, _sourceDirectorySubPath?: string);
1823
1890
  /**
1824
1891
  * The ID of the module
1825
1892
  */
@@ -1849,19 +1916,15 @@ export declare class Module_ extends BaseClient {
1849
1916
  */
1850
1917
  objects(): Promise<TypeDef[]>;
1851
1918
  /**
1852
- * The SDK used by this module
1919
+ * The SDK used by this module. Either a name of a builtin SDK or a module ref pointing to the SDK's implementation.
1853
1920
  */
1854
1921
  sdk(): Promise<string>;
1855
- /**
1856
- * The SDK runtime module image ref.
1857
- */
1858
- sdkRuntime(): Promise<string>;
1859
1922
  /**
1860
1923
  * Serve a module's API in the current session.
1861
1924
  * Note: this can only be called once per session.
1862
1925
  * In the future, it could return a stream or service to remove the side effect.
1863
1926
  */
1864
- serve(opts?: ModuleServeOpts): Promise<Void>;
1927
+ serve(): Promise<Void>;
1865
1928
  /**
1866
1929
  * The directory containing the module's source code
1867
1930
  */
@@ -1881,6 +1944,46 @@ export declare class Module_ extends BaseClient {
1881
1944
  */
1882
1945
  with(arg: (param: Module_) => Module_): Module_;
1883
1946
  }
1947
+ /**
1948
+ * Static configuration for a module (e.g. parsed contents of dagger.json)
1949
+ */
1950
+ export declare class ModuleConfig extends BaseClient {
1951
+ private readonly _name?;
1952
+ private readonly _root?;
1953
+ private readonly _sdk?;
1954
+ /**
1955
+ * Constructor is used for internal usage only, do not create object from it.
1956
+ */
1957
+ constructor(parent?: {
1958
+ queryTree?: QueryTree[];
1959
+ host?: string;
1960
+ sessionToken?: string;
1961
+ }, _name?: string, _root?: string, _sdk?: string);
1962
+ /**
1963
+ * Modules that this module depends on.
1964
+ */
1965
+ dependencies(): Promise<string[]>;
1966
+ /**
1967
+ * Exclude these file globs when loading the module root.
1968
+ */
1969
+ exclude(): Promise<string[]>;
1970
+ /**
1971
+ * Include only these file globs when loading the module root.
1972
+ */
1973
+ include(): Promise<string[]>;
1974
+ /**
1975
+ * The name of the module.
1976
+ */
1977
+ name(): Promise<string>;
1978
+ /**
1979
+ * The root directory of the module's project, which may be above the module source code.
1980
+ */
1981
+ root(): Promise<string>;
1982
+ /**
1983
+ * Either the name of a built-in SDK ('go', 'python', etc.) OR a module reference pointing to the SDK's module implementation.
1984
+ */
1985
+ sdk(): Promise<string>;
1986
+ }
1884
1987
  /**
1885
1988
  * A definition of a custom object defined in a Module.
1886
1989
  */
@@ -1962,11 +2065,10 @@ export declare class Client extends BaseClient {
1962
2065
  */
1963
2066
  checkVersionCompatibility(version: string): Promise<boolean>;
1964
2067
  /**
1965
- * Loads a container from ID.
2068
+ * Creates a scratch container or loads one by ID.
1966
2069
  *
1967
- * Null ID returns an empty container (scratch).
1968
- * Optional platform argument initializes new containers to execute and publish as that platform.
1969
- * Platform defaults to that of the builder's host.
2070
+ * Optional platform argument initializes new containers to execute and publish
2071
+ * as that platform. Platform defaults to that of the builder's host.
1970
2072
  */
1971
2073
  container(opts?: ClientContainerOpts): Container;
1972
2074
  /**
@@ -1984,27 +2086,31 @@ export declare class Client extends BaseClient {
1984
2086
  */
1985
2087
  defaultPlatform(): Promise<Platform>;
1986
2088
  /**
1987
- * Load a directory by ID. No argument produces an empty directory.
2089
+ * Creates an empty directory or loads one by ID.
1988
2090
  */
1989
2091
  directory(opts?: ClientDirectoryOpts): Directory;
1990
2092
  /**
1991
2093
  * Loads a file by ID.
2094
+ * @deprecated Use loadFileFromID instead.
1992
2095
  */
1993
2096
  file(id: FileID): File;
1994
2097
  /**
1995
- * Load a function by ID
2098
+ * Create a function.
1996
2099
  */
1997
- function_(id: FunctionID): Function_;
2100
+ function_(name: string, returnType: TypeDef): Function_;
1998
2101
  /**
1999
- * Load GeneratedCode by ID, or create a new one if id is unset.
2102
+ * Create a code generation result, given a directory containing the generated
2103
+ * code.
2000
2104
  */
2001
- generatedCode(opts?: ClientGeneratedCodeOpts): GeneratedCode;
2105
+ generatedCode(code: Directory): GeneratedCode;
2002
2106
  /**
2003
2107
  * Queries a git repository.
2004
2108
  * @param url Url of the git repository.
2005
- * Can be formatted as https://{host}/{owner}/{repo}, git@{host}/{owner}/{repo}
2109
+ * Can be formatted as https://{host}/{owner}/{repo}, git@{host}:{owner}/{repo}
2006
2110
  * Suffix ".git" is optional.
2007
2111
  * @param opts.keepGitDir Set to true to keep .git directory.
2112
+ * @param opts.sshKnownHosts Set SSH known hosts
2113
+ * @param opts.sshAuthSocket Set SSH auth socket
2008
2114
  * @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
2009
2115
  */
2010
2116
  git(url: string, opts?: ClientGitOpts): GitRepository;
@@ -2019,13 +2125,61 @@ export declare class Client extends BaseClient {
2019
2125
  */
2020
2126
  http(url: string, opts?: ClientHttpOpts): File;
2021
2127
  /**
2022
- * Load a module by ID, or create a new one if id is unset.
2128
+ * Load a CacheVolume from its ID.
2023
2129
  */
2024
- module_(opts?: ClientModuleOpts): Module_;
2130
+ loadCacheVolumeFromID(id: CacheVolumeID): CacheVolume;
2025
2131
  /**
2026
- * Create a new function from the provided definition.
2132
+ * Loads a container from an ID.
2027
2133
  */
2028
- newFunction(name: string, returnType: TypeDef): Function_;
2134
+ loadContainerFromID(id: ContainerID): Container;
2135
+ /**
2136
+ * Load a Directory from its ID.
2137
+ */
2138
+ loadDirectoryFromID(id: DirectoryID): Directory;
2139
+ /**
2140
+ * Load a File from its ID.
2141
+ */
2142
+ loadFileFromID(id: FileID): File;
2143
+ /**
2144
+ * Load a function argument by ID.
2145
+ */
2146
+ loadFunctionArgFromID(id: FunctionArgID): FunctionArg;
2147
+ /**
2148
+ * Load a function by ID.
2149
+ */
2150
+ loadFunctionFromID(id: FunctionID): Function_;
2151
+ /**
2152
+ * Load a GeneratedCode by ID.
2153
+ */
2154
+ loadGeneratedCodeFromID(id: GeneratedCodeID): GeneratedCode;
2155
+ /**
2156
+ * Load a module by ID.
2157
+ */
2158
+ loadModuleFromID(id: ModuleID): Module_;
2159
+ /**
2160
+ * Load a Secret from its ID.
2161
+ */
2162
+ loadSecretFromID(id: SecretID): Secret;
2163
+ /**
2164
+ * Loads a service from ID.
2165
+ */
2166
+ loadServiceFromID(id: ServiceID): Service;
2167
+ /**
2168
+ * Load a Socket from its ID.
2169
+ */
2170
+ loadSocketFromID(id: SocketID): Socket;
2171
+ /**
2172
+ * Load a TypeDef by ID.
2173
+ */
2174
+ loadTypeDefFromID(id: TypeDefID): TypeDef;
2175
+ /**
2176
+ * Create a new module.
2177
+ */
2178
+ module_(): Module_;
2179
+ /**
2180
+ * Load the static configuration for a module from the given source directory and optional subpath.
2181
+ */
2182
+ moduleConfig(sourceDirectory: Directory, opts?: ClientModuleConfigOpts): ModuleConfig;
2029
2183
  /**
2030
2184
  * Creates a named sub-pipeline.
2031
2185
  * @param name Pipeline name.
@@ -2035,6 +2189,7 @@ export declare class Client extends BaseClient {
2035
2189
  pipeline(name: string, opts?: ClientPipelineOpts): Client;
2036
2190
  /**
2037
2191
  * Loads a secret from its ID.
2192
+ * @deprecated Use loadSecretFromID instead
2038
2193
  */
2039
2194
  secret(id: SecretID): Secret;
2040
2195
  /**
@@ -2046,9 +2201,13 @@ export declare class Client extends BaseClient {
2046
2201
  setSecret(name: string, plaintext: string): Secret;
2047
2202
  /**
2048
2203
  * Loads a socket by its ID.
2204
+ * @deprecated Use loadSocketFromID instead.
2049
2205
  */
2050
2206
  socket(opts?: ClientSocketOpts): Socket;
2051
- typeDef(opts?: ClientTypeDefOpts): TypeDef;
2207
+ /**
2208
+ * Create a new TypeDef.
2209
+ */
2210
+ typeDef(): TypeDef;
2052
2211
  /**
2053
2212
  * Call the provided function with current Client.
2054
2213
  *
@@ -2079,6 +2238,53 @@ export declare class Secret extends BaseClient {
2079
2238
  */
2080
2239
  plaintext(): Promise<string>;
2081
2240
  }
2241
+ export declare class Service extends BaseClient {
2242
+ private readonly _id?;
2243
+ private readonly _endpoint?;
2244
+ private readonly _hostname?;
2245
+ private readonly _start?;
2246
+ private readonly _stop?;
2247
+ /**
2248
+ * Constructor is used for internal usage only, do not create object from it.
2249
+ */
2250
+ constructor(parent?: {
2251
+ queryTree?: QueryTree[];
2252
+ host?: string;
2253
+ sessionToken?: string;
2254
+ }, _id?: ServiceID, _endpoint?: string, _hostname?: string, _start?: ServiceID, _stop?: ServiceID);
2255
+ /**
2256
+ * A unique identifier for this service.
2257
+ */
2258
+ id(): Promise<ServiceID>;
2259
+ /**
2260
+ * Retrieves an endpoint that clients can use to reach this container.
2261
+ *
2262
+ * If no port is specified, the first exposed port is used. If none exist an error is returned.
2263
+ *
2264
+ * If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
2265
+ * @param opts.port The exposed port number for the endpoint
2266
+ * @param opts.scheme Return a URL with the given scheme, eg. http for http://
2267
+ */
2268
+ endpoint(opts?: ServiceEndpointOpts): Promise<string>;
2269
+ /**
2270
+ * Retrieves a hostname which can be used by clients to reach this container.
2271
+ */
2272
+ hostname(): Promise<string>;
2273
+ /**
2274
+ * Retrieves the list of ports provided by the service.
2275
+ */
2276
+ ports(): Promise<Port[]>;
2277
+ /**
2278
+ * Start the service and wait for its health checks to succeed.
2279
+ *
2280
+ * Services bound to a Container do not need to be manually started.
2281
+ */
2282
+ start(): Promise<Service>;
2283
+ /**
2284
+ * Stop the service.
2285
+ */
2286
+ stop(): Promise<Service>;
2287
+ }
2082
2288
  export declare class Socket extends BaseClient {
2083
2289
  private readonly _id?;
2084
2290
  /**