@dagger.io/dagger 0.9.2 → 0.9.4

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.
Files changed (79) hide show
  1. package/dist/api/client.gen.d.ts +283 -275
  2. package/dist/api/client.gen.d.ts.map +1 -1
  3. package/dist/api/client.gen.js +1656 -1874
  4. package/dist/api/utils.js +73 -90
  5. package/dist/common/errors/DaggerSDKError.js +5 -1
  6. package/dist/common/errors/DockerImageRefValidationError.js +7 -3
  7. package/dist/common/errors/EngineSessionConnectParamsParseError.js +6 -2
  8. package/dist/common/errors/EngineSessionConnectionTimeoutError.js +6 -2
  9. package/dist/common/errors/EngineSessionErrorOptions.js +2 -2
  10. package/dist/common/errors/ExecError.js +18 -2
  11. package/dist/common/errors/GraphQLRequestError.js +10 -2
  12. package/dist/common/errors/InitEngineSessionBinaryError.js +2 -2
  13. package/dist/common/errors/NotAwaitedRequestError.js +2 -2
  14. package/dist/common/errors/TooManyNestedObjectsError.js +6 -2
  15. package/dist/common/errors/UnknownDaggerError.js +2 -2
  16. package/dist/common/errors/errors-codes.js +1 -1
  17. package/dist/common/utils.d.ts +4 -4
  18. package/dist/connect.d.ts +22 -27
  19. package/dist/connect.d.ts.map +1 -1
  20. package/dist/connect.js +43 -49
  21. package/dist/connectOpts.d.ts +25 -0
  22. package/dist/connectOpts.d.ts.map +1 -0
  23. package/dist/connectOpts.js +1 -0
  24. package/dist/context/builder.d.ts +9 -0
  25. package/dist/context/builder.d.ts.map +1 -0
  26. package/dist/context/builder.js +34 -0
  27. package/dist/context/context.d.ts +39 -0
  28. package/dist/context/context.d.ts.map +1 -0
  29. package/dist/context/context.js +51 -0
  30. package/dist/entrypoint/entrypoint.d.ts +2 -0
  31. package/dist/entrypoint/entrypoint.d.ts.map +1 -0
  32. package/dist/entrypoint/entrypoint.js +48 -0
  33. package/dist/entrypoint/invoke.d.ts +11 -0
  34. package/dist/entrypoint/invoke.d.ts.map +1 -0
  35. package/dist/entrypoint/invoke.js +14 -0
  36. package/dist/entrypoint/load.d.ts +16 -0
  37. package/dist/entrypoint/load.d.ts.map +1 -0
  38. package/dist/entrypoint/load.js +32 -0
  39. package/dist/entrypoint/register.d.ts +6 -0
  40. package/dist/entrypoint/register.d.ts.map +1 -0
  41. package/dist/entrypoint/register.js +91 -0
  42. package/dist/graphql/client.d.ts +3 -0
  43. package/dist/graphql/client.d.ts.map +1 -0
  44. package/dist/graphql/client.js +8 -0
  45. package/dist/index.d.ts +3 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +2 -1
  48. package/dist/introspector/decorators/decorators.d.ts +4 -0
  49. package/dist/introspector/decorators/decorators.d.ts.map +1 -0
  50. package/dist/introspector/decorators/decorators.js +7 -0
  51. package/dist/introspector/registry/registry.d.ts +65 -0
  52. package/dist/introspector/registry/registry.d.ts.map +1 -0
  53. package/dist/introspector/registry/registry.js +125 -0
  54. package/dist/introspector/scanner/metadata.d.ts +23 -0
  55. package/dist/introspector/scanner/metadata.d.ts.map +1 -0
  56. package/dist/introspector/scanner/metadata.js +1 -0
  57. package/dist/introspector/scanner/scan.d.ts +17 -0
  58. package/dist/introspector/scanner/scan.d.ts.map +1 -0
  59. package/dist/introspector/scanner/scan.js +158 -0
  60. package/dist/introspector/scanner/serialize.d.ts +34 -0
  61. package/dist/introspector/scanner/serialize.d.ts.map +1 -0
  62. package/dist/introspector/scanner/serialize.js +62 -0
  63. package/dist/introspector/scanner/typeDefs.d.ts +70 -0
  64. package/dist/introspector/scanner/typeDefs.d.ts.map +1 -0
  65. package/dist/introspector/scanner/typeDefs.js +1 -0
  66. package/dist/introspector/scanner/utils.d.ts +62 -0
  67. package/dist/introspector/scanner/utils.d.ts.map +1 -0
  68. package/dist/introspector/scanner/utils.js +117 -0
  69. package/dist/introspector/utils/files.d.ts +5 -0
  70. package/dist/introspector/utils/files.d.ts.map +1 -0
  71. package/dist/introspector/utils/files.js +28 -0
  72. package/dist/provisioning/bin.d.ts +5 -3
  73. package/dist/provisioning/bin.d.ts.map +1 -1
  74. package/dist/provisioning/bin.js +185 -233
  75. package/dist/provisioning/default.d.ts +1 -1
  76. package/dist/provisioning/default.js +1 -1
  77. package/dist/provisioning/engineconn.d.ts +6 -2
  78. package/dist/provisioning/engineconn.d.ts.map +1 -1
  79. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by `client-gen`.
3
3
  * Do not make direct changes to the file.
4
4
  */
5
- import { GraphQLClient } from "graphql-request";
5
+ import { Context } from "../context/context.js";
6
6
  /**
7
7
  * @hidden
8
8
  */
@@ -20,21 +20,15 @@ export type Metadata = {
20
20
  };
21
21
  interface ClientConfig {
22
22
  queryTree?: QueryTree[];
23
- host?: string;
24
- sessionToken?: string;
23
+ ctx?: Context;
25
24
  }
26
25
  declare class BaseClient {
27
26
  protected _queryTree: QueryTree[];
28
- protected client: GraphQLClient;
29
- /**
30
- * @defaultValue `127.0.0.1:8080`
31
- */
32
- clientHost: string;
33
- sessionToken: string;
27
+ protected _ctx: Context;
34
28
  /**
35
29
  * @hidden
36
30
  */
37
- constructor({ queryTree, host, sessionToken }?: ClientConfig);
31
+ constructor({ queryTree, ctx }?: ClientConfig);
38
32
  /**
39
33
  * @hidden
40
34
  */
@@ -518,6 +512,18 @@ export type GitRefTreeOpts = {
518
512
  sshKnownHosts?: string;
519
513
  sshAuthSocket?: Socket;
520
514
  };
515
+ /**
516
+ * A git reference identifier.
517
+ */
518
+ export type GitRefID = string & {
519
+ __GitRefID: never;
520
+ };
521
+ /**
522
+ * A git repository identifier.
523
+ */
524
+ export type GitRepositoryID = string & {
525
+ __GitRepositoryID: never;
526
+ };
521
527
  export type HostDirectoryOpts = {
522
528
  /**
523
529
  * Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
@@ -786,10 +792,9 @@ export declare class CacheVolume extends BaseClient {
786
792
  */
787
793
  constructor(parent?: {
788
794
  queryTree?: QueryTree[];
789
- host?: string;
790
- sessionToken?: string;
795
+ ctx: Context;
791
796
  }, _id?: CacheVolumeID);
792
- id(): Promise<CacheVolumeID>;
797
+ id: () => Promise<CacheVolumeID>;
793
798
  }
794
799
  /**
795
800
  * An OCI-compatible container, also known as a docker container.
@@ -813,19 +818,18 @@ export declare class Container extends BaseClient {
813
818
  */
814
819
  constructor(parent?: {
815
820
  queryTree?: QueryTree[];
816
- host?: string;
817
- sessionToken?: string;
821
+ ctx: Context;
818
822
  }, _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);
819
823
  /**
820
824
  * A unique identifier for this container.
821
825
  */
822
- id(): Promise<ContainerID>;
826
+ id: () => Promise<ContainerID>;
823
827
  /**
824
828
  * Turn the container into a Service.
825
829
  *
826
830
  * Be sure to set any exposed ports before this conversion.
827
831
  */
828
- asService(): Service;
832
+ asService: () => Service;
829
833
  /**
830
834
  * Returns a File representing the container serialized to a tarball.
831
835
  * @param opts.platformVariants Identifiers for other platform specific containers.
@@ -839,7 +843,7 @@ export declare class Container extends BaseClient {
839
843
  * is largely compatible with most recent container runtimes, but Docker may be needed
840
844
  * for older runtimes without OCI support.
841
845
  */
842
- asTarball(opts?: ContainerAsTarballOpts): File;
846
+ asTarball: (opts?: ContainerAsTarballOpts) => File;
843
847
  /**
844
848
  * Initializes this container from a Dockerfile build.
845
849
  * @param context Directory context used by the Dockerfile.
@@ -856,45 +860,45 @@ export declare class Container extends BaseClient {
856
860
  * and mount path /run/secrets/[secret-name]
857
861
  * e.g. RUN --mount=type=secret,id=my-secret curl url?token=$(cat /run/secrets/my-secret)"
858
862
  */
859
- build(context: Directory, opts?: ContainerBuildOpts): Container;
863
+ build: (context: Directory, opts?: ContainerBuildOpts) => Container;
860
864
  /**
861
865
  * Retrieves default arguments for future commands.
862
866
  */
863
- defaultArgs(): Promise<string[]>;
867
+ defaultArgs: () => Promise<string[]>;
864
868
  /**
865
869
  * Retrieves a directory at the given path.
866
870
  *
867
871
  * Mounts are included.
868
872
  * @param path The path of the directory to retrieve (e.g., "./src").
869
873
  */
870
- directory(path: string): Directory;
874
+ directory: (path: string) => Directory;
871
875
  /**
872
876
  * Retrieves entrypoint to be prepended to the arguments of all commands.
873
877
  */
874
- entrypoint(): Promise<string[]>;
878
+ entrypoint: () => Promise<string[]>;
875
879
  /**
876
880
  * Retrieves the value of the specified environment variable.
877
881
  * @param name The name of the environment variable to retrieve (e.g., "PATH").
878
882
  */
879
- envVariable(name: string): Promise<string>;
883
+ envVariable: (name: string) => Promise<string>;
880
884
  /**
881
885
  * Retrieves the list of environment variables passed to commands.
882
886
  */
883
- envVariables(): Promise<EnvVariable[]>;
887
+ envVariables: () => Promise<EnvVariable[]>;
884
888
  /**
885
889
  * EXPERIMENTAL API! Subject to change/removal at any time.
886
890
  *
887
891
  * experimentalWithAllGPUs configures all available GPUs on the host to be accessible to this container.
888
892
  * This currently works for Nvidia devices only.
889
893
  */
890
- experimentalWithAllGPUs(): Container;
894
+ experimentalWithAllGPUs: () => Container;
891
895
  /**
892
896
  * EXPERIMENTAL API! Subject to change/removal at any time.
893
897
  *
894
898
  * experimentalWithGPU configures the provided list of devices to be accesible to this container.
895
899
  * This currently works for Nvidia devices only.
896
900
  */
897
- experimentalWithGPU(devices: string[]): Container;
901
+ experimentalWithGPU: (devices: string[]) => Container;
898
902
  /**
899
903
  * Writes the container as an OCI tarball to the destination file path on the host for the specified platform variants.
900
904
  *
@@ -913,32 +917,32 @@ export declare class Container extends BaseClient {
913
917
  * is largely compatible with most recent container runtimes, but Docker may be needed
914
918
  * for older runtimes without OCI support.
915
919
  */
916
- export(path: string, opts?: ContainerExportOpts): Promise<boolean>;
920
+ export: (path: string, opts?: ContainerExportOpts) => Promise<boolean>;
917
921
  /**
918
922
  * Retrieves the list of exposed ports.
919
923
  *
920
924
  * This includes ports already exposed by the image, even if not
921
925
  * explicitly added with dagger.
922
926
  */
923
- exposedPorts(): Promise<Port[]>;
927
+ exposedPorts: () => Promise<Port[]>;
924
928
  /**
925
929
  * Retrieves a file at the given path.
926
930
  *
927
931
  * Mounts are included.
928
932
  * @param path The path of the file to retrieve (e.g., "./README.md").
929
933
  */
930
- file(path: string): File;
934
+ file: (path: string) => File;
931
935
  /**
932
936
  * Initializes this container from a pulled base image.
933
937
  * @param address Image's address from its registry.
934
938
  *
935
939
  * Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
936
940
  */
937
- from(address: string): Container;
941
+ from: (address: string) => Container;
938
942
  /**
939
943
  * The unique image reference which can only be retrieved immediately after the 'Container.From' call.
940
944
  */
941
- imageRef(): Promise<string>;
945
+ imageRef: () => Promise<string>;
942
946
  /**
943
947
  * Reads the container from an OCI tarball.
944
948
  *
@@ -948,30 +952,30 @@ export declare class Container extends BaseClient {
948
952
  * @param opts.tag Identifies the tag to import from the archive, if the archive bundles
949
953
  * multiple tags.
950
954
  */
951
- import_(source: File, opts?: ContainerImportOpts): Container;
955
+ import_: (source: File, opts?: ContainerImportOpts) => Container;
952
956
  /**
953
957
  * Retrieves the value of the specified label.
954
958
  */
955
- label(name: string): Promise<string>;
959
+ label: (name: string) => Promise<string>;
956
960
  /**
957
961
  * Retrieves the list of labels passed to container.
958
962
  */
959
- labels(): Promise<Label[]>;
963
+ labels: () => Promise<Label[]>;
960
964
  /**
961
965
  * Retrieves the list of paths where a directory is mounted.
962
966
  */
963
- mounts(): Promise<string[]>;
967
+ mounts: () => Promise<string[]>;
964
968
  /**
965
969
  * Creates a named sub-pipeline
966
970
  * @param name Pipeline name.
967
971
  * @param opts.description Pipeline description.
968
972
  * @param opts.labels Pipeline labels.
969
973
  */
970
- pipeline(name: string, opts?: ContainerPipelineOpts): Container;
974
+ pipeline: (name: string, opts?: ContainerPipelineOpts) => Container;
971
975
  /**
972
976
  * The platform this container executes and publishes as.
973
977
  */
974
- platform(): Promise<Platform>;
978
+ platform: () => Promise<Platform>;
975
979
  /**
976
980
  * Publishes this container as a new image to the specified address.
977
981
  *
@@ -991,45 +995,45 @@ export declare class Container extends BaseClient {
991
995
  * is largely compatible with most recent registries, but Docker may be needed for older
992
996
  * registries without OCI support.
993
997
  */
994
- publish(address: string, opts?: ContainerPublishOpts): Promise<string>;
998
+ publish: (address: string, opts?: ContainerPublishOpts) => Promise<string>;
995
999
  /**
996
1000
  * Retrieves this container's root filesystem. Mounts are not included.
997
1001
  */
998
- rootfs(): Directory;
1002
+ rootfs: () => Directory;
999
1003
  /**
1000
1004
  * Return a websocket endpoint that, if connected to, will start the container with a TTY streamed
1001
1005
  * over the websocket.
1002
1006
  *
1003
1007
  * Primarily intended for internal use with the dagger CLI.
1004
1008
  */
1005
- shellEndpoint(): Promise<string>;
1009
+ shellEndpoint: () => Promise<string>;
1006
1010
  /**
1007
1011
  * The error stream of the last executed command.
1008
1012
  *
1009
1013
  * Will execute default command if none is set, or error if there's no default.
1010
1014
  */
1011
- stderr(): Promise<string>;
1015
+ stderr: () => Promise<string>;
1012
1016
  /**
1013
1017
  * The output stream of the last executed command.
1014
1018
  *
1015
1019
  * Will execute default command if none is set, or error if there's no default.
1016
1020
  */
1017
- stdout(): Promise<string>;
1021
+ stdout: () => Promise<string>;
1018
1022
  /**
1019
1023
  * Forces evaluation of the pipeline in the engine.
1020
1024
  *
1021
1025
  * It doesn't run the default command if no exec has been set.
1022
1026
  */
1023
- sync(): Promise<Container>;
1027
+ sync: () => Promise<Container>;
1024
1028
  /**
1025
1029
  * Retrieves the user to be set for all commands.
1026
1030
  */
1027
- user(): Promise<string>;
1031
+ user: () => Promise<string>;
1028
1032
  /**
1029
1033
  * Configures default arguments for future commands.
1030
1034
  * @param opts.args Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
1031
1035
  */
1032
- withDefaultArgs(opts?: ContainerWithDefaultArgsOpts): Container;
1036
+ withDefaultArgs: (opts?: ContainerWithDefaultArgsOpts) => Container;
1033
1037
  /**
1034
1038
  * Retrieves this container plus a directory written at the given path.
1035
1039
  * @param path Location of the written directory (e.g., "/tmp/directory").
@@ -1042,12 +1046,12 @@ export declare class Container extends BaseClient {
1042
1046
  *
1043
1047
  * If the group is omitted, it defaults to the same as the user.
1044
1048
  */
1045
- withDirectory(path: string, directory: Directory, opts?: ContainerWithDirectoryOpts): Container;
1049
+ withDirectory: (path: string, directory: Directory, opts?: ContainerWithDirectoryOpts) => Container;
1046
1050
  /**
1047
1051
  * Retrieves this container but with a different command entrypoint.
1048
1052
  * @param args Entrypoint to use for future executions (e.g., ["go", "run"]).
1049
1053
  */
1050
- withEntrypoint(args: string[]): Container;
1054
+ withEntrypoint: (args: string[]) => Container;
1051
1055
  /**
1052
1056
  * Retrieves this container plus the given environment variable.
1053
1057
  * @param name The name of the environment variable (e.g., "HOST").
@@ -1055,7 +1059,7 @@ export declare class Container extends BaseClient {
1055
1059
  * @param opts.expand Replace ${VAR} or $VAR in the value according to the current environment
1056
1060
  * variables defined in the container (e.g., "/opt/bin:$PATH").
1057
1061
  */
1058
- withEnvVariable(name: string, value: string, opts?: ContainerWithEnvVariableOpts): Container;
1062
+ withEnvVariable: (name: string, value: string, opts?: ContainerWithEnvVariableOpts) => Container;
1059
1063
  /**
1060
1064
  * Retrieves this container after executing the specified command inside it.
1061
1065
  * @param args Command to run instead of the container's default command (e.g., ["run", "main.go"]).
@@ -1074,7 +1078,7 @@ export declare class Container extends BaseClient {
1074
1078
  * does not provide any security guarantees when using this option. It should only be used
1075
1079
  * when absolutely necessary and only with trusted commands.
1076
1080
  */
1077
- withExec(args: string[], opts?: ContainerWithExecOpts): Container;
1081
+ withExec: (args: string[], opts?: ContainerWithExecOpts) => Container;
1078
1082
  /**
1079
1083
  * Expose a network port.
1080
1084
  *
@@ -1085,7 +1089,7 @@ export declare class Container extends BaseClient {
1085
1089
  * @param opts.protocol Transport layer network protocol
1086
1090
  * @param opts.description Optional port description
1087
1091
  */
1088
- withExposedPort(port: number, opts?: ContainerWithExposedPortOpts): Container;
1092
+ withExposedPort: (port: number, opts?: ContainerWithExposedPortOpts) => Container;
1089
1093
  /**
1090
1094
  * Retrieves this container plus the contents of the given file copied to the given path.
1091
1095
  * @param path Location of the copied file (e.g., "/tmp/file.txt").
@@ -1099,18 +1103,18 @@ export declare class Container extends BaseClient {
1099
1103
  *
1100
1104
  * If the group is omitted, it defaults to the same as the user.
1101
1105
  */
1102
- withFile(path: string, source: File, opts?: ContainerWithFileOpts): Container;
1106
+ withFile: (path: string, source: File, opts?: ContainerWithFileOpts) => Container;
1103
1107
  /**
1104
1108
  * Indicate that subsequent operations should be featured more prominently in
1105
1109
  * the UI.
1106
1110
  */
1107
- withFocus(): Container;
1111
+ withFocus: () => Container;
1108
1112
  /**
1109
1113
  * Retrieves this container plus the given label.
1110
1114
  * @param name The name of the label (e.g., "org.opencontainers.artifact.created").
1111
1115
  * @param value The value of the label (e.g., "2023-01-01T00:00:00Z").
1112
1116
  */
1113
- withLabel(name: string, value: string): Container;
1117
+ withLabel: (name: string, value: string) => Container;
1114
1118
  /**
1115
1119
  * Retrieves this container plus a cache volume mounted at the given path.
1116
1120
  * @param path Location of the cache directory (e.g., "/cache/node_modules").
@@ -1127,7 +1131,7 @@ export declare class Container extends BaseClient {
1127
1131
  *
1128
1132
  * If the group is omitted, it defaults to the same as the user.
1129
1133
  */
1130
- withMountedCache(path: string, cache: CacheVolume, opts?: ContainerWithMountedCacheOpts): Container;
1134
+ withMountedCache: (path: string, cache: CacheVolume, opts?: ContainerWithMountedCacheOpts) => Container;
1131
1135
  /**
1132
1136
  * Retrieves this container plus a directory mounted at the given path.
1133
1137
  * @param path Location of the mounted directory (e.g., "/mnt/directory").
@@ -1138,7 +1142,7 @@ export declare class Container extends BaseClient {
1138
1142
  *
1139
1143
  * If the group is omitted, it defaults to the same as the user.
1140
1144
  */
1141
- withMountedDirectory(path: string, source: Directory, opts?: ContainerWithMountedDirectoryOpts): Container;
1145
+ withMountedDirectory: (path: string, source: Directory, opts?: ContainerWithMountedDirectoryOpts) => Container;
1142
1146
  /**
1143
1147
  * Retrieves this container plus a file mounted at the given path.
1144
1148
  * @param path Location of the mounted file (e.g., "/tmp/file.txt").
@@ -1149,7 +1153,7 @@ export declare class Container extends BaseClient {
1149
1153
  *
1150
1154
  * If the group is omitted, it defaults to the same as the user.
1151
1155
  */
1152
- withMountedFile(path: string, source: File, opts?: ContainerWithMountedFileOpts): Container;
1156
+ withMountedFile: (path: string, source: File, opts?: ContainerWithMountedFileOpts) => Container;
1153
1157
  /**
1154
1158
  * Retrieves this container plus a secret mounted into a file at the given path.
1155
1159
  * @param path Location of the secret file (e.g., "/tmp/secret.txt").
@@ -1164,12 +1168,12 @@ export declare class Container extends BaseClient {
1164
1168
  *
1165
1169
  * Default: 0400.
1166
1170
  */
1167
- withMountedSecret(path: string, source: Secret, opts?: ContainerWithMountedSecretOpts): Container;
1171
+ withMountedSecret: (path: string, source: Secret, opts?: ContainerWithMountedSecretOpts) => Container;
1168
1172
  /**
1169
1173
  * Retrieves this container plus a temporary directory mounted at the given path.
1170
1174
  * @param path Location of the temporary directory (e.g., "/tmp/temp_dir").
1171
1175
  */
1172
- withMountedTemp(path: string): Container;
1176
+ withMountedTemp: (path: string) => Container;
1173
1177
  /**
1174
1178
  * Retrieves this container plus a new file written at the given path.
1175
1179
  * @param path Location of the written file (e.g., "/tmp/file.txt").
@@ -1183,7 +1187,7 @@ export declare class Container extends BaseClient {
1183
1187
  *
1184
1188
  * If the group is omitted, it defaults to the same as the user.
1185
1189
  */
1186
- withNewFile(path: string, opts?: ContainerWithNewFileOpts): Container;
1190
+ withNewFile: (path: string, opts?: ContainerWithNewFileOpts) => Container;
1187
1191
  /**
1188
1192
  * Retrieves this container with a registry authentication for a given address.
1189
1193
  * @param address Registry's address to bind the authentication to.
@@ -1191,17 +1195,17 @@ export declare class Container extends BaseClient {
1191
1195
  * @param username The username of the registry's account (e.g., "Dagger").
1192
1196
  * @param secret The API key, password or token to authenticate to this registry.
1193
1197
  */
1194
- withRegistryAuth(address: string, username: string, secret: Secret): Container;
1198
+ withRegistryAuth: (address: string, username: string, secret: Secret) => Container;
1195
1199
  /**
1196
1200
  * Initializes this container from this DirectoryID.
1197
1201
  */
1198
- withRootfs(directory: Directory): Container;
1202
+ withRootfs: (directory: Directory) => Container;
1199
1203
  /**
1200
1204
  * Retrieves this container plus an env variable containing the given secret.
1201
1205
  * @param name The name of the secret variable (e.g., "API_SECRET").
1202
1206
  * @param secret The identifier of the secret value.
1203
1207
  */
1204
- withSecretVariable(name: string, secret: Secret): Container;
1208
+ withSecretVariable: (name: string, secret: Secret) => Container;
1205
1209
  /**
1206
1210
  * Establish a runtime dependency on a service.
1207
1211
  *
@@ -1214,7 +1218,7 @@ export declare class Container extends BaseClient {
1214
1218
  * @param alias A name that can be used to reach the service from the container
1215
1219
  * @param service Identifier of the service container
1216
1220
  */
1217
- withServiceBinding(alias: string, service: Service): Container;
1221
+ withServiceBinding: (alias: string, service: Service) => Container;
1218
1222
  /**
1219
1223
  * Retrieves this container plus a socket forwarded to the given Unix socket path.
1220
1224
  * @param path Location of the forwarded Unix socket (e.g., "/tmp/socket").
@@ -1225,66 +1229,66 @@ export declare class Container extends BaseClient {
1225
1229
  *
1226
1230
  * If the group is omitted, it defaults to the same as the user.
1227
1231
  */
1228
- withUnixSocket(path: string, source: Socket, opts?: ContainerWithUnixSocketOpts): Container;
1232
+ withUnixSocket: (path: string, source: Socket, opts?: ContainerWithUnixSocketOpts) => Container;
1229
1233
  /**
1230
1234
  * Retrieves this container with a different command user.
1231
1235
  * @param name The user to set (e.g., "root").
1232
1236
  */
1233
- withUser(name: string): Container;
1237
+ withUser: (name: string) => Container;
1234
1238
  /**
1235
1239
  * Retrieves this container with a different working directory.
1236
1240
  * @param path The path to set as the working directory (e.g., "/app").
1237
1241
  */
1238
- withWorkdir(path: string): Container;
1242
+ withWorkdir: (path: string) => Container;
1239
1243
  /**
1240
1244
  * Retrieves this container minus the given environment variable.
1241
1245
  * @param name The name of the environment variable (e.g., "HOST").
1242
1246
  */
1243
- withoutEnvVariable(name: string): Container;
1247
+ withoutEnvVariable: (name: string) => Container;
1244
1248
  /**
1245
1249
  * Unexpose a previously exposed port.
1246
1250
  * @param port Port number to unexpose
1247
1251
  * @param opts.protocol Port protocol to unexpose
1248
1252
  */
1249
- withoutExposedPort(port: number, opts?: ContainerWithoutExposedPortOpts): Container;
1253
+ withoutExposedPort: (port: number, opts?: ContainerWithoutExposedPortOpts) => Container;
1250
1254
  /**
1251
1255
  * Indicate that subsequent operations should not be featured more prominently
1252
1256
  * in the UI.
1253
1257
  *
1254
1258
  * This is the initial state of all containers.
1255
1259
  */
1256
- withoutFocus(): Container;
1260
+ withoutFocus: () => Container;
1257
1261
  /**
1258
1262
  * Retrieves this container minus the given environment label.
1259
1263
  * @param name The name of the label to remove (e.g., "org.opencontainers.artifact.created").
1260
1264
  */
1261
- withoutLabel(name: string): Container;
1265
+ withoutLabel: (name: string) => Container;
1262
1266
  /**
1263
1267
  * Retrieves this container after unmounting everything at the given path.
1264
1268
  * @param path Location of the cache directory (e.g., "/cache/node_modules").
1265
1269
  */
1266
- withoutMount(path: string): Container;
1270
+ withoutMount: (path: string) => Container;
1267
1271
  /**
1268
1272
  * Retrieves this container without the registry authentication of a given address.
1269
1273
  * @param address Registry's address to remove the authentication from.
1270
1274
  * Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
1271
1275
  */
1272
- withoutRegistryAuth(address: string): Container;
1276
+ withoutRegistryAuth: (address: string) => Container;
1273
1277
  /**
1274
1278
  * Retrieves this container with a previously added Unix socket removed.
1275
1279
  * @param path Location of the socket to remove (e.g., "/tmp/socket").
1276
1280
  */
1277
- withoutUnixSocket(path: string): Container;
1281
+ withoutUnixSocket: (path: string) => Container;
1278
1282
  /**
1279
1283
  * Retrieves the working directory for all commands.
1280
1284
  */
1281
- workdir(): Promise<string>;
1285
+ workdir: () => Promise<string>;
1282
1286
  /**
1283
1287
  * Call the provided function with current Container.
1284
1288
  *
1285
1289
  * This is useful for reusability and readability by not breaking the calling chain.
1286
1290
  */
1287
- with(arg: (param: Container) => Container): Container;
1291
+ with: (arg: (param: Container) => Container) => Container;
1288
1292
  }
1289
1293
  /**
1290
1294
  * A directory.
@@ -1298,13 +1302,12 @@ export declare class Directory extends BaseClient {
1298
1302
  */
1299
1303
  constructor(parent?: {
1300
1304
  queryTree?: QueryTree[];
1301
- host?: string;
1302
- sessionToken?: string;
1305
+ ctx: Context;
1303
1306
  }, _id?: DirectoryID, _export?: boolean, _sync?: DirectoryID);
1304
1307
  /**
1305
1308
  * The content-addressed identifier of the directory.
1306
1309
  */
1307
- id(): Promise<DirectoryID>;
1310
+ id: () => Promise<DirectoryID>;
1308
1311
  /**
1309
1312
  * Load the directory as a Dagger module
1310
1313
  * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source
@@ -1318,17 +1321,17 @@ export declare class Directory extends BaseClient {
1318
1321
  * If not set, the module source code is loaded from the root of the
1319
1322
  * directory.
1320
1323
  */
1321
- asModule(opts?: DirectoryAsModuleOpts): Module_;
1324
+ asModule: (opts?: DirectoryAsModuleOpts) => Module_;
1322
1325
  /**
1323
1326
  * Gets the difference between this directory and an another directory.
1324
1327
  * @param other Identifier of the directory to compare.
1325
1328
  */
1326
- diff(other: Directory): Directory;
1329
+ diff: (other: Directory) => Directory;
1327
1330
  /**
1328
1331
  * Retrieves a directory at the given path.
1329
1332
  * @param path Location of the directory to retrieve (e.g., "/src").
1330
1333
  */
1331
- directory(path: string): Directory;
1334
+ directory: (path: string) => Directory;
1332
1335
  /**
1333
1336
  * Builds a new Docker container from this directory.
1334
1337
  * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
@@ -1341,38 +1344,38 @@ export declare class Directory extends BaseClient {
1341
1344
  *
1342
1345
  * They will be mounted at /run/secrets/[secret-name].
1343
1346
  */
1344
- dockerBuild(opts?: DirectoryDockerBuildOpts): Container;
1347
+ dockerBuild: (opts?: DirectoryDockerBuildOpts) => Container;
1345
1348
  /**
1346
1349
  * Returns a list of files and directories at the given path.
1347
1350
  * @param opts.path Location of the directory to look at (e.g., "/src").
1348
1351
  */
1349
- entries(opts?: DirectoryEntriesOpts): Promise<string[]>;
1352
+ entries: (opts?: DirectoryEntriesOpts) => Promise<string[]>;
1350
1353
  /**
1351
1354
  * Writes the contents of the directory to a path on the host.
1352
1355
  * @param path Location of the copied directory (e.g., "logs/").
1353
1356
  */
1354
- export(path: string): Promise<boolean>;
1357
+ export: (path: string) => Promise<boolean>;
1355
1358
  /**
1356
1359
  * Retrieves a file at the given path.
1357
1360
  * @param path Location of the file to retrieve (e.g., "README.md").
1358
1361
  */
1359
- file(path: string): File;
1362
+ file: (path: string) => File;
1360
1363
  /**
1361
1364
  * Returns a list of files and directories that matche the given pattern.
1362
1365
  * @param pattern Pattern to match (e.g., "*.md").
1363
1366
  */
1364
- glob(pattern: string): Promise<string[]>;
1367
+ glob: (pattern: string) => Promise<string[]>;
1365
1368
  /**
1366
1369
  * Creates a named sub-pipeline
1367
1370
  * @param name Pipeline name.
1368
1371
  * @param opts.description Pipeline description.
1369
1372
  * @param opts.labels Pipeline labels.
1370
1373
  */
1371
- pipeline(name: string, opts?: DirectoryPipelineOpts): Directory;
1374
+ pipeline: (name: string, opts?: DirectoryPipelineOpts) => Directory;
1372
1375
  /**
1373
1376
  * Force evaluation in the engine.
1374
1377
  */
1375
- sync(): Promise<Directory>;
1378
+ sync: () => Promise<Directory>;
1376
1379
  /**
1377
1380
  * Retrieves this directory plus a directory written at the given path.
1378
1381
  * @param path Location of the written directory (e.g., "/src/").
@@ -1380,7 +1383,7 @@ export declare class Directory extends BaseClient {
1380
1383
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
1381
1384
  * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
1382
1385
  */
1383
- withDirectory(path: string, directory: Directory, opts?: DirectoryWithDirectoryOpts): Directory;
1386
+ withDirectory: (path: string, directory: Directory, opts?: DirectoryWithDirectoryOpts) => Directory;
1384
1387
  /**
1385
1388
  * Retrieves this directory plus the contents of the given file copied to the given path.
1386
1389
  * @param path Location of the copied file (e.g., "/file.txt").
@@ -1389,7 +1392,7 @@ export declare class Directory extends BaseClient {
1389
1392
  *
1390
1393
  * Default: 0644.
1391
1394
  */
1392
- withFile(path: string, source: File, opts?: DirectoryWithFileOpts): Directory;
1395
+ withFile: (path: string, source: File, opts?: DirectoryWithFileOpts) => Directory;
1393
1396
  /**
1394
1397
  * Retrieves this directory plus a new directory created at the given path.
1395
1398
  * @param path Location of the directory created (e.g., "/logs").
@@ -1397,7 +1400,7 @@ export declare class Directory extends BaseClient {
1397
1400
  *
1398
1401
  * Default: 0755.
1399
1402
  */
1400
- withNewDirectory(path: string, opts?: DirectoryWithNewDirectoryOpts): Directory;
1403
+ withNewDirectory: (path: string, opts?: DirectoryWithNewDirectoryOpts) => Directory;
1401
1404
  /**
1402
1405
  * Retrieves this directory plus a new file written at the given path.
1403
1406
  * @param path Location of the written file (e.g., "/file.txt").
@@ -1406,30 +1409,30 @@ export declare class Directory extends BaseClient {
1406
1409
  *
1407
1410
  * Default: 0644.
1408
1411
  */
1409
- withNewFile(path: string, contents: string, opts?: DirectoryWithNewFileOpts): Directory;
1412
+ withNewFile: (path: string, contents: string, opts?: DirectoryWithNewFileOpts) => Directory;
1410
1413
  /**
1411
1414
  * Retrieves this directory with all file/dir timestamps set to the given time.
1412
1415
  * @param timestamp Timestamp to set dir/files in.
1413
1416
  *
1414
1417
  * Formatted in seconds following Unix epoch (e.g., 1672531199).
1415
1418
  */
1416
- withTimestamps(timestamp: number): Directory;
1419
+ withTimestamps: (timestamp: number) => Directory;
1417
1420
  /**
1418
1421
  * Retrieves this directory with the directory at the given path removed.
1419
1422
  * @param path Location of the directory to remove (e.g., ".github/").
1420
1423
  */
1421
- withoutDirectory(path: string): Directory;
1424
+ withoutDirectory: (path: string) => Directory;
1422
1425
  /**
1423
1426
  * Retrieves this directory with the file at the given path removed.
1424
1427
  * @param path Location of the file to remove (e.g., "/file.txt").
1425
1428
  */
1426
- withoutFile(path: string): Directory;
1429
+ withoutFile: (path: string) => Directory;
1427
1430
  /**
1428
1431
  * Call the provided function with current Directory.
1429
1432
  *
1430
1433
  * This is useful for reusability and readability by not breaking the calling chain.
1431
1434
  */
1432
- with(arg: (param: Directory) => Directory): Directory;
1435
+ with: (arg: (param: Directory) => Directory) => Directory;
1433
1436
  }
1434
1437
  /**
1435
1438
  * A simple key value object that represents an environment variable.
@@ -1442,17 +1445,16 @@ export declare class EnvVariable extends BaseClient {
1442
1445
  */
1443
1446
  constructor(parent?: {
1444
1447
  queryTree?: QueryTree[];
1445
- host?: string;
1446
- sessionToken?: string;
1448
+ ctx: Context;
1447
1449
  }, _name?: string, _value?: string);
1448
1450
  /**
1449
1451
  * The environment variable name.
1450
1452
  */
1451
- name(): Promise<string>;
1453
+ name: () => Promise<string>;
1452
1454
  /**
1453
1455
  * The environment variable value.
1454
1456
  */
1455
- value(): Promise<string>;
1457
+ value: () => Promise<string>;
1456
1458
  }
1457
1459
  /**
1458
1460
  * A definition of a field on a custom object defined in a Module.
@@ -1467,21 +1469,20 @@ export declare class FieldTypeDef extends BaseClient {
1467
1469
  */
1468
1470
  constructor(parent?: {
1469
1471
  queryTree?: QueryTree[];
1470
- host?: string;
1471
- sessionToken?: string;
1472
+ ctx: Context;
1472
1473
  }, _description?: string, _name?: string);
1473
1474
  /**
1474
1475
  * A doc string for the field, if any
1475
1476
  */
1476
- description(): Promise<string>;
1477
+ description: () => Promise<string>;
1477
1478
  /**
1478
1479
  * The name of the field in the object
1479
1480
  */
1480
- name(): Promise<string>;
1481
+ name: () => Promise<string>;
1481
1482
  /**
1482
1483
  * The type of the field
1483
1484
  */
1484
- typeDef(): TypeDef;
1485
+ typeDef: () => TypeDef;
1485
1486
  }
1486
1487
  /**
1487
1488
  * A file.
@@ -1497,45 +1498,44 @@ export declare class File extends BaseClient {
1497
1498
  */
1498
1499
  constructor(parent?: {
1499
1500
  queryTree?: QueryTree[];
1500
- host?: string;
1501
- sessionToken?: string;
1501
+ ctx: Context;
1502
1502
  }, _id?: FileID, _contents?: string, _export?: boolean, _size?: number, _sync?: FileID);
1503
1503
  /**
1504
1504
  * Retrieves the content-addressed identifier of the file.
1505
1505
  */
1506
- id(): Promise<FileID>;
1506
+ id: () => Promise<FileID>;
1507
1507
  /**
1508
1508
  * Retrieves the contents of the file.
1509
1509
  */
1510
- contents(): Promise<string>;
1510
+ contents: () => Promise<string>;
1511
1511
  /**
1512
1512
  * Writes the file to a file path on the host.
1513
1513
  * @param path Location of the written directory (e.g., "output.txt").
1514
1514
  * @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case
1515
1515
  * the file will be created in that directory.
1516
1516
  */
1517
- export(path: string, opts?: FileExportOpts): Promise<boolean>;
1517
+ export: (path: string, opts?: FileExportOpts) => Promise<boolean>;
1518
1518
  /**
1519
1519
  * Gets the size of the file, in bytes.
1520
1520
  */
1521
- size(): Promise<number>;
1521
+ size: () => Promise<number>;
1522
1522
  /**
1523
1523
  * Force evaluation in the engine.
1524
1524
  */
1525
- sync(): Promise<File>;
1525
+ sync: () => Promise<File>;
1526
1526
  /**
1527
1527
  * Retrieves this file with its created/modified timestamps set to the given time.
1528
1528
  * @param timestamp Timestamp to set dir/files in.
1529
1529
  *
1530
1530
  * Formatted in seconds following Unix epoch (e.g., 1672531199).
1531
1531
  */
1532
- withTimestamps(timestamp: number): File;
1532
+ withTimestamps: (timestamp: number) => File;
1533
1533
  /**
1534
1534
  * Call the provided function with current File.
1535
1535
  *
1536
1536
  * This is useful for reusability and readability by not breaking the calling chain.
1537
1537
  */
1538
- with(arg: (param: File) => File): File;
1538
+ with: (arg: (param: File) => File) => File;
1539
1539
  }
1540
1540
  /**
1541
1541
  * Function represents a resolver provided by a Module.
@@ -1552,29 +1552,28 @@ export declare class Function_ extends BaseClient {
1552
1552
  */
1553
1553
  constructor(parent?: {
1554
1554
  queryTree?: QueryTree[];
1555
- host?: string;
1556
- sessionToken?: string;
1555
+ ctx: Context;
1557
1556
  }, _id?: FunctionID, _description?: string, _name?: string);
1558
1557
  /**
1559
1558
  * The ID of the function
1560
1559
  */
1561
- id(): Promise<FunctionID>;
1560
+ id: () => Promise<FunctionID>;
1562
1561
  /**
1563
1562
  * Arguments accepted by this function, if any
1564
1563
  */
1565
- args(): Promise<FunctionArg[]>;
1564
+ args: () => Promise<FunctionArg[]>;
1566
1565
  /**
1567
1566
  * A doc string for the function, if any
1568
1567
  */
1569
- description(): Promise<string>;
1568
+ description: () => Promise<string>;
1570
1569
  /**
1571
1570
  * The name of the function
1572
1571
  */
1573
- name(): Promise<string>;
1572
+ name: () => Promise<string>;
1574
1573
  /**
1575
1574
  * The type returned by this function
1576
1575
  */
1577
- returnType(): TypeDef;
1576
+ returnType: () => TypeDef;
1578
1577
  /**
1579
1578
  * Returns the function with the provided argument
1580
1579
  * @param name The name of the argument
@@ -1582,17 +1581,17 @@ export declare class Function_ extends BaseClient {
1582
1581
  * @param opts.description A doc string for the argument, if any
1583
1582
  * @param opts.defaultValue A default value to use for this argument if not explicitly set by the caller, if any
1584
1583
  */
1585
- withArg(name: string, typeDef: TypeDef, opts?: FunctionWithArgOpts): Function_;
1584
+ withArg: (name: string, typeDef: TypeDef, opts?: FunctionWithArgOpts) => Function_;
1586
1585
  /**
1587
1586
  * Returns the function with the doc string
1588
1587
  */
1589
- withDescription(description: string): Function_;
1588
+ withDescription: (description: string) => Function_;
1590
1589
  /**
1591
1590
  * Call the provided function with current Function.
1592
1591
  *
1593
1592
  * This is useful for reusability and readability by not breaking the calling chain.
1594
1593
  */
1595
- with(arg: (param: Function_) => Function_): Function_;
1594
+ with: (arg: (param: Function_) => Function_) => Function_;
1596
1595
  }
1597
1596
  /**
1598
1597
  * An argument accepted by a function.
@@ -1610,29 +1609,28 @@ export declare class FunctionArg extends BaseClient {
1610
1609
  */
1611
1610
  constructor(parent?: {
1612
1611
  queryTree?: QueryTree[];
1613
- host?: string;
1614
- sessionToken?: string;
1612
+ ctx: Context;
1615
1613
  }, _id?: FunctionArgID, _defaultValue?: JSON, _description?: string, _name?: string);
1616
1614
  /**
1617
1615
  * The ID of the argument
1618
1616
  */
1619
- id(): Promise<FunctionArgID>;
1617
+ id: () => Promise<FunctionArgID>;
1620
1618
  /**
1621
1619
  * A default value to use for this argument when not explicitly set by the caller, if any
1622
1620
  */
1623
- defaultValue(): Promise<JSON>;
1621
+ defaultValue: () => Promise<JSON>;
1624
1622
  /**
1625
1623
  * A doc string for the argument, if any
1626
1624
  */
1627
- description(): Promise<string>;
1625
+ description: () => Promise<string>;
1628
1626
  /**
1629
1627
  * The name of the argument
1630
1628
  */
1631
- name(): Promise<string>;
1629
+ name: () => Promise<string>;
1632
1630
  /**
1633
1631
  * The type of the argument
1634
1632
  */
1635
- typeDef(): TypeDef;
1633
+ typeDef: () => TypeDef;
1636
1634
  }
1637
1635
  export declare class FunctionCall extends BaseClient {
1638
1636
  private readonly _name?;
@@ -1644,32 +1642,31 @@ export declare class FunctionCall extends BaseClient {
1644
1642
  */
1645
1643
  constructor(parent?: {
1646
1644
  queryTree?: QueryTree[];
1647
- host?: string;
1648
- sessionToken?: string;
1645
+ ctx: Context;
1649
1646
  }, _name?: string, _parent?: JSON, _parentName?: string, _returnValue?: Void);
1650
1647
  /**
1651
1648
  * The argument values the function is being invoked with.
1652
1649
  */
1653
- inputArgs(): Promise<FunctionCallArgValue[]>;
1650
+ inputArgs: () => Promise<FunctionCallArgValue[]>;
1654
1651
  /**
1655
1652
  * The name of the function being called.
1656
1653
  */
1657
- name(): Promise<string>;
1654
+ name: () => Promise<string>;
1658
1655
  /**
1659
1656
  * The value of the parent object of the function being called.
1660
1657
  * If the function is "top-level" to the module, this is always an empty object.
1661
1658
  */
1662
- parent(): Promise<JSON>;
1659
+ parent: () => Promise<JSON>;
1663
1660
  /**
1664
1661
  * The name of the parent object of the function being called.
1665
1662
  * If the function is "top-level" to the module, this is the name of the module.
1666
1663
  */
1667
- parentName(): Promise<string>;
1664
+ parentName: () => Promise<string>;
1668
1665
  /**
1669
1666
  * Set the return value of the function call to the provided value.
1670
1667
  * The value should be a string of the JSON serialization of the return value.
1671
1668
  */
1672
- returnValue(value: JSON): Promise<Void>;
1669
+ returnValue: (value: JSON) => Promise<Void>;
1673
1670
  }
1674
1671
  export declare class FunctionCallArgValue extends BaseClient {
1675
1672
  private readonly _name?;
@@ -1679,17 +1676,16 @@ export declare class FunctionCallArgValue extends BaseClient {
1679
1676
  */
1680
1677
  constructor(parent?: {
1681
1678
  queryTree?: QueryTree[];
1682
- host?: string;
1683
- sessionToken?: string;
1679
+ ctx: Context;
1684
1680
  }, _name?: string, _value?: JSON);
1685
1681
  /**
1686
1682
  * The name of the argument.
1687
1683
  */
1688
- name(): Promise<string>;
1684
+ name: () => Promise<string>;
1689
1685
  /**
1690
1686
  * The value of the argument represented as a string of the JSON serialization.
1691
1687
  */
1692
- value(): Promise<JSON>;
1688
+ value: () => Promise<JSON>;
1693
1689
  }
1694
1690
  export declare class GeneratedCode extends BaseClient {
1695
1691
  private readonly _id?;
@@ -1698,86 +1694,93 @@ export declare class GeneratedCode extends BaseClient {
1698
1694
  */
1699
1695
  constructor(parent?: {
1700
1696
  queryTree?: QueryTree[];
1701
- host?: string;
1702
- sessionToken?: string;
1697
+ ctx: Context;
1703
1698
  }, _id?: GeneratedCodeID);
1704
- id(): Promise<GeneratedCodeID>;
1699
+ id: () => Promise<GeneratedCodeID>;
1705
1700
  /**
1706
1701
  * The directory containing the generated code
1707
1702
  */
1708
- code(): Directory;
1703
+ code: () => Directory;
1709
1704
  /**
1710
1705
  * List of paths to mark generated in version control (i.e. .gitattributes)
1711
1706
  */
1712
- vcsGeneratedPaths(): Promise<string[]>;
1707
+ vcsGeneratedPaths: () => Promise<string[]>;
1713
1708
  /**
1714
1709
  * List of paths to ignore in version control (i.e. .gitignore)
1715
1710
  */
1716
- vcsIgnoredPaths(): Promise<string[]>;
1711
+ vcsIgnoredPaths: () => Promise<string[]>;
1717
1712
  /**
1718
1713
  * Set the list of paths to mark generated in version control
1719
1714
  */
1720
- withVCSGeneratedPaths(paths: string[]): GeneratedCode;
1715
+ withVCSGeneratedPaths: (paths: string[]) => GeneratedCode;
1721
1716
  /**
1722
1717
  * Set the list of paths to ignore in version control
1723
1718
  */
1724
- withVCSIgnoredPaths(paths: string[]): GeneratedCode;
1719
+ withVCSIgnoredPaths: (paths: string[]) => GeneratedCode;
1725
1720
  /**
1726
1721
  * Call the provided function with current GeneratedCode.
1727
1722
  *
1728
1723
  * This is useful for reusability and readability by not breaking the calling chain.
1729
1724
  */
1730
- with(arg: (param: GeneratedCode) => GeneratedCode): GeneratedCode;
1725
+ with: (arg: (param: GeneratedCode) => GeneratedCode) => GeneratedCode;
1731
1726
  }
1732
1727
  /**
1733
1728
  * A git ref (tag, branch or commit).
1734
1729
  */
1735
1730
  export declare class GitRef extends BaseClient {
1731
+ private readonly _id?;
1736
1732
  private readonly _commit?;
1737
1733
  /**
1738
1734
  * Constructor is used for internal usage only, do not create object from it.
1739
1735
  */
1740
1736
  constructor(parent?: {
1741
1737
  queryTree?: QueryTree[];
1742
- host?: string;
1743
- sessionToken?: string;
1744
- }, _commit?: string);
1738
+ ctx: Context;
1739
+ }, _id?: GitRefID, _commit?: string);
1740
+ /**
1741
+ * Retrieves the content-addressed identifier of the git ref.
1742
+ */
1743
+ id: () => Promise<GitRefID>;
1745
1744
  /**
1746
1745
  * The resolved commit id at this ref.
1747
1746
  */
1748
- commit(): Promise<string>;
1747
+ commit: () => Promise<string>;
1749
1748
  /**
1750
1749
  * The filesystem tree at this ref.
1751
1750
  */
1752
- tree(opts?: GitRefTreeOpts): Directory;
1751
+ tree: (opts?: GitRefTreeOpts) => Directory;
1753
1752
  }
1754
1753
  /**
1755
1754
  * A git repository.
1756
1755
  */
1757
1756
  export declare class GitRepository extends BaseClient {
1757
+ private readonly _id?;
1758
1758
  /**
1759
1759
  * Constructor is used for internal usage only, do not create object from it.
1760
1760
  */
1761
1761
  constructor(parent?: {
1762
1762
  queryTree?: QueryTree[];
1763
- host?: string;
1764
- sessionToken?: string;
1765
- });
1763
+ ctx: Context;
1764
+ }, _id?: GitRepositoryID);
1765
+ /**
1766
+ * Retrieves the content-addressed identifier of the git repository.
1767
+ */
1768
+ id: () => Promise<GitRepositoryID>;
1766
1769
  /**
1767
1770
  * Returns details on one branch.
1768
1771
  * @param name Branch's name (e.g., "main").
1769
1772
  */
1770
- branch(name: string): GitRef;
1773
+ branch: (name: string) => GitRef;
1771
1774
  /**
1772
1775
  * Returns details on one commit.
1773
1776
  * @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
1774
1777
  */
1775
- commit(id: string): GitRef;
1778
+ commit: (id: string) => GitRef;
1776
1779
  /**
1777
1780
  * Returns details on one tag.
1778
1781
  * @param name Tag's name (e.g., "v0.3.9").
1779
1782
  */
1780
- tag(name: string): GitRef;
1783
+ tag: (name: string) => GitRef;
1781
1784
  }
1782
1785
  /**
1783
1786
  * Information about the host execution environment.
@@ -1788,8 +1791,7 @@ export declare class Host extends BaseClient {
1788
1791
  */
1789
1792
  constructor(parent?: {
1790
1793
  queryTree?: QueryTree[];
1791
- host?: string;
1792
- sessionToken?: string;
1794
+ ctx: Context;
1793
1795
  });
1794
1796
  /**
1795
1797
  * Accesses a directory on the host.
@@ -1797,12 +1799,12 @@ export declare class Host extends BaseClient {
1797
1799
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
1798
1800
  * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
1799
1801
  */
1800
- directory(path: string, opts?: HostDirectoryOpts): Directory;
1802
+ directory: (path: string, opts?: HostDirectoryOpts) => Directory;
1801
1803
  /**
1802
1804
  * Accesses a file on the host.
1803
1805
  * @param path Location of the file to retrieve (e.g., "README.md").
1804
1806
  */
1805
- file(path: string): File;
1807
+ file: (path: string) => File;
1806
1808
  /**
1807
1809
  * Creates a service that forwards traffic to a specified address via the host.
1808
1810
  * @param ports Ports to expose via the service, forwarding through the host network.
@@ -1813,14 +1815,14 @@ export declare class Host extends BaseClient {
1813
1815
  * An empty set of ports is not valid; an error will be returned.
1814
1816
  * @param opts.host Upstream host to forward traffic to.
1815
1817
  */
1816
- service(ports: PortForward[], opts?: HostServiceOpts): Service;
1818
+ service: (ports: PortForward[], opts?: HostServiceOpts) => Service;
1817
1819
  /**
1818
1820
  * Sets a secret given a user-defined name and the file path on the host, and returns the secret.
1819
1821
  * The file is limited to a size of 512000 bytes.
1820
1822
  * @param name The user defined name for this secret.
1821
1823
  * @param path Location of the file to set as a secret.
1822
1824
  */
1823
- setSecretFile(name: string, path: string): Secret;
1825
+ setSecretFile: (name: string, path: string) => Secret;
1824
1826
  /**
1825
1827
  * Creates a tunnel that forwards traffic from the host to a service.
1826
1828
  * @param service Service to send traffic from the tunnel.
@@ -1839,12 +1841,12 @@ export declare class Host extends BaseClient {
1839
1841
  *
1840
1842
  * If ports are given and native is true, the ports are additive.
1841
1843
  */
1842
- tunnel(service: Service, opts?: HostTunnelOpts): Service;
1844
+ tunnel: (service: Service, opts?: HostTunnelOpts) => Service;
1843
1845
  /**
1844
1846
  * Accesses a Unix socket on the host.
1845
1847
  * @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
1846
1848
  */
1847
- unixSocket(path: string): Socket;
1849
+ unixSocket: (path: string) => Socket;
1848
1850
  }
1849
1851
  /**
1850
1852
  * A simple key value object that represents a label.
@@ -1857,17 +1859,16 @@ export declare class Label extends BaseClient {
1857
1859
  */
1858
1860
  constructor(parent?: {
1859
1861
  queryTree?: QueryTree[];
1860
- host?: string;
1861
- sessionToken?: string;
1862
+ ctx: Context;
1862
1863
  }, _name?: string, _value?: string);
1863
1864
  /**
1864
1865
  * The label name.
1865
1866
  */
1866
- name(): Promise<string>;
1867
+ name: () => Promise<string>;
1867
1868
  /**
1868
1869
  * The label value.
1869
1870
  */
1870
- value(): Promise<string>;
1871
+ value: () => Promise<string>;
1871
1872
  }
1872
1873
  /**
1873
1874
  * A definition of a list type in a Module.
@@ -1878,13 +1879,12 @@ export declare class ListTypeDef extends BaseClient {
1878
1879
  */
1879
1880
  constructor(parent?: {
1880
1881
  queryTree?: QueryTree[];
1881
- host?: string;
1882
- sessionToken?: string;
1882
+ ctx: Context;
1883
1883
  });
1884
1884
  /**
1885
1885
  * The type of the elements in the list
1886
1886
  */
1887
- elementTypeDef(): TypeDef;
1887
+ elementTypeDef: () => TypeDef;
1888
1888
  }
1889
1889
  export declare class Module_ extends BaseClient {
1890
1890
  private readonly _id?;
@@ -1898,65 +1898,64 @@ export declare class Module_ extends BaseClient {
1898
1898
  */
1899
1899
  constructor(parent?: {
1900
1900
  queryTree?: QueryTree[];
1901
- host?: string;
1902
- sessionToken?: string;
1901
+ ctx: Context;
1903
1902
  }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _serve?: Void, _sourceDirectorySubPath?: string);
1904
1903
  /**
1905
1904
  * The ID of the module
1906
1905
  */
1907
- id(): Promise<ModuleID>;
1906
+ id: () => Promise<ModuleID>;
1908
1907
  /**
1909
1908
  * Modules used by this module
1910
1909
  */
1911
- dependencies(): Promise<Module_[]>;
1910
+ dependencies: () => Promise<Module_[]>;
1912
1911
  /**
1913
1912
  * The dependencies as configured by the module
1914
1913
  */
1915
- dependencyConfig(): Promise<string[]>;
1914
+ dependencyConfig: () => Promise<string[]>;
1916
1915
  /**
1917
1916
  * The doc string of the module, if any
1918
1917
  */
1919
- description(): Promise<string>;
1918
+ description: () => Promise<string>;
1920
1919
  /**
1921
1920
  * The code generated by the SDK's runtime
1922
1921
  */
1923
- generatedCode(): GeneratedCode;
1922
+ generatedCode: () => GeneratedCode;
1924
1923
  /**
1925
1924
  * The name of the module
1926
1925
  */
1927
- name(): Promise<string>;
1926
+ name: () => Promise<string>;
1928
1927
  /**
1929
1928
  * Objects served by this module
1930
1929
  */
1931
- objects(): Promise<TypeDef[]>;
1930
+ objects: () => Promise<TypeDef[]>;
1932
1931
  /**
1933
1932
  * The SDK used by this module. Either a name of a builtin SDK or a module ref pointing to the SDK's implementation.
1934
1933
  */
1935
- sdk(): Promise<string>;
1934
+ sdk: () => Promise<string>;
1936
1935
  /**
1937
1936
  * Serve a module's API in the current session.
1938
1937
  * Note: this can only be called once per session.
1939
1938
  * In the future, it could return a stream or service to remove the side effect.
1940
1939
  */
1941
- serve(): Promise<Void>;
1940
+ serve: () => Promise<Void>;
1942
1941
  /**
1943
1942
  * The directory containing the module's source code
1944
1943
  */
1945
- sourceDirectory(): Directory;
1944
+ sourceDirectory: () => Directory;
1946
1945
  /**
1947
1946
  * The module's subpath within the source directory
1948
1947
  */
1949
- sourceDirectorySubPath(): Promise<string>;
1948
+ sourceDirectorySubPath: () => Promise<string>;
1950
1949
  /**
1951
1950
  * This module plus the given Object type and associated functions
1952
1951
  */
1953
- withObject(object: TypeDef): Module_;
1952
+ withObject: (object: TypeDef) => Module_;
1954
1953
  /**
1955
1954
  * Call the provided function with current Module.
1956
1955
  *
1957
1956
  * This is useful for reusability and readability by not breaking the calling chain.
1958
1957
  */
1959
- with(arg: (param: Module_) => Module_): Module_;
1958
+ with: (arg: (param: Module_) => Module_) => Module_;
1960
1959
  }
1961
1960
  /**
1962
1961
  * Static configuration for a module (e.g. parsed contents of dagger.json)
@@ -1970,33 +1969,32 @@ export declare class ModuleConfig extends BaseClient {
1970
1969
  */
1971
1970
  constructor(parent?: {
1972
1971
  queryTree?: QueryTree[];
1973
- host?: string;
1974
- sessionToken?: string;
1972
+ ctx: Context;
1975
1973
  }, _name?: string, _root?: string, _sdk?: string);
1976
1974
  /**
1977
1975
  * Modules that this module depends on.
1978
1976
  */
1979
- dependencies(): Promise<string[]>;
1977
+ dependencies: () => Promise<string[]>;
1980
1978
  /**
1981
1979
  * Exclude these file globs when loading the module root.
1982
1980
  */
1983
- exclude(): Promise<string[]>;
1981
+ exclude: () => Promise<string[]>;
1984
1982
  /**
1985
1983
  * Include only these file globs when loading the module root.
1986
1984
  */
1987
- include(): Promise<string[]>;
1985
+ include: () => Promise<string[]>;
1988
1986
  /**
1989
1987
  * The name of the module.
1990
1988
  */
1991
- name(): Promise<string>;
1989
+ name: () => Promise<string>;
1992
1990
  /**
1993
1991
  * The root directory of the module's project, which may be above the module source code.
1994
1992
  */
1995
- root(): Promise<string>;
1993
+ root: () => Promise<string>;
1996
1994
  /**
1997
1995
  * Either the name of a built-in SDK ('go', 'python', etc.) OR a module reference pointing to the SDK's module implementation.
1998
1996
  */
1999
- sdk(): Promise<string>;
1997
+ sdk: () => Promise<string>;
2000
1998
  }
2001
1999
  /**
2002
2000
  * A definition of a custom object defined in a Module.
@@ -2009,25 +2007,28 @@ export declare class ObjectTypeDef extends BaseClient {
2009
2007
  */
2010
2008
  constructor(parent?: {
2011
2009
  queryTree?: QueryTree[];
2012
- host?: string;
2013
- sessionToken?: string;
2010
+ ctx: Context;
2014
2011
  }, _description?: string, _name?: string);
2012
+ /**
2013
+ * The function used to construct new instances of this object, if any
2014
+ */
2015
+ constructor_: () => Function_;
2015
2016
  /**
2016
2017
  * The doc string for the object, if any
2017
2018
  */
2018
- description(): Promise<string>;
2019
+ description: () => Promise<string>;
2019
2020
  /**
2020
2021
  * Static fields defined on this object, if any
2021
2022
  */
2022
- fields(): Promise<FieldTypeDef[]>;
2023
+ fields: () => Promise<FieldTypeDef[]>;
2023
2024
  /**
2024
2025
  * Functions defined on this object, if any
2025
2026
  */
2026
- functions(): Promise<Function_[]>;
2027
+ functions: () => Promise<Function_[]>;
2027
2028
  /**
2028
2029
  * The name of the object
2029
2030
  */
2030
- name(): Promise<string>;
2031
+ name: () => Promise<string>;
2031
2032
  }
2032
2033
  /**
2033
2034
  * A port exposed by a container.
@@ -2041,21 +2042,20 @@ export declare class Port extends BaseClient {
2041
2042
  */
2042
2043
  constructor(parent?: {
2043
2044
  queryTree?: QueryTree[];
2044
- host?: string;
2045
- sessionToken?: string;
2045
+ ctx: Context;
2046
2046
  }, _description?: string, _port?: number, _protocol?: NetworkProtocol);
2047
2047
  /**
2048
2048
  * The port description.
2049
2049
  */
2050
- description(): Promise<string>;
2050
+ description: () => Promise<string>;
2051
2051
  /**
2052
2052
  * The port number.
2053
2053
  */
2054
- port(): Promise<number>;
2054
+ port: () => Promise<number>;
2055
2055
  /**
2056
2056
  * The transport layer network protocol.
2057
2057
  */
2058
- protocol(): Promise<NetworkProtocol>;
2058
+ protocol: () => Promise<NetworkProtocol>;
2059
2059
  }
2060
2060
  export declare class Client extends BaseClient {
2061
2061
  private readonly _checkVersionCompatibility?;
@@ -2065,58 +2065,57 @@ export declare class Client extends BaseClient {
2065
2065
  */
2066
2066
  constructor(parent?: {
2067
2067
  queryTree?: QueryTree[];
2068
- host?: string;
2069
- sessionToken?: string;
2068
+ ctx: Context;
2070
2069
  }, _checkVersionCompatibility?: boolean, _defaultPlatform?: Platform);
2071
2070
  /**
2072
2071
  * Constructs a cache volume for a given cache key.
2073
2072
  * @param key A string identifier to target this cache volume (e.g., "modules-cache").
2074
2073
  */
2075
- cacheVolume(key: string): CacheVolume;
2074
+ cacheVolume: (key: string) => CacheVolume;
2076
2075
  /**
2077
2076
  * Checks if the current Dagger Engine is compatible with an SDK's required version.
2078
2077
  * @param version The SDK's required version.
2079
2078
  */
2080
- checkVersionCompatibility(version: string): Promise<boolean>;
2079
+ checkVersionCompatibility: (version: string) => Promise<boolean>;
2081
2080
  /**
2082
2081
  * Creates a scratch container or loads one by ID.
2083
2082
  *
2084
2083
  * Optional platform argument initializes new containers to execute and publish
2085
2084
  * as that platform. Platform defaults to that of the builder's host.
2086
2085
  */
2087
- container(opts?: ClientContainerOpts): Container;
2086
+ container: (opts?: ClientContainerOpts) => Container;
2088
2087
  /**
2089
2088
  * The FunctionCall context that the SDK caller is currently executing in.
2090
2089
  * If the caller is not currently executing in a function, this will return
2091
2090
  * an error.
2092
2091
  */
2093
- currentFunctionCall(): FunctionCall;
2092
+ currentFunctionCall: () => FunctionCall;
2094
2093
  /**
2095
2094
  * The module currently being served in the session, if any.
2096
2095
  */
2097
- currentModule(): Module_;
2096
+ currentModule: () => Module_;
2098
2097
  /**
2099
2098
  * The default platform of the builder.
2100
2099
  */
2101
- defaultPlatform(): Promise<Platform>;
2100
+ defaultPlatform: () => Promise<Platform>;
2102
2101
  /**
2103
2102
  * Creates an empty directory or loads one by ID.
2104
2103
  */
2105
- directory(opts?: ClientDirectoryOpts): Directory;
2104
+ directory: (opts?: ClientDirectoryOpts) => Directory;
2106
2105
  /**
2107
2106
  * Loads a file by ID.
2108
2107
  * @deprecated Use loadFileFromID instead.
2109
2108
  */
2110
- file(id: FileID): File;
2109
+ file: (id: FileID) => File;
2111
2110
  /**
2112
2111
  * Create a function.
2113
2112
  */
2114
- function_(name: string, returnType: TypeDef): Function_;
2113
+ function_: (name: string, returnType: TypeDef) => Function_;
2115
2114
  /**
2116
2115
  * Create a code generation result, given a directory containing the generated
2117
2116
  * code.
2118
2117
  */
2119
- generatedCode(code: Directory): GeneratedCode;
2118
+ generatedCode: (code: Directory) => GeneratedCode;
2120
2119
  /**
2121
2120
  * Queries a git repository.
2122
2121
  * @param url Url of the git repository.
@@ -2127,107 +2126,115 @@ export declare class Client extends BaseClient {
2127
2126
  * @param opts.sshAuthSocket Set SSH auth socket
2128
2127
  * @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
2129
2128
  */
2130
- git(url: string, opts?: ClientGitOpts): GitRepository;
2129
+ git: (url: string, opts?: ClientGitOpts) => GitRepository;
2131
2130
  /**
2132
2131
  * Queries the host environment.
2133
2132
  */
2134
- host(): Host;
2133
+ host: () => Host;
2135
2134
  /**
2136
2135
  * Returns a file containing an http remote url content.
2137
2136
  * @param url HTTP url to get the content from (e.g., "https://docs.dagger.io").
2138
2137
  * @param opts.experimentalServiceHost A service which must be started before the URL is fetched.
2139
2138
  */
2140
- http(url: string, opts?: ClientHttpOpts): File;
2139
+ http: (url: string, opts?: ClientHttpOpts) => File;
2141
2140
  /**
2142
2141
  * Load a CacheVolume from its ID.
2143
2142
  */
2144
- loadCacheVolumeFromID(id: CacheVolumeID): CacheVolume;
2143
+ loadCacheVolumeFromID: (id: CacheVolumeID) => CacheVolume;
2145
2144
  /**
2146
2145
  * Loads a container from an ID.
2147
2146
  */
2148
- loadContainerFromID(id: ContainerID): Container;
2147
+ loadContainerFromID: (id: ContainerID) => Container;
2149
2148
  /**
2150
2149
  * Load a Directory from its ID.
2151
2150
  */
2152
- loadDirectoryFromID(id: DirectoryID): Directory;
2151
+ loadDirectoryFromID: (id: DirectoryID) => Directory;
2153
2152
  /**
2154
2153
  * Load a File from its ID.
2155
2154
  */
2156
- loadFileFromID(id: FileID): File;
2155
+ loadFileFromID: (id: FileID) => File;
2157
2156
  /**
2158
2157
  * Load a function argument by ID.
2159
2158
  */
2160
- loadFunctionArgFromID(id: FunctionArgID): FunctionArg;
2159
+ loadFunctionArgFromID: (id: FunctionArgID) => FunctionArg;
2161
2160
  /**
2162
2161
  * Load a function by ID.
2163
2162
  */
2164
- loadFunctionFromID(id: FunctionID): Function_;
2163
+ loadFunctionFromID: (id: FunctionID) => Function_;
2165
2164
  /**
2166
2165
  * Load a GeneratedCode by ID.
2167
2166
  */
2168
- loadGeneratedCodeFromID(id: GeneratedCodeID): GeneratedCode;
2167
+ loadGeneratedCodeFromID: (id: GeneratedCodeID) => GeneratedCode;
2168
+ /**
2169
+ * Load a git ref from its ID.
2170
+ */
2171
+ loadGitRefFromID: (id: GitRefID) => GitRef;
2172
+ /**
2173
+ * Load a git repository from its ID.
2174
+ */
2175
+ loadGitRepositoryFromID: (id: GitRepositoryID) => GitRepository;
2169
2176
  /**
2170
2177
  * Load a module by ID.
2171
2178
  */
2172
- loadModuleFromID(id: ModuleID): Module_;
2179
+ loadModuleFromID: (id: ModuleID) => Module_;
2173
2180
  /**
2174
2181
  * Load a Secret from its ID.
2175
2182
  */
2176
- loadSecretFromID(id: SecretID): Secret;
2183
+ loadSecretFromID: (id: SecretID) => Secret;
2177
2184
  /**
2178
2185
  * Loads a service from ID.
2179
2186
  */
2180
- loadServiceFromID(id: ServiceID): Service;
2187
+ loadServiceFromID: (id: ServiceID) => Service;
2181
2188
  /**
2182
2189
  * Load a Socket from its ID.
2183
2190
  */
2184
- loadSocketFromID(id: SocketID): Socket;
2191
+ loadSocketFromID: (id: SocketID) => Socket;
2185
2192
  /**
2186
2193
  * Load a TypeDef by ID.
2187
2194
  */
2188
- loadTypeDefFromID(id: TypeDefID): TypeDef;
2195
+ loadTypeDefFromID: (id: TypeDefID) => TypeDef;
2189
2196
  /**
2190
2197
  * Create a new module.
2191
2198
  */
2192
- module_(): Module_;
2199
+ module_: () => Module_;
2193
2200
  /**
2194
2201
  * Load the static configuration for a module from the given source directory and optional subpath.
2195
2202
  */
2196
- moduleConfig(sourceDirectory: Directory, opts?: ClientModuleConfigOpts): ModuleConfig;
2203
+ moduleConfig: (sourceDirectory: Directory, opts?: ClientModuleConfigOpts) => ModuleConfig;
2197
2204
  /**
2198
2205
  * Creates a named sub-pipeline.
2199
2206
  * @param name Pipeline name.
2200
2207
  * @param opts.description Pipeline description.
2201
2208
  * @param opts.labels Pipeline labels.
2202
2209
  */
2203
- pipeline(name: string, opts?: ClientPipelineOpts): Client;
2210
+ pipeline: (name: string, opts?: ClientPipelineOpts) => Client;
2204
2211
  /**
2205
2212
  * Loads a secret from its ID.
2206
2213
  * @deprecated Use loadSecretFromID instead
2207
2214
  */
2208
- secret(id: SecretID): Secret;
2215
+ secret: (id: SecretID) => Secret;
2209
2216
  /**
2210
2217
  * Sets a secret given a user defined name to its plaintext and returns the secret.
2211
2218
  * The plaintext value is limited to a size of 128000 bytes.
2212
2219
  * @param name The user defined name for this secret
2213
2220
  * @param plaintext The plaintext of the secret
2214
2221
  */
2215
- setSecret(name: string, plaintext: string): Secret;
2222
+ setSecret: (name: string, plaintext: string) => Secret;
2216
2223
  /**
2217
2224
  * Loads a socket by its ID.
2218
2225
  * @deprecated Use loadSocketFromID instead.
2219
2226
  */
2220
- socket(opts?: ClientSocketOpts): Socket;
2227
+ socket: (opts?: ClientSocketOpts) => Socket;
2221
2228
  /**
2222
2229
  * Create a new TypeDef.
2223
2230
  */
2224
- typeDef(): TypeDef;
2231
+ typeDef: () => TypeDef;
2225
2232
  /**
2226
2233
  * Call the provided function with current Client.
2227
2234
  *
2228
2235
  * This is useful for reusability and readability by not breaking the calling chain.
2229
2236
  */
2230
- with(arg: (param: Client) => Client): Client;
2237
+ with: (arg: (param: Client) => Client) => Client;
2231
2238
  }
2232
2239
  /**
2233
2240
  * A reference to a secret value, which can be handled more safely than the value itself.
@@ -2240,17 +2247,16 @@ export declare class Secret extends BaseClient {
2240
2247
  */
2241
2248
  constructor(parent?: {
2242
2249
  queryTree?: QueryTree[];
2243
- host?: string;
2244
- sessionToken?: string;
2250
+ ctx: Context;
2245
2251
  }, _id?: SecretID, _plaintext?: string);
2246
2252
  /**
2247
2253
  * The identifier for this secret.
2248
2254
  */
2249
- id(): Promise<SecretID>;
2255
+ id: () => Promise<SecretID>;
2250
2256
  /**
2251
2257
  * The value of this secret.
2252
2258
  */
2253
- plaintext(): Promise<string>;
2259
+ plaintext: () => Promise<string>;
2254
2260
  }
2255
2261
  export declare class Service extends BaseClient {
2256
2262
  private readonly _id?;
@@ -2263,13 +2269,12 @@ export declare class Service extends BaseClient {
2263
2269
  */
2264
2270
  constructor(parent?: {
2265
2271
  queryTree?: QueryTree[];
2266
- host?: string;
2267
- sessionToken?: string;
2272
+ ctx: Context;
2268
2273
  }, _id?: ServiceID, _endpoint?: string, _hostname?: string, _start?: ServiceID, _stop?: ServiceID);
2269
2274
  /**
2270
2275
  * A unique identifier for this service.
2271
2276
  */
2272
- id(): Promise<ServiceID>;
2277
+ id: () => Promise<ServiceID>;
2273
2278
  /**
2274
2279
  * Retrieves an endpoint that clients can use to reach this container.
2275
2280
  *
@@ -2279,25 +2284,25 @@ export declare class Service extends BaseClient {
2279
2284
  * @param opts.port The exposed port number for the endpoint
2280
2285
  * @param opts.scheme Return a URL with the given scheme, eg. http for http://
2281
2286
  */
2282
- endpoint(opts?: ServiceEndpointOpts): Promise<string>;
2287
+ endpoint: (opts?: ServiceEndpointOpts) => Promise<string>;
2283
2288
  /**
2284
2289
  * Retrieves a hostname which can be used by clients to reach this container.
2285
2290
  */
2286
- hostname(): Promise<string>;
2291
+ hostname: () => Promise<string>;
2287
2292
  /**
2288
2293
  * Retrieves the list of ports provided by the service.
2289
2294
  */
2290
- ports(): Promise<Port[]>;
2295
+ ports: () => Promise<Port[]>;
2291
2296
  /**
2292
2297
  * Start the service and wait for its health checks to succeed.
2293
2298
  *
2294
2299
  * Services bound to a Container do not need to be manually started.
2295
2300
  */
2296
- start(): Promise<Service>;
2301
+ start: () => Promise<Service>;
2297
2302
  /**
2298
2303
  * Stop the service.
2299
2304
  */
2300
- stop(): Promise<Service>;
2305
+ stop: () => Promise<Service>;
2301
2306
  }
2302
2307
  export declare class Socket extends BaseClient {
2303
2308
  private readonly _id?;
@@ -2306,13 +2311,12 @@ export declare class Socket extends BaseClient {
2306
2311
  */
2307
2312
  constructor(parent?: {
2308
2313
  queryTree?: QueryTree[];
2309
- host?: string;
2310
- sessionToken?: string;
2314
+ ctx: Context;
2311
2315
  }, _id?: SocketID);
2312
2316
  /**
2313
2317
  * The content-addressed identifier of the socket.
2314
2318
  */
2315
- id(): Promise<SocketID>;
2319
+ id: () => Promise<SocketID>;
2316
2320
  }
2317
2321
  /**
2318
2322
  * A definition of a parameter or return type in a Module.
@@ -2326,47 +2330,50 @@ export declare class TypeDef extends BaseClient {
2326
2330
  */
2327
2331
  constructor(parent?: {
2328
2332
  queryTree?: QueryTree[];
2329
- host?: string;
2330
- sessionToken?: string;
2333
+ ctx: Context;
2331
2334
  }, _id?: TypeDefID, _kind?: TypeDefKind, _optional?: boolean);
2332
- id(): Promise<TypeDefID>;
2335
+ id: () => Promise<TypeDefID>;
2333
2336
  /**
2334
2337
  * If kind is LIST, the list-specific type definition.
2335
2338
  * If kind is not LIST, this will be null.
2336
2339
  */
2337
- asList(): ListTypeDef;
2340
+ asList: () => ListTypeDef;
2338
2341
  /**
2339
2342
  * If kind is OBJECT, the object-specific type definition.
2340
2343
  * If kind is not OBJECT, this will be null.
2341
2344
  */
2342
- asObject(): ObjectTypeDef;
2345
+ asObject: () => ObjectTypeDef;
2343
2346
  /**
2344
2347
  * The kind of type this is (e.g. primitive, list, object)
2345
2348
  */
2346
- kind(): Promise<TypeDefKind>;
2349
+ kind: () => Promise<TypeDefKind>;
2347
2350
  /**
2348
2351
  * Whether this type can be set to null. Defaults to false.
2349
2352
  */
2350
- optional(): Promise<boolean>;
2353
+ optional: () => Promise<boolean>;
2354
+ /**
2355
+ * Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
2356
+ */
2357
+ withConstructor: (function_: Function_) => TypeDef;
2351
2358
  /**
2352
2359
  * Adds a static field for an Object TypeDef, failing if the type is not an object.
2353
2360
  * @param name The name of the field in the object
2354
2361
  * @param typeDef The type of the field
2355
2362
  * @param opts.description A doc string for the field, if any
2356
2363
  */
2357
- withField(name: string, typeDef: TypeDef, opts?: TypeDefWithFieldOpts): TypeDef;
2364
+ withField: (name: string, typeDef: TypeDef, opts?: TypeDefWithFieldOpts) => TypeDef;
2358
2365
  /**
2359
2366
  * Adds a function for an Object TypeDef, failing if the type is not an object.
2360
2367
  */
2361
- withFunction(function_: Function_): TypeDef;
2368
+ withFunction: (function_: Function_) => TypeDef;
2362
2369
  /**
2363
2370
  * Sets the kind of the type.
2364
2371
  */
2365
- withKind(kind: TypeDefKind): TypeDef;
2372
+ withKind: (kind: TypeDefKind) => TypeDef;
2366
2373
  /**
2367
2374
  * Returns a TypeDef of kind List with the provided type for its elements.
2368
2375
  */
2369
- withListOf(elementType: TypeDef): TypeDef;
2376
+ withListOf: (elementType: TypeDef) => TypeDef;
2370
2377
  /**
2371
2378
  * Returns a TypeDef of kind Object with the provided name.
2372
2379
  *
@@ -2374,17 +2381,18 @@ export declare class TypeDef extends BaseClient {
2374
2381
  * only to refer to an object. This is how functions are able to return their
2375
2382
  * own object, or any other circular reference.
2376
2383
  */
2377
- withObject(name: string, opts?: TypeDefWithObjectOpts): TypeDef;
2384
+ withObject: (name: string, opts?: TypeDefWithObjectOpts) => TypeDef;
2378
2385
  /**
2379
2386
  * Sets whether this type can be set to null.
2380
2387
  */
2381
- withOptional(optional: boolean): TypeDef;
2388
+ withOptional: (optional: boolean) => TypeDef;
2382
2389
  /**
2383
2390
  * Call the provided function with current TypeDef.
2384
2391
  *
2385
2392
  * This is useful for reusability and readability by not breaking the calling chain.
2386
2393
  */
2387
- with(arg: (param: TypeDef) => TypeDef): TypeDef;
2394
+ with: (arg: (param: TypeDef) => TypeDef) => TypeDef;
2388
2395
  }
2396
+ export declare const dag: Client;
2389
2397
  export {};
2390
2398
  //# sourceMappingURL=client.gen.d.ts.map